IIS request won’t complete if “File Download” is open

asp.netiisiis-7

We have an ASP.NET application that returns image files to the user. When a user requests an image, the application sets the appropriate content information in the header, and returns the bytes. We have found that if the browser prompts the user to open or save the image, the IIS request will remain in "Send Response" state until the user chooses one of the prompt options.

The issue is that some users are not closing the prompt, which prevents the request from completing. Once this happens, other requests are also prevented from completing. Eventually, all the available threads are used up.

Is there any way to force IIS to forcefully kill a request after a timeout period? We've tried setting the "executionTimeout", but this doesn't have any effect, as the request thread isn't doing any work while it's waiting for the client to answer the prompt.

The connection timeout is set to the default of 120 seconds.

Best Answer

What is your Connection Timeout (HTTP KeepAlive timeout)?

Web Site > Connection Limits > Connection Timeout. The default is 120 seconds. (Not to be confused with the application pool timeout). Sometimes applications that use session affinity (sticky sessions) have a higher value for the timeout. Setting this too high would increase connections.

You should also ensure you have the latest http.sys hotfix installed, version 6.1.7601.21886.