Programing

IIS에서 요청 시간 초과를 늘리는 방법은 무엇입니까?

lottogame 2020. 6. 21. 19:39
반응형

IIS에서 요청 시간 초과를 늘리는 방법은 무엇입니까?


IIS 7.0에서 요청 시간 초과를 늘리는 방법은 무엇입니까? IIS 6.0의 ASP 구성 설정에있는 응용 프로그램 탭에서 동일하게 수행됩니다. IIS 7.0에서 asp.net 구성 섹션을 찾을 수 없습니다


이것을 Web Config에 추가하십시오

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

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

선택적 TimeSpan 특성

ASP.NET에 의해 자동으로 종료되기 전에 요청을 실행할 수있는 최대 시간 (초)을 지정합니다.

이 제한 시간은 컴파일 요소의 디버그 속성이 False 인 경우에만 적용됩니다. 디버깅하는 동안 응용 프로그램이 종료되지 않도록하려면이 시간 제한을 큰 값으로 설정하지 마십시오.

기본값은 "00:01:50"(110 초)입니다.


IIS 관리자에서 사이트를 마우스 오른쪽 단추로 클릭하고 사이트 관리 -> 고급 설정으로 이동하십시오 . 연결 제한 옵션 아래에 연결 시간 초과 가 표시 됩니다 .


요청 시간 초과를 늘리려면 이것을 web.config에 추가하십시오.

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

특정 페이지에 이것을 추가하십시오

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

.NET 1.x의 기본값은 90 초입니다.

.NET 2.0 이상의 경우 기본 110 초입니다.


IIS> = 7에서, <webLimits>섹션 대체하고 ConnectionTimeout, HeaderWaitTimeout, MaxGlobalBandwidth, 및 MinFileBytesPerSec6 메타베이스 설정 IIS.

구성 예 :

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

참고로 IIS의 이러한 설정에 대한 자세한 내용은 여기를 참조 하십시오 . 또한 IIS 관리자의 "구성 편집기"를 통해이 섹션을 web.config에 추가 할 수 없었습니다.이 섹션을 추가하고 구성을 검색하면이 섹션이 표시되었습니다.


나는 질문이 ASP에 관한 것이라는 것을 알고 있지만 어쩌면 누군가이 대답이 도움이 될 것입니다.

IIS 7.5 뒤에 서버가있는 경우 (예 : Tomcat) 제 경우에는 Tomcat 서버가 구성된 서버 팜이 있습니다. 이 경우 IIS 관리자를 사용하여 시간 초과를 변경할 수 있습니다.

  • 이동 서버 팜 > - {서버 이름} -> 프록시
  • 시간 제한 항목 상자 에서 값을 변경하십시오.
  • 적용 (오른쪽 상단)을 클릭 하십시오.

또는 cofig 파일에서 변경할 수 있습니다.

  • % WINDIR % \ system32를 먼저 System32 \ inetsrv \ config \ applicationhost.config
  • 서버 webFarm 구성을 다음과 유사하게 조정하십시오.

예:

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

$ {TIME은}HH : MM : SS의 형식 (당신이 90 초로 설정하려면 그럼 넣어이 0시 1분 30초)

Tomcat (및 아마도 다른 서블릿 컨테이너)의 경우 % TOMCAT_DIR % \ conf \ server.xml 에서 시간 초과를 변경해야합니다 ( 커넥터 태그 에서 connectionTimeout 속성 만 검색 하고 밀리 초 단위 로 지정됨 ).


다음은 문제를 해결하기위한 단계입니다.

  1. IIS를여십시오
  2. " 사이트 "옵션으로 이동하십시오 .
  3. 마우스 오른쪽 버튼을 클릭하십시오.
  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"

enter image description here


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

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

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.

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.exe set config "Default Web Site" -section:system.web/httpRuntime /executionTimeout:"00:01:40" 

참고URL : https://stackoverflow.com/questions/2414441/how-to-increase-request-timeout-in-iis

반응형