How to prevent an Azure website from going to sleep?

核能气质少年 提交于 2019-11-27 02:05:09

问题


I deployed an ASP.NET 5, MVC 6 web application to Azure. It seems that if I don't hit the site for 10-15 minutes, it goes to sleep and it takes a good 10-15 seconds for it to wake up.

I am not sure whether its the website that's falling asleep, or the database that it's connecting to.

So 2 questions.

  1. How do I prevent the site from going to sleep so soon.
  2. Is there a way to have visibility into what's going on in Azure with the website and the database. Are they kicked out of memory?

回答1:


Azure Web Apps have an 'Always on' option (with basic/standard tiers) which keep your app (and associated web jobs) loaded.

Look under Settings, and you'll see 'Application settings':

Then look for the 'Always on' setting (which will be disabled for Free tier):




回答2:


I know this post is a little old, but the issue is still relevant.

I use a free service called Uptime Robot - https://uptimerobot.com/

Even on the free tier, you can create up to 50 monitors to call your web site, at least every 5 minutes, which is certainly regularly enough to keep your site alive.

As well as keeping the site alive (without any knock-on consequences of using 'Always On') it also serves as a monitor for your site, letting you know if it's down.

You can create monitors that alert you if specific words are in or not in the response, so it's quite easy to check the content is correct. You could even create a 'test' page that just returns 'OK' after checking various functionality on your site.



来源:https://stackoverflow.com/questions/33789895/how-to-prevent-an-azure-website-from-going-to-sleep

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!