29

What is the IIS7 default time for HTTP keepAlive?

SDReyes
  • 643
  • 2
  • 8
  • 15

3 Answers3

34

The default connection timeout in IIS7 is 2 minutes. Click on your web site in IIS Mgr, click Advanced Settings, and expand Connection Limits. The Connection Timeout (Seconds) setting is what governs this. If IIS doesn't receive activity on a connection for this duration then it will time the connection out. This is regardless of whether or not the connection was requested as a keep-alive. You will, of course, have to have keep-alives enabled for this to be a "keep-alive timeout". Keep-alive is enabled by default in IIS.

You can also set it for the site in the applicationHost.config file using the <limits> and the connectionTimeout attribute.

<limits connectionTimeout="00:02:00" />

This will set the timeout value to 2 minutes.

squillman
  • 37,618
  • 10
  • 90
  • 145
8

HTTP KeepAlive is a true/false switch. If HTTP Keepalive is true, it will use the "Connection Timeout" setting (default 120 seconds)

iainlbc
  • 2,694
  • 18
  • 19
3

Also you can use this option in your web.config

<system.web>
    <httpRuntime executionTimeout="180" />
</system.web>

https://msdn.microsoft.com/en-us/library/e1f13641%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

  • +1. By the way, the link you have there is for .Net Framework 3 which doesn't actually support an int for that attribute. I think you meant this link: https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100) – Zoomzoom Mar 15 '19 at 15:00