More in this section
Categories
Bloggers
Blogs RSS feed

Sitefinity performance boosters - keeping your pages warm

by User Not Found

 A question I’ve received multiple times is “Why is it taking so long to load Sitefinity the first time after I recycle my application pool/restart my server/make change in my web.config file, etc"?

The answer is simple – it’s how .NET works!
Sitefinity is an ASP.NET web application. As such, the first time a user requests a resource from the website ASP.NET automatically compiles the application code and any dependent resources. Furthermore any application pool recycles, modifications in the source code or the top-level items of the application (such as the web.config, global.asax, etc) would cause ASP.NET to recompile the source files into assemblies. More info about ASP.NET’s application lifecycle can be found on MSDN.

So is there a way after a scheduled application pool recycle or change in the code for avoiding the first user to have to wait until the application recompiles? The answer is – yes, there is! It’s called application warm-up. It’s all about forcing the application to reinitialize after it has been restarted. It’s not something you do from within Sitefinity, just as recompilation doesn’t happen because of Sitefinity.

There are a couple of handy tools that work like a charm to achieve the required results:

1) Application Initialization for IIS 7.5 - IIS Application Initialization for IIS 7.5 enables website administrators to improve the responsiveness of their Web sites by loading the Web applications before the first request arrives.
Well, after giving it a try, it does do what it says on the tin! After installing it on your server, you can either configure forcing individual applications to reinitialize after an application pool recycle/server restart, or configure the applications to reinitialize after a soft reset (edits in web.config, etc).
In order to set up application warm-up after a recycle, you need to edit your %windir%\system32\inetsrv\config\applicationHost.config file and locate your <system.applicationHost> block. Edit the settings of the application you’d like to automatically initialize after a restart like this:

<add name="MyApplicationPoolName" autoStart="true" startMode="AlwaysRunning" managedRuntimeVersion="v4.0">

Next, under the <sites> block, configure the serverAutoStart property of your website like this:

<site name="MySiteName" id="#" serverAutoStart="true">
<application path="/" preloadEnabled="true" applicationPool=" MyApplicationPoolName ">

This way, even if you recycle your application pool on regular intervals or at a specific date/time, it will initialize automatically afterwards and initial load time will be normal for the first user that hits your website afterwards.

2) Keep Alive Service For IIS 6.0/7.5 – the keep alive service requires no configuration, i.e. you install and forget about it. It monitors your IIS metabase and keeps all websites warm and quick.

So far I’ve been experimenting with these two and they seem to work pretty well.
Feel free to add your own tips, tricks and suggestions to the list!

43 comments

Leave a comment
  1. Steve Jul 09, 2012
    Good tip!  Wondered how to get this guy working...but the #2 link 404s here for me
  2. Grisha 'Greg' Karanikolov Jul 10, 2012
    Hi Steve,
    thanks for letting me know about the broken link, should work now!
    More on the configuration of the Application Initialization tool could be found here. This is what it says:

    The Application Initialization feature can be configured in two places: the machine-wide applicationHost.config file, and the application-level web.config file. Configuration in the applicationHost.config file contains "global" application initialization settings, while an application-level web.config file contains "local" application initialization settings.
  3. Mark McNeece Jul 18, 2012
    Hi Greg

    Thanks for this great tip.  Just to mention that startMode="alwaysRunning" should actually be startMode="AlwaysRunning" 

    The system complains if you don't use a capital letter.

    Best
    Mark
  4. Grisha 'Greg' Karanikolov Jul 23, 2012
    Hi Mark!
    Thanks for the remark, I've corrected this in my post.
    And I've awarded you with some Telerik points for pointing this out to me.
  5. Austin Dimmer Nov 16, 2012
    Hi,

    Any tips as to how to achieve the same result if we are running in Azure?

    Appreciated if you do!
  6. Marcellino Bommezijn Feb 10, 2013

    If the default is already set you don't need to add individual in the system.applicationhost section.

    <applicationPoolDefaults managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" startMode="AlwaysRunning"> 

  7. Nafeez Aug 26, 2014
    any solution for page loading below the existing page
  8. Brian Mar 24, 2015
    Does this shrink the load time for every page on the site or just overall starting the site up on first visit? I am having a problem where every page takes forever the first time it loads but then speeds up afterwards. What can I do about that?
  9. Grisha 'Greg' Karanikolov Mar 25, 2015

    Hi Brian,

    I would recommend using the Sitefinity Primer for that - it's a tool that hits a chosen set of your pages and services and warms them up. This should speed up your page load time.

  10. Rahul Aug 28, 2015

    This is how .NET works??? Are you kidding me ... This is just a terribly designed CMS. There are dozens of other CMSes out there without this issue ... if we had known about this issue we would have never purchased this application but now we're half way through and no way to back out.

    For each page to take minutes (not seconds) to load just shows lack of development quality and understanding of real world web applications ... and the suggestion to pre-load pages as a workaround is laughable. Something I would expect a script-kiddie to suggest and not any serious engineer.

  11. Jacobsen K Aug 29, 2015

    We have also had poor performance experience with SFCMS with very long load times and responses. Pre-warming is ok for a short-term workaround but eventually you need to look at a more permanent solution. 

    Have you tried optimizing your TTLs as well as database? 

    In the beginning when lot of changes are happening you will find performance to be worse but this should get better over time also

  12. Vladi Sep 03, 2015

    Actually, Sitefinity is quite optimized when using its build-in components. However, its extensibility allows to plug in any custom code in many places and create custom widgets with poor performance. The performance of this custom code affect the overall performance of the application.

    The pages and templates compilation is also a kind performance improvement, which is related to the specific of the ASP.NET application. However, it appears as a bottleneck just after deploying the site on production, because the asp.net compiler cannot handle many precompilations at a time. Deploying the site means changing the bin folder. Application pool recycles does not cause precompilation. So, deployment is actually happens very rare in the real live scenario. Only in this cases you need to warm up the site.

    In order to optimize the deployment Sitefinity provides a precompiler tool (http://docs.sitefinity.com/for-developers-sitefinity-precompiler-tool), which allows to deploy a site with already compiled pages and in this way better handle the initial load just after deploying the site.

  13. Steve Nov 18, 2015

    My suggest is also remember to tweak your app config file.  Make sure to remove any unnecessary settings.  One of the biggest mistakes I see all the time is leaving the site in "debug" mode. 

    Make if you are using a custom web.config that setting is set to false on a production site.

    <configuration>

    <system.web>

    <compilation 

    debug = "false"

    >

    </system.web>

    </configuration>

    Hope this helps,

    Steve, MyriadMedia.com, DC area

  14. rinofebri Apr 02, 2018
    I can only express a word of thanks. Because with the content on this blog I can add knowledge I,  thank has been sharing this information. Do not forget to visit our website to share information and knowledge about health.cara mengobati pengapcara menyembuhkan abses payudarakeunggulan walatra gamat emas kapsulkhasiat herbal walatrakhasiat jelly gamat kapsulthank you for the visit, thank you also have provided the information we really need, do not forget to share information and visit our page thank you. Do not forget to visit our website to share information about health. greetings success
  15. More information May 05, 2018
    Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work.More information
  16. generator rental May 05, 2018
    Thanks, that was a really cool read!generator rental
  17. melancong May 05, 2018
    Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that.melancong
  18. restaurantes carnes May 05, 2018
    It proved to be Very helpful to me and I am sure to all the commentators here!restaurantes carnes
  19. Rtiz Carlton Orlando Wedding May 05, 2018
    nice bLog! its interesting. thank you for sharing....Rtiz Carlton Orlando Wedding
  20. roseville chiropractic center May 05, 2018
    I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject?roseville chiropractic center
  21. vintage mens wrist watch May 05, 2018
    Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.vintage mens wrist watch
  22. INFORMÁTICO FORENSE MADRID May 05, 2018
    i am always looking for some free stuffs over the internet. there are also some companies which gives free samples.INFORMÁTICO FORENSE MADRID
  23. Phi phi island May 05, 2018
    Nice knowledPhi phi islandge gaining article. This post is really the best on this valuable topic.Phi phi island
  24. Kiev Ulusal Politeknik Üniversitesi May 05, 2018
    Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next..Kiev Ulusal Politeknik Üniversitesi
  25. Atomic Design May 07, 2018
    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.Atomic Design
  26. bomberman 64 May 15, 2018
    I went over this website and I believe you have a lot of wonderful information, saved to my bookmarksbomberman 64
  27. DETECTIVE MADRID May 17, 2018
    Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best.DETECTIVE MADRID
  28. tessycter May 20, 2018
    Amazing content, thanks for discussing about the facts may be valuable  καταταξη ιστοσελιδας στο google
  29. MONIKA May 22, 2018
    This is a brilliant blog! I'm very happy with the comments!..https://seguidoresbrasil.com
  30. MONIKA May 23, 2018
    Ganhar curtidas no instagram de um modo rápido, seguro é com o site Curtidas Grátis. O melhor site para ganhar curtidas e likes no Instagram.
  31. MONIKA May 24, 2018
    Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have.2018 D Penny box - 2018 D Penny Roll
  32. Lenni May 28, 2018
    I am lucky that I discovered your site by chance. I have book-marked it for future use! natural wooden grill scraper
  33. MONIKA May 28, 2018
    Very useful info. Hope to see more posts soon!.Email Filtering Malaysia
  34. MONIKA May 30, 2018
    Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject.Detectives Madrid
  35. MONIKA Jun 07, 2018
    This is the type of information I’ve long been trying to find. Thank you for writing this information.Detective en Madrid
  36. MONIKA Jun 09, 2018
    Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.t shirt printer
  37. MONIKA Jun 11, 2018
    There is so much in this article that I would never have thought of on my own. Your content gives readers things to think about in an interesting way. Thank you for your clear information. Lynnwood, WA Complex
  38. Harrison Jun 11, 2018

    It was really great to check out this kind of content, kindly notify me for more updates.

     

    amazing grass superfood

  39. MONIKA Jun 14, 2018
    Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best.likes para instagram
  40. Jerry Jun 14, 2018

    Your website did develop more learning for its readers and I am very impressed with it.

    john

  41. Monika Jun 21, 2018
    For over 10 years, Hair Restoration Laboratories has developed and offered to men and women the most effective DHT blocking hair loss shampoos and conditioners to help reverse hair loss and regrow hair.Hair regrowth shampoo
  42. kak brus Jun 22, 2018

    Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work!. Thank you for this wonderful Article! fnaf

  43. Shamsey Jun 23, 2018
    Thanks for the information, Testosterone Boosters  they’re certainly good food for thought. I’m going to read over them a few times so they sink in. 

    Leave a comment