Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of "Always On" setting on Azure Web Site

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.

like image 256
Artyom Pranovich Avatar asked Aug 28 '14 09:08

Artyom Pranovich


1 Answers

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.

like image 66
Zain Rizvi Avatar answered Sep 30 '22 22:09

Zain Rizvi