简体   繁体   中英

How Do I Prevent An Azure Cloud Service (Classic) From Going To Sleep (In 2018)?

We have a site that keeps falling to sleep, which causes an error due to the time-sensitivity of our sporadic requests.

I've seen how there is an "Always On" setting in the old Azure console, but it doesn't appear to apply to the new interface:

How to prevent an Azure website from going to sleep?

Where is this setting now, or how do I do the equivalent?

Here's what I see: Azure云服务显示

There's a couple of options. One of those is to use Traffic Manager Endpoint Monitoring which keeps calling your app so it doesn't recycle. Or is automatically started again when it does.

According to the blog post Windows Azure WebSites and Cloud Services Slow on First Request you can "include a script with your package, which is configured to run as a startup script, every time the role is restarted."

REM *** Prevent the IIS app pools from shutting down due to being idle.
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00

REM *** Prevent IIS app pool recycles from recycling on the default schedule of 1740 minutes (29 hours).
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.recycling.periodicRestart.time:00:00:00

How to proceed with the configuration can be found under "Avoid automatic recycle of Azure Cloud Services Web Role" of that post.

  • Check the Cloud Service availability on Azure portal.
  • Ensure that all role instances are in a Ready state. If they are not, refer to the troubleshooting blade.
  • RDP into the role instance and check the IIS process (w3wp.exe) in Task Manager is running.
  • If the w3wp.exe process does not show in Task Manager, go to IIS Manager and restart the application.
  • Check the http response code you get in the browser. 50x errors are application-related issues, refer to the troubleshooting blade.
  • Check that the default ports 80 (for http) and 443 (for https) are accessible. Use TELNET or TCPING to ensure that the w3wp.exe process is listening on it.
  • If your web application is accessible locally but not externally, it could be a network-related issue.

You may want to refer this as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM