Share via


How to increase an IIS webservice time-out period in Windows 10?

Question

Sunday, September 15, 2019 1:28 AM

In an IIS (version 10.0) webserivce under Windows 10, you know, the default time-out period is 110 seconds. I was trying to extend the time-out duration to 200 seconds (3 minutes 20 seconds).

I got a hyperlink https://stackoverflow.com/questions/2414441/how-to-increase-request-timeout-in-iis/51010915 for a solution to increase the IIS webservice time-out duration, on my Win10 Laptop, but all of the approached failed to make even a second extension!

In summary, I have applied the following approaches:

1) Set the "executionTimeout" value to be 200 seconds in the web.config file and a specific .aspx page file in a webservice application. For example,

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

2) adjust the server webFarm configuration in the Win10 configuration file %WinDir%\System32\Inetsrv\Config\applicationHost.config

For example,

<webFarm name="${SERVER_NAME}" enabled="true"> 
  <server address="${SERVER_ADDRESS}" enabled="true">
    <applicationRequestRouting httpPort="${SERVER_PORT}" />
  </server>
  <applicationRequestRouting>
    <protocol timeout="${TIME}" />
  </applicationRequestRouting>
</webFarm>

3) set the "connection time out" value in IIS "Advance Settings". The detailed operations are shown below:

  1. Open your IIS
  2. Go to "Sites" option.
  3. Mouse right click.
  4. Then open property "Manage Web Site".
  5. Then click on "Advance Settings".
  6. Expand section "Connection Limits", here you can set your "connection time out"

4) Run the following Power Shell command:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web Site'  -filter "system.web/httpRuntime" -name "executionTimeout" -value "00:03:20"

5) Execute the following AppCmd commands:

appcmd.exe set config "Default Web Site" -section:system.web/httpRuntime /executionTimeout:"00:03:20"

Now I am seeking for your help to provide a workable solution. 

Thanks!

All replies (7)

Sunday, September 15, 2019 4:39 PM

In an IIS (version 10.0) webserivce under Windows 10

There are tons of settings for a web service, so before asking others on how to, ask yourself what is that web service.

For example, settings under <system.web> only affect ASP.NET, so won't apply to PHP/Python or even ASP.NET Core based web services.

you know, the default time-out period is 110 seconds.

No. I don't know which "default time-out period" is 110 seconds. You have to be more specific.


Monday, September 16, 2019 2:56 AM

Hi,

As lex li said you need to provide more detail about your application and other configurations.

You could try below settings:

1)For IIS 7 and above:

1.Open Internet Information Services (IIS) Manager.
2. Expand the local computer node, expand Web Sites, right-click the appropriate Web site, point to Manage Web Site, click Advanced Settings.
3. In the Advanced Settings window, expand Connection Limits, change the value in the Connection time-out field, and then click OK.

2) Session state setting:

1.Open Internet Information Services (IIS) Manager.
2. Expand the local computer node, expand Web Sites, select the appropriate web site and double-click Session State in the right-hand panel.
3. Change the setting for Time-Out.

3)ASP Script Timeout Settings:

1.Open Internet Information Services (IIS) Manager .
2. Expand the local computer node, expand Web Sites, select the appropriate web site and double-click ASP in the right-hand panel.
3.In the ASP window, expand 'Limits Properties' and change the Script Timeout value.

4)Application Pool setting:

1.Open IIS.
2. On the left side, select"Application Pools"
3. On the right side, right-click this application pool and select Advanced Settings.
4. In the advanced settings, increase "Idle Time-out (minutes)".

5)CGI Time out:
1.in IIS , double-click CGI icon and increase "Time-out".

Regards,

Jalpa


Monday, September 16, 2019 3:30 AM

You could also try to increase httpRuntime value by the following setting:

1)Open IIs manager, select your web site.

2)In the Features pane, Double click the Configuration Editor.

3)from the dropdown, select system.web > httpRuntime

4) locate the executionTimeout parameter. The default value for this parameter is 110 seconds and is in the format hh:mm:ss. Adjust this setting as per your requirement.

5)Click on the apply from the action pane and restart the iis server.

You could refer this post:

https://forums.iis.net/t/1177681.aspx


Tuesday, September 17, 2019 1:38 AM

Hi, Lex & Jalpa,

I think that it is necessary to show the context of my post. 

I have developed a web service application (namely "XyzWebApp", based on C# ASP.Net), and then deployed it onto the IIS 10.0 server. 

Thereafter I developed a C# WinForm application (namely DigitalSignature.cs) to call a method (namely "ApplyDigitalSignature") of the webservice XyzWebApp. The relevant C# code snippet is shown below:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

private void btnDigitalSignature_Click(object sender, EventArgs e)
{
bool res;
string errmsg = string.Empty;
string pdf_file = tbInputPDF.Text.Trim();

XyzWebAppWS.XyzWebApp XyzWebService = new XyzWebAppWS.XyzWebApp();
res = XyzWebService.ApplyDigitalSignature(pdf_file, tbSerialNo.Text.Trim(), tbReason.Text.Trim(), ref errmsg);
return;
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Now I am testing to extend the time-out period of calling the method ApplyDigitalSignature() in the webservice XyzWebAppWS. The default time-out period of a webservice deployed on IIS 10.0 is 110 seconds, now I am trying to extend the time-out period to 300 seconds. 

Hi, Jalpa, 

Thank you for providing quite a few approaches to extend the IIS 10.0 webservice time-out period. I have tried all of them, unfortunately, none of them get successful and the webservice calling time-out period still stays at the default 110 seconds. 

Can you please keep on helping me to explore on this issue? 

Thank you very much.


Tuesday, September 17, 2019 2:44 AM

Hi,

Could you share your web.config file?

you could also try below settings to increase the time out:

syntax: <httpRuntime executionTimeout="numberof seconds"/>

<system.web>
<compilation debug="false"/>
<httpRuntime executionTimeout="1200"/>
</system.web>

or

client.InnerChannel.OperationTimeout = new TimeSpan(0, 5, 0);

in my opinion, you need to set the client and server both time out value.

which .net version you are using?

also, restart the iis after doing changes.


Tuesday, September 17, 2019 8:24 AM

Hi, Jalpa,

Good news: just now I managed to figure out the issue. 

Actually it is not related to the webservice and the IIS side, the time-out duration can be purely controlled by the calling application, just simply adding the following C# codes into the calling application, then it can take effect immediately:

XyzWebService.Timeout = 30000;

But anyway, still say thanks to Lex Li and you. 

I think that we can close this case at this point.

Wish you a good day!


Tuesday, September 17, 2019 8:26 AM

I am glad that you solved your issue by your self.

I request you to mark the helpful suggestion as an answer. This will help other people who face the same issue.

Thank you for understanding.

Regards,

Jalpa.