Tips for optimizing performance
Upgrade your project to Sitefinity CMS 7.0 version
With version 7.0, Sitefinity CMS has reduced the CPU startup time by 25% compared to Sitefinity CMS 6.3 by moving the compilation of the inline editing’s Razor templates from runtime to build time.
For more information, see Upgrade.
Configure the recycle time
When the site is accessed for the first time and Sitefinity CMS is activated, many operations are carried before Sitefinity CMS can function. For example, configurations are loaded, resources are loaded, most of the modules and data providers are initialized, database connections are established, and object/relational mappings are constructed. In some cases, dynamic types also have to be constructed.
RECOMMENDATION: To improve the overall experience, configure the application pool to recycle the process as less as possible and configure your application to start automatically after recycle. You can configure it to recycle every 24 hours, during the time when the site is least accessed. For more information about how to configure auto start, see http://www.techbubbles.com/aspnet/auto-start-web-applications-in-aspnet-40/.
This way, the user who makes the first request after the recycle, will not experience slow response, because of the initialization. You can set up the recycle periods in the advanced settings of the application pool in the IIS management console. You must also disable recycling for idle time.
Force pages to compile
When a page is served for the first time after it has been published, Sitefinity CMS generates the markup for that page and then it passes it to ASP.NET engine for compilation. Then ASP.NET compiles the page in an assembly that is stored in a temporary folder. Then the actual page instance is created from the compiled assembly and subsequent request are served faster, because the steps for generating the markup and compilation are skipped. The compiled assembly is persistent between application restarts, but it will be invalidated and recompiled, if the page is changed and republished or, if for some reason, the ASP.NET assembly cache is cleared.
RECOMMENDATION: You can create an external service, which periodically browses the site. This way it will force any not compiled page to compile.
Change the cache expiration time
Once the page is compiled, the actual request processing begins. The page is instantiated and executed. The page and all controls on it go through their lifecycle to complete their business logic and generate the output HTML. Also, this is the stage where all permissions are checked, all necessary data is collected from the database etc. Once the response is generated, it could be cached before sending it to the client. By default, Sitefinity CMS caches the response allowing subsequent requests to skip the entire step.
NOTE: The response may vary for different browsers and some request conditions. This is why this step may still be executed even though the output has already been cached. For example, if the request is authenticated with credentials that allow inline editing, output cache will not take effect and this step will always be executed. When testing output cache, make sure you are logged out.
RECOMMENDATION: Set output cache expiration to much longer period. The default is 2 minutes.
Optimize database performance
When publishing modified pages, or performing synchronization, it is possible that you experience degrading performance during the process due to fragmented database space. This may result in slow inserts of new data in the database and slow read times during publishing.
To avoid fragmentation of the database indexes and to improve write performance and scalability of the Microsoft SQL Server, Sitefinity CMS uses sequential GUIDs for database records' IDs where applicable. For more information, see Site synchronization key.
In addition, you can rebuild the database’s clustered indexes on a regular basis to maintain the database,optimize its performance, and avoid fragmentation of the clustered indexes.
RECOMMENDATION: Enable the database maintenance option in Sitefinity CMS or manually rebuild database indexes. For more information, see Database configuration.