0

In IIS 8.5 is there a way of setting the ConnectionTimeout limit in web.config?

I can see how you would set this at the Website level (either through the IIS Manager GUI or via settings https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/sitedefaults/limits) but would like to set it at the application level i.e. via web.config if possible.

I am aware of the web.config executionTimeout setting (i.e. httpRuntime executionTimeout="100"): and so was hoping there might be something similar for connectionTimeout.

Paul H
  • 303
  • 1
  • 6
  • 13
  • Microsoft decided that many settings are `applicationHost.config` only, so you won't be able to set such in `web.config`. – Lex Li Nov 19 '20 at 18:45

2 Answers2

0

You can set per site limits from applicationHost.config, which would look like this:

<sites>
   <site name="Default Web Site" id="1" serverAutoStart="true">
      <application path="/">
         <virtualDirectory path="/"
            physicalPath="%SystemDrive%\inetpub\wwwroot" />
      </application>
      <bindings>
         <binding protocol="http"
            bindingInformation="*:80:" />
      </bindings>
     <limits maxBandwidth="65536"
         maxConnections="1024"
         connectionTimeout="00:01:00" />
   </site>
</sites>

(example taken from Microsoft docs)

If you execute the below appcmd during deployment you would get the same effect, but you cant use web.config to manage this value.

appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].limits.connectionTimeout:00:01:00" /commit:apphost

I would strongly suggest using appcmd.exe to update these values rather than editing the XML directly (the 32 or 64 "bit-ness" of your editor makes a difference!).

MisterSmith
  • 2,884
  • 1
  • 10
  • 13
0

These settings are managed by the applicationhost.config file. so you have to manually change it. and it is not a recommended way to modify the applicationhost file manually. it may break your other configuration.

you could use iis manager GUI or you can use the below commands:

appcmd.exe set config  -section:system.applicationHost/sites /[name='sitename'].limits.connectionTimeout:"00:03:00"  /commit:apphost

or

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/site[@name='testiis']/limits" -name "connectionTimeout" -value "00:03:00"
Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26