By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. If you have access to the IIS configuration, you can configure the
idle time-out settings to
0 (details). If you are hosting your web app on Azure, you can enable the
Always on option (details).
But, if you cannot remove the idle time-out, here's a nice tip to keep your web site online. The idea is to make a request at a regular intervals (more frequently than the idle timeout), so the site is never unloaded.
This is where Application Insights takes action. Indeed, one of the functionality of Application Insights is to test the availability of a website. Great news, this is free and you'll get a nice report of the up-time of your website!
- Create a free Azure account
- Create a new Application Insights instance
- Add an availability test
Application Insights will query your website from 5 differents locations every 5 minutes. This should be enough to prevent the web site from being unloaded 😃 As a bonus, you'll get nice availability and performance reports.
Do you have a question or a suggestion about this post? Contact me!