In the part 2 of this topic, we will look at couple of tips to optimize your Sitecore application deployed on PaaS.
When a client has a problem with performance of their Sitecore instance, and that instance is deployed in PaaS, while using Azure SQL as an example, what alaways is the problem is DTU number on databases.
What is DTU?
A [Database Transaction Unit] is a blended measure of CPU, memory, and data I/O and transaction log I/O in a ratio determined by an OLTP benchmark workload designed to be typical of real-world OLTP workloads. Doubling the DTUs by increasing the performance level of a database equates to doubling the set of resource available to that database.
You can find more details on the DTU’s at SQLPerformance.com post here: https://sqlperformance.com/2017/03/azure/what-the-heck-is-a-dtu
So, if we go over our databases we can see which databases are “problematic”. And usually, you have 3 main ones that are mostly “problematic”, core, master or web.
If we go to one of this databases, and go to Configure, you can choose how many DTUs you want on this databses. Rule is simple, higher DTU – higher performance – higher price.
After that, track your database daily by using Metrics and see how it behaves. In the screenshoot bellow you can see that with 50DTUs my database is not doing much work, but it’s a test env.
Second thing we can do to increase our performance is Elastic pools. So, what are those?
SQL Database elastic pools are a simple, cost-effective solution for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single Azure SQL Database server and share a set number of resources at a set price. Elastic pools in Azure SQL Database enable SaaS developers to optimize the price performance for a group of databases within a prescribed budget while delivering performance elasticity for each database.
If you go to your Azure SQL Server and click Add Pools on the Overview top bar, you will have option to configure that this SQL server uses elastic pool for its databases.
Now, elastic pools are perfect for DEV envs, cause you don’t have constant load, just spikes here and there. For PROD env. general recommendation is to use several elastic pools.
Next thing we can do is to check App Service Plan. Is the plan we are currently using for our env. enough? Do we need to scale up or even maybe scale down?
Rule is simple, analyze your instance and see how much resources you use. Is your, as an example, Content Management server constantly slow? Try to increase it service plan to a Tier higher. You can find more on Tier pricing and capablilites here:
For the end couple of “all-known” rules to increase performance:
- Minify CSS and JS
- Use CDN for your static files like CSS and JS
- Use CDN for your media files,either images or videos