Hosting Sitefinity in Azure: Best Practices
Microsoft Azure provides excellent resources for the hosting of Sitefinity websites. In fact, Progress hosts its Sitefinity Cloud on Microsoft Azure. Here at Smooth Fusion, we were among the first to host Sitefinity sites on Azure. Over the years that our team has hosted Sitefinity in Azure, we have learned some tricks and tips for keeping Sitefinity sites up and running smoothly in Microsoft Azure, including the following five best practices.
Learn more about our Sitefinity Hosting Services
1. Use Azure Web Apps
Our team uses Azure Web Apps to host Sitefinity sites. We have found the app service plan that provides the most bang for the buck is a PremiumV2 Level 1 plan (P1V2). These have great processing power and 3.5GB of RAM. We have found that these plans can handle 3 to 5 Sitefinity sites, depending on the size of the site, as measured by pages. In the case of a very large site, we run it on its own P1V2 plan. We even wrote a blog on why we use Azure Web Apps.
2. Always On
One of the most important settings we turn on in the Azure Web App is “Always On”. This ensures the site will never fall out of memory unless a restart occurs. This is important for Sitefinity sites because so much content is cached in memory on startup. If the site were to fall out of memory, site visitors may have to wait several minutes for Sitefinity to re-cache pages and start-up.
3. Minimizing Restarts
By default, when the backend storage infrastructure in Azure undergoes changes, the web app restarts. It is important to minimize restarts because of the time it takes Sitefinity to re-cache pages. To address that, we add the WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG Application Setting and set it to “1”. This setting prevents the web app worker process from restarting when it loses the connection to the backend Azure Storage (where the files are actually stored). This loss of connection is usually due to maintenance in Azure Storage.
4. Warming Up Sites
For sites sensitive to downtime on rollouts, we use Azure Deployment slots. We roll out the files to the “warmup” slot, warm it up, test it, then use the Azure Swap feature to make the warmup slot the new Live site. Traffic seamlessly flows to the new site with no disruption. Another advantage to the warmup slot is it gives us a chance to "warm up" all pages of the site. We have a custom script that hits every single page allowing Sitefinity to cache the content in memory and making it fast for users once it goes live.
Related post: Best Practices for Site Deployment and Hosting
5. Use Azure Elastic Pool
On the backend, we use Azure SQL databases in an Azure elastic pool. The elastic pool feature allows multiple databases to share a pool of resources. This gives our Sitefinity sites a massive amount of database power when they need it. Most Sitefinity sites use under 10 DTUs (a measurement of database performance), but with a pool of 300 DTUs, it’s ready for spikes from Sitefinity startups or other database-intensive tasks.
Don't Want to Host the Site Yourself?
If you are interested in alternatives to managing the hosting yourself, Progress offers Sitefinity Cloud, which is available in multiple regions and in multiple tiers. Additionally, Progress Sitefinity Partners like Smooth Fusion will also manage the Azure hosting for you.
Have other Azure hosting tips? Please let us know so that we can include them in this post.