0

We have an ASP.Net MVC application. It has been published in the Production environment and debug is set to true (not sure why) in WEb.config.

compilation batch="true" debug="true" targetFramework="4.5"

But still the application timeouts.

I want to make debug="false" and add the below tag.

httpRuntime executionTimeout="43200" maxRequestLength="104856" targetFramework="4.5"

But if the application timeouts when debug="true" then I think it will timeout even when debug="false" irrespective of the executionTimeout.

Is there any way we can set the timeout via Global.asax.cs?

Edit 1: The application gets a timeout if the process runs for more that 2 minutes.

So that means the session is still alive.

<sessionState mode="InProc" cookieless="false" timeout="60" />

For the database I have added command timeout of 5 minutes (just for testing purpose) but still there is a timeout.

Edit 2: After browsing through the logs this was the error.

The remote host closed the connection. The error code is 0x800703E3

1 Answers1

0

User session might be ending, which might make everything else irrelevant:

Set this in IIS: sessionState timeout="120"

Or Web.config:

<configuration>
<system.web>
<sessionState mode="InProc" timeout="120"></sessionState>
</system.web>
</configuration>

Default is 20 minutes, so your 12 hour httpruntime executiontimeout would be irrelevant.

Make sure you have adequate connection timeout for initial database connection AND command timeout for your database if you have long running scripts. Check logs and load a page with no database dependency as a test.

Also, Microsoft documentation states:

“This time-out applies only if the debug attribute in the element is set to false.”

https://learn.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.executiontimeout?view=netframework-4.7.2

So, with debug currently set to true, the executiontimeout setting will not do anything until debug is changed to false.

  • Firstly apologies for adding the time. The application gets timeout if the process runs for more that 2 minutes. So session is still alive. For the database I have added command timeout of 5 minutes (just for testing purpose) but still there is a timeout. – Bharani Raghavender Mar 13 '19 at 07:59
  • Interesting. Is there a proxy, web server or load balancer before the application? Does it timeout from localhost? –  Mar 13 '19 at 08:13
  • Just another idea, disable firewall and AV for a few minutes. –  Mar 13 '19 at 08:17
  • After browsing through the logs this was the error: The remote host closed the connection. The error code is 0x800703E3. – Bharani Raghavender Mar 13 '19 at 08:52
  • What version of .NET framework do you have on the host? The same one you had on your Development machine? –  Mar 13 '19 at 09:46
  • .Net framework: 4.5. Version is the same in Development, UAT and Prod. But issue occurs only in PROD. Any setting we have to tweak in IIS ? – Bharani Raghavender Mar 13 '19 at 09:49
  • Application pool timeout perhaps. –  Mar 13 '19 at 10:06