Search code examples
c#asp.net-coreiisiis-10

ASP.NET Core ignores requestTimeout greater that 00:05:00


I have ASP.NET Core REST-service (IIS 10, app pool without managed code, .NET Core Runtime 2.0.5).

Web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <httpRuntime executionTimeout="100000" maxRequestLength="536870912" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="536870912" />
      </requestFiltering>
    </security>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore requestTimeout="00:45:00" forwardWindowsAuthToken="false" processPath="dotnet" arguments=".\app.dll" startupTimeLimit="3600" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
      <environmentVariables />
    </aspNetCore>
  </system.webServer>
</configuration>
<!--ProjectGuid: 1a91d629-da53-4fc1-a236-5d116a3d9658-->

I expect that requests longer than 45 minutis should be ended with 502 error.

But requests completed with 502 after ~5 minutes (~300-310 seconds).

I tried to change this settings to 00:03:00 (3 minutes). After that request completed with 502 status code after ~3 minutes.

It looks like any value larger than 00:05:00 is ignored.

The question is where I forgot to look this setting?


Solution

  • Okay, it was my fault.

    First of all I forgot to test the request from the computer with the service (in the intranet). When I did it I find out that in this case service work fine without ~5 minute timeout. While I run same request from the internet I still had that problem

    So next suspect was the proxy between internet and intranet. So I changed the timeout on the proxy and now I have fine-running ASP.NET Core Web Service.