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.
To keep you in your flow, we have built in heuristics to detect tabs doing important activity in the background and prevent these tabs from sleeping. You can also add sites you never want to sleep to a block list in Settings by going to edge://settings/system. What activities prevent a site from going to sleep?
What is sleeping tabs? To improve memory and CPU utilization of the browser, we've developed a feature called sleeping tabs. To free up resources for active tabs, new tabs, and other applications on your device, sleeping tabs in Microsoft Edge makes background tabs “go to sleep” after 2 hours of inactivity.
If they do not sleep it would be useful to have an option to set pinned tabs to sleep-able tabs. @Eleanor_Huynh Jan 27 2021 03:55 AM
The advantage of sleeping a tab is that going back to it again is very fast and imperceptible. A tab can also be discarded. When a tab is discarded, the content of the page is completely thrown away, allowing all of the resources (CPU, memory) to be released.
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):
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With