如何在IIS中增加请求超时?

时间:2022-10-14 21:25:10

How to increase request timeout in IIS 7.0? The same is done under application tab in ASP configuration settngs in IIS 6.0. I am not able to find the asp.net configuration section in IIS 7.0

如何在IIS 7.0中增加请求超时?在IIS 6.0中的ASP配置设置设置设置中,在application选项卡下进行相同的操作。我无法在IIS 7.0中找到asp.net配置部分

7 个解决方案

#1


136  

Add this to your Web Config

将其添加到Web配置中

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

https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/e1f13641(v = vs.85). aspx

Optional TimeSpan attribute.

可选的时间间隔属性。

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

指定请求在ASP.NET自动关闭之前允许执行的最大秒数。

This time-out applies only if the debug attribute in the compilation element is False. To help to prevent shutting down the application while you are debugging, do not set this time-out to a large value.

此超时仅适用于编译元素中的debug属性为False的情况。为了防止在调试时关闭应用程序,请不要将这个超时设置为一个大值。

The default is "00:01:50" (110 seconds).

默认是“00:01:50”(110秒)。

#2


61  

In IIS Manager, right click on the site and go to Manage Web Site -> Advanced Settings. In there, under Connection Limits you should see Connection Time-out.

在IIS管理器中,右键单击站点并进入管理Web站点——>高级设置。在这里,在连接限制下,您应该看到连接超时。

#3


25  

To Increase request time out add this to web.config

要增加请求超时,请将其添加到web.config中

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

and for a specific page add this

对于特定的页面添加这个

<location path="somefile.aspx">
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</location>

The default is 90 seconds for .NET 1.x.

. net 1.x的默认设置是90秒。

The default 110 seconds for .NET 2.0 and later.

. net 2.0及以后的默认110秒。

#4


23  

In IIS >= 7, a <webLimits> section has replaced ConnectionTimeout, HeaderWaitTimeout, MaxGlobalBandwidth, and MinFileBytesPerSec IIS 6 metabase settings.

在IIS >= 7中,< weblimit >部分已经取代了ConnectionTimeout、HeaderWaitTimeout、MaxGlobalBandwidth和MinFileBytesPerSec IIS 6的metabase设置。

Example Configuration:

示例配置:

<configuration>
   <system.applicationHost>
      <webLimits connectionTimeout="00:01:00"
         dynamicIdleThreshold="150"
         headerWaitTimeout="00:00:30"
         minBytesPerSecond="500"
      />
   </system.applicationHost>
</configuration>

For reference: more information regarding these settings in IIS can be found here. Also, I was unable to add this section to the web.config via the IIS manager's "configuration editor", though it did show up once I added it and searched the configuration.

参考:关于IIS中的这些设置的更多信息可以在这里找到。此外,我无法将该部分添加到web中。通过IIS管理器的“配置编辑器”进行配置,尽管在我添加配置并搜索配置之后,它确实出现了。

#5


9  

I know the question was about ASP but maybe somebody will find this answer helpful.

我知道这个问题是关于ASP的,但是也许有人会发现这个答案很有帮助。

If you have a server behind the IIS 7.5 (e.g. Tomcat). In my case I have a server farm with Tomcat server configured. In such case you can change the timeout using the IIS Manager:

如果IIS 7.5后面有一个服务器(例如Tomcat)。在我的例子中,我有一个配置了Tomcat服务器的服务器群。在这种情况下,您可以使用IIS管理器更改超时:

  • go to Server Farms -> {Server Name} -> Proxy
  • 进入服务器农场->{服务器名}->代理
  • change the value in the Time-out entry box
  • 更改超时输入框中的值
  • click Apply (top-right corner)
  • 单击Apply(右上角)

or you can change it in the cofig file:

或者可以在cofig文件中修改:

  • open %WinDir%\System32\Inetsrv\Config\applicationHost.config
  • 打开%列出% \ System32系统\ Inetsrv \ Config \ applicationHost.config
  • adjust the server webFarm configuration to be similar to the following
  • 将服务器webFarm配置调整为类似于以下配置

Example:

例子:

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

The ${TIME} is in HH:mm:ss format (so if you want to set it to 90 seconds then put there 00:01:30)

${TIME}是在HH:mm:ss格式(如果您想将其设置为90秒,然后将其设置为00:01:30)

In case of Tomcat (and probably other servlet containers) you have to remember to change the timeout in the %TOMCAT_DIR%\conf\server.xml (just search for connectionTimeout attribute in Connector tag, and remember that it is specified in milliseconds)

对于Tomcat(可能还有其他servlet容器),您必须记住更改%TOMCAT_DIR%\conf\服务器中的超时。xml(只需在连接器标记中搜索connectionTimeout属性,并记住它是以毫秒为单位指定的)

#6


3  

Use the below Power shell command to change the execution timeout (Request Timeout)

使用下面的Power shell命令更改执行超时(请求超时)

Please note that I have given this for default web site, before using these please change the site and then try to use this.

请注意,我已经给这个默认的网站,在使用这些之前请更改网站,然后尝试使用这个。

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

Or, You can use the below C# code to do the same thing

或者,您可以使用下面的c#代码做同样的事情

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample {

    private static void Main() {

        using(ServerManager serverManager = new ServerManager()) { 
            Configuration config = serverManager.GetWebConfiguration("Default Web Site");

            ConfigurationSection httpRuntimeSection = config.GetSection("system.web/httpRuntime");
            httpRuntimeSection["executionTimeout"] = TimeSpan.Parse("00:01:40");

            serverManager.CommitChanges();
        }
    }
}

Or, you can use the JavaScript to do this.

或者,您可以使用JavaScript来完成这个任务。

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site";

var httpRuntimeSection = adminManager.GetAdminSection("system.web/httpRuntime", "MACHINE/WEBROOT/APPHOST/Default Web Site");
httpRuntimeSection.Properties.Item("executionTimeout").Value = "00:01:40";

adminManager.CommitChanges();

Or, you can use the AppCmd commands.

或者,您可以使用AppCmd命令。

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

#7


0  

Below are provided steps to fix your issue.

下面是解决问题的步骤。

  1. Open your IIS
  2. 打开你的IIS
  3. Go to "Sites" option.
  4. “网站”选项。
  5. Mouse right click.
  6. 鼠标右键单击。
  7. Then open property "Manage Web Site".
  8. 然后打开属性“管理网站”。
  9. Then click on "Advance Settings".
  10. 然后点击“预先设置”。
  11. Expand section "Connection Limits", here you can set your "connection time out"
  12. 展开“连接限制”一节,在这里您可以设置“连接超时”

如何在IIS中增加请求超时?

#1


136  

Add this to your Web Config

将其添加到Web配置中

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

https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/e1f13641(v = vs.85). aspx

Optional TimeSpan attribute.

可选的时间间隔属性。

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

指定请求在ASP.NET自动关闭之前允许执行的最大秒数。

This time-out applies only if the debug attribute in the compilation element is False. To help to prevent shutting down the application while you are debugging, do not set this time-out to a large value.

此超时仅适用于编译元素中的debug属性为False的情况。为了防止在调试时关闭应用程序,请不要将这个超时设置为一个大值。

The default is "00:01:50" (110 seconds).

默认是“00:01:50”(110秒)。

#2


61  

In IIS Manager, right click on the site and go to Manage Web Site -> Advanced Settings. In there, under Connection Limits you should see Connection Time-out.

在IIS管理器中,右键单击站点并进入管理Web站点——>高级设置。在这里,在连接限制下,您应该看到连接超时。

#3


25  

To Increase request time out add this to web.config

要增加请求超时,请将其添加到web.config中

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

and for a specific page add this

对于特定的页面添加这个

<location path="somefile.aspx">
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</location>

The default is 90 seconds for .NET 1.x.

. net 1.x的默认设置是90秒。

The default 110 seconds for .NET 2.0 and later.

. net 2.0及以后的默认110秒。

#4


23  

In IIS >= 7, a <webLimits> section has replaced ConnectionTimeout, HeaderWaitTimeout, MaxGlobalBandwidth, and MinFileBytesPerSec IIS 6 metabase settings.

在IIS >= 7中,< weblimit >部分已经取代了ConnectionTimeout、HeaderWaitTimeout、MaxGlobalBandwidth和MinFileBytesPerSec IIS 6的metabase设置。

Example Configuration:

示例配置:

<configuration>
   <system.applicationHost>
      <webLimits connectionTimeout="00:01:00"
         dynamicIdleThreshold="150"
         headerWaitTimeout="00:00:30"
         minBytesPerSecond="500"
      />
   </system.applicationHost>
</configuration>

For reference: more information regarding these settings in IIS can be found here. Also, I was unable to add this section to the web.config via the IIS manager's "configuration editor", though it did show up once I added it and searched the configuration.

参考:关于IIS中的这些设置的更多信息可以在这里找到。此外,我无法将该部分添加到web中。通过IIS管理器的“配置编辑器”进行配置,尽管在我添加配置并搜索配置之后,它确实出现了。

#5


9  

I know the question was about ASP but maybe somebody will find this answer helpful.

我知道这个问题是关于ASP的,但是也许有人会发现这个答案很有帮助。

If you have a server behind the IIS 7.5 (e.g. Tomcat). In my case I have a server farm with Tomcat server configured. In such case you can change the timeout using the IIS Manager:

如果IIS 7.5后面有一个服务器(例如Tomcat)。在我的例子中,我有一个配置了Tomcat服务器的服务器群。在这种情况下,您可以使用IIS管理器更改超时:

  • go to Server Farms -> {Server Name} -> Proxy
  • 进入服务器农场->{服务器名}->代理
  • change the value in the Time-out entry box
  • 更改超时输入框中的值
  • click Apply (top-right corner)
  • 单击Apply(右上角)

or you can change it in the cofig file:

或者可以在cofig文件中修改:

  • open %WinDir%\System32\Inetsrv\Config\applicationHost.config
  • 打开%列出% \ System32系统\ Inetsrv \ Config \ applicationHost.config
  • adjust the server webFarm configuration to be similar to the following
  • 将服务器webFarm配置调整为类似于以下配置

Example:

例子:

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

The ${TIME} is in HH:mm:ss format (so if you want to set it to 90 seconds then put there 00:01:30)

${TIME}是在HH:mm:ss格式(如果您想将其设置为90秒,然后将其设置为00:01:30)

In case of Tomcat (and probably other servlet containers) you have to remember to change the timeout in the %TOMCAT_DIR%\conf\server.xml (just search for connectionTimeout attribute in Connector tag, and remember that it is specified in milliseconds)

对于Tomcat(可能还有其他servlet容器),您必须记住更改%TOMCAT_DIR%\conf\服务器中的超时。xml(只需在连接器标记中搜索connectionTimeout属性,并记住它是以毫秒为单位指定的)

#6


3  

Use the below Power shell command to change the execution timeout (Request Timeout)

使用下面的Power shell命令更改执行超时(请求超时)

Please note that I have given this for default web site, before using these please change the site and then try to use this.

请注意,我已经给这个默认的网站,在使用这些之前请更改网站,然后尝试使用这个。

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

Or, You can use the below C# code to do the same thing

或者,您可以使用下面的c#代码做同样的事情

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample {

    private static void Main() {

        using(ServerManager serverManager = new ServerManager()) { 
            Configuration config = serverManager.GetWebConfiguration("Default Web Site");

            ConfigurationSection httpRuntimeSection = config.GetSection("system.web/httpRuntime");
            httpRuntimeSection["executionTimeout"] = TimeSpan.Parse("00:01:40");

            serverManager.CommitChanges();
        }
    }
}

Or, you can use the JavaScript to do this.

或者,您可以使用JavaScript来完成这个任务。

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site";

var httpRuntimeSection = adminManager.GetAdminSection("system.web/httpRuntime", "MACHINE/WEBROOT/APPHOST/Default Web Site");
httpRuntimeSection.Properties.Item("executionTimeout").Value = "00:01:40";

adminManager.CommitChanges();

Or, you can use the AppCmd commands.

或者,您可以使用AppCmd命令。

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

#7


0  

Below are provided steps to fix your issue.

下面是解决问题的步骤。

  1. Open your IIS
  2. 打开你的IIS
  3. Go to "Sites" option.
  4. “网站”选项。
  5. Mouse right click.
  6. 鼠标右键单击。
  7. Then open property "Manage Web Site".
  8. 然后打开属性“管理网站”。
  9. Then click on "Advance Settings".
  10. 然后点击“预先设置”。
  11. Expand section "Connection Limits", here you can set your "connection time out"
  12. 展开“连接限制”一节,在这里您可以设置“连接超时”

如何在IIS中增加请求超时?