I have an Azure Worker role that downloads images and rescales them. If the worker role is really busy my solution recycles quite often. I think it is IIS restarting the role because of the high CPU or high error exception rate (the download can receive a 404 exception which is handled by the way).
- How can I find out what the cause of recycling is? I added a the following code but does not give me a lot of information:
public void Application_End(object sender, EventArgs e)
{
// Find out why the application ends
var reason = HostingEnvironment.ShutdownReason;
LogException("Application.End", "Hosted Service: " + CwPlatform.HostedServiceName
+ ", ShutdownReason:" + Enum.GetName(typeof(ApplicationShutdownReason), reason),
ExceptionLevel.Critical);
}
- Is there a way of preventing IIS to recycle because of this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…