diff --git a/aspnetcore/host-and-deploy/iis/advanced.md b/aspnetcore/host-and-deploy/iis/advanced.md index d3bf775eae..235c6a0112 100644 --- a/aspnetcore/host-and-deploy/iis/advanced.md +++ b/aspnetcore/host-and-deploy/iis/advanced.md @@ -48,6 +48,29 @@ The `disallowRotationOnConfigChange` setting is intended for blue/green scenario This setting corresponds to the API +## Reduce 503 likelihood during app recycle + +By default there is a one second delay between when IIS is notified of a recycle or shutdown and when ANCM tells the managed server to initiate shutdown. The delay is configurable via the `ANCM_shutdownDelay` environment variable or by setting the `shutdownDelay` handler setting. Both values are in milliseconds. The delay is primarily to reduce the likelihood of a race where: + +* IIS hasn't started queuing requests to go to the new app. +* ANCM starts rejecting new requests that come into the old app. + +This setting doesn't mean incoming requests will be delayed by this amount. The setting indicates that the old app instance will start shutting down after the timeout occurs. Slower machines or machines with heavier CPU usage might need to adjust this value to reduce 503 likelihood. + +The following example sets the delay to 5 seconds: + +```xml + + + + + +``` + ## Proxy configuration uses HTTP protocol and a pairing token *Only applies to out-of-process hosting.*