Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase executionTimeout for a long-running query?

Tags:

c#

asp.net

In my application, one query takes 3 minutes to execute. I found that Default ExecutionTimeout value is 110 sec.I tried to change this to 500 (seconds) but it didn't fix my problem. Somewhere I found that setting <compilation debug="false"> allows the ExecutionTimeout property to be configured. However, even this didn't solve my problem.

Does anyone know how I can increase the execution timeout for a long-running query?

like image 354
Rakesh Devarasetti Avatar asked May 18 '12 09:05

Rakesh Devarasetti


People also ask

How to increase execution timeout in web config file?

In IIS manager, choose your application pool and right click on it and choose advanced settings then change the idle timeout setting to any minutes you want. So, I think setting the web. config and setting the application pool are both needed.

What is the default httpRuntime executionTimeout?

The executionTimeout attribute of <httpRuntime> defines the maximum amount of time in seconds that a request is allowed to run before it is automatically terminated by ASP.NET. The default value is 90 seconds.


2 Answers

Execution Timeout is 90 seconds for .NET Framework 1.0 and 1.1, 110 seconds otherwise.

If you need to change defult settings you need to do it in your web.config under <httpRuntime>

<httpRuntime executionTimeout = "number(in seconds)"/> 

But Remember:

This time-out applies only if the debug attribute in the compilation element is False.

Have look at in detail about compilation Element

Have look at this document about httpRuntime Element

like image 164
huMpty duMpty Avatar answered Sep 22 '22 10:09

huMpty duMpty


You can set executionTimeout in web.config to support the longer execution time.

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

<httpRuntime  executionTimeout = "300" /> 

This make execution timeout to five minutes.

Optional Int32 attribute.

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

This time-out applies only if the debug attribute in the compilation element is False. Therefore, if the debug attribute is True, you do not have to set this attribute to a large value in order to avoid application shutdown while you are debugging. The default is 110 seconds, Reference.

like image 20
Adil Avatar answered Sep 20 '22 10:09

Adil