21
votes

is there a way to set the timeout of an app pool of a web-site running under azure sites.

I have a site running there and it seems like it needs to spin up again when it has been idle for a while.

3
One way to keep your site alive is to setup a script somewhere that gets some page from your website every 15 minutes (basically HTTP GET some url). This way your site is active and it is not recycled. This is a trick that is used by many people who use shared hosting but I have no idea if it works with azure web sites. You can use service like PingdomToni Parviainen
I blogged about how to solve this problem, and built a service to keep your site alive: ideasof.andersaberg.com/idea/14/…Anders
Azure Web Sites now have an Always On feature (see weblogs.asp.net/scottgu/archive/2014/01/16/…)twomm
the always on feature seems to be available for the Standard tier onlyFilip

3 Answers

18
votes

Windows Azure Web Sites supports two modes, shared and Reserved.

In Shared mode, your web site process (w3wp) runs alongside other, sharing resources including CPU and memory. The runtime (that is Windows Azure Web Sites system) remove sites from memory after period of idleness – that is when your site doesn’t get any traffic. The runtime make the decisions removing sites, bases on many parameters, and even if you change the configuration, it may not apply, as the runtime may override that configuration.

If you are looking for your site to always be in memory, you may want to look into switching to Reserved Instance, in which your site(s) are running on their own VM(s) and the system is much more flexible in terms of resource utilization.

Yochay (PM Azure Web Sites)

18
votes

Since the relevant answer is in the comments it is easy to miss it. Currently Azure Web Apps support the Always On feature, that keeps your app in memory. It is available in Basic and upper tiers and you can configure it from the portal:

Resource_Group > Web App > Settings > Application settings

Always On

If you want to achieve the same effect in Free or Shared tiers you can create a webjob that will ping your website to keep it in memory. There are numerous blog posts how to achieve this 1, 2, etc.

3
votes

If you're referring to the new Windows Azure Web Sites, I don't believe you have any option for controlling app pool timeout. This is a shared, managed service, where you simply upload your site, with the details of IIS etc. taken care of for you. You can look through the published management page, and you'll see that this is not an option.