Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Websites and ASP.NET, how much inactivity before the app pool is recycled causing a recompilation?

I have a MVC3, .NET4.5 asp.net web application hosted on Azure Websites.

I am experimenting with "Free", "Shared" and "Standard" scaling configurations.

I have noticed that after a period of inactivity the compiled code get dropped from memory, or the app pool gets recycled forcing a JIT recompile.

My main question is what is time period before the compiled code gets dropped forcing a recompile? I assume this is as a result of the application pool recycling? I have come across this on standard shared hosts such as DiscountASP.

My second question is: What is the best approach to minimise this issue as I would not like my users bumping into this recompilation lag? My initial thoughts are precompilation.

Many thanks in advance.

EDIT:

I have a found a related SO post on this here: App pool timeout for azure web sites

However it seems, as like standard Shared hosting, one cannot change App Pool recycling. One has more flexibility with the "Standard" scale option, since it is dedicated. So the likely options at present are:

1) Precompilation

2) Use of "Keep alive" ping sites.

EDIT2:

1) "Keep Alive" approach seems to be working. I have a 10 minute monitor running.

like image 433
SamJolly Avatar asked Nov 02 '22 08:11

SamJolly


1 Answers

I believe the inactivity period is 20 minutes by default. I haven't used web sites yet so I'm not famailiar with rescrtictions on changing settings but one quick way to keep your site activie is to use a uptime monitoring service like Pingdom (you can check one site for free at time of writing), this will ping your site regularly and prevent it from becoming idle.

like image 154
sham Avatar answered Nov 11 '22 18:11

sham