17

We are using free BizSpark subscription on Azure and hosting our application as Azure Web Site. We periodically struggle with unexpected site shutdowns what's very painful for our application since it has a lot of background process running.

"Always on" setting can be a remedy for this problem, but unfortunately it's unavailable for us in the current subscription.

As you may know IIS has two settings recycle based on:

  1. By default, each application is terminated every 1740 minutes (29 hours) - periodic restart timeout.
  2. Also application can be recycled if it's unused for 20 minutes - idle timeout.

I'd like to know if we turn on "Always on" setting, can we be sure that it helps us to prevent both application recycles types described above.

By the way, I found this question: Will "Always On" setting prevent BOTH idleTimeout and periodicRestart? with similar topic. It says that this setting should help.

But I'd like to be sure, that it's true. Because interruptions of live background processes are absolutely unacceptable in our case.

Appreciate any answers.

Community
  • 1
  • 1
Artyom Pranovich
  • 6,814
  • 8
  • 41
  • 60

2 Answers2

11

Yes both will be prevented when you have "Always On" turned on. The answer to the question you linked to (Will "Always On" setting prevent BOTH idleTimeout and periodicRestart?) contains the full details. If you have multiple instances running "Always On" will also ensure that all of them stay running.

For long running processes I'd highly recommend using Azure Web Jobs if you can. The Azure Webjobs SDK will make your development life a lot easier and provide you with a lot of nice monitoring for free. Check out this tutorial by Scott Hanselman here: http://www.hanselman.com/blog/IntroducingWindowsAzureWebJobs.aspx

FYI, Webjobs run in the context of your website, so if your website is recycled (if Always On is disabled) then your Webjob will also stop running. Enabling "Always On" will keep both your web jobs and your web site up.

Community
  • 1
  • 1
Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
  • Zain, if an application that is hosted in IIS goes idle after the duration set in the idle timeout setting (by default, 20 minutes), will the cache it stored using IMemoryCache get deleted? – Josh Monreal Nov 19 '21 at 11:46
2

From Microsoft Azure How to configure websites

Always On - By default, websites are unloaded if they have been idle for some period of time. This lets the system conserve resources. You can enable the Always On setting for a site in Standard mode if the site needs to be loaded all the time. Because continuous web jobs may not run reliably if Always On is disabled, you should enable Always On when you have continuous web jobs running on the site.

If you have things that need to be running continuously you could look at either Azure Webjobs or Worker Roles which would be more reliable rather than IIS threads.

AlexC
  • 10,676
  • 4
  • 37
  • 55
  • You're not limited to Web jobs or worker roles for continuously-running tasks. You can also use web roles and virtual machines. – David Makogon Aug 28 '14 at 10:30
  • @AlexC, I have finished application, which using Quartz Scheduller. And question: can I be sure, that "Always on" to prevent recycling and periodic restart? – Artyom Pranovich Aug 28 '14 at 10:31
  • @DavidMakogon, As I can see you are Windows Azure Cloud Architect. May be you know: can I be sure, that turning on of "Always on" setting to prevent recycling and periodic restart by timeout? – Artyom Pranovich Aug 28 '14 at 10:33