Reputation: 1320
We have some specific web pages and Web Api services which call long-running back end processes; and we'd like to carefully control when they should timeout.
I have created a simple MVC 4 site (in VS2012) with a page that sleeps for 200 seconds before returning. Then I set these timeouts:
httpRuntime executionTimeout="120"
Server.ScriptTimeout = 120
I am not able to get this page to timeout. It successfully returns after 200 seconds without timing out at 120 seconds. I even tried using curl (disabling tcp keepalive) to take the browser out of the picture: curl --no-keepalive mysiteurl
Upvotes: 1
Views: 1462
Reputation: 9378
If debug mode is enabled, then these timeouts do not apply:
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 (source)
Upvotes: 0
Reputation: 2793
First starting with what you already tried:
executionTimeOut=120 means when some operation is running on server and its takes more than 120 seconds to complete then that operation would time out, similar is the case for Server.ScriptTimeout. Connection Time Out specifies the time in which if a connection is not established the connection error would be returned.
That means the above error (execution time out) wouldn't happen unless a synchronous process takes over 2 minutes, or a ServerSide script runs for over 2 minutes, or the connection is not established.
What you can use. I believe you should only be concerned with the session time out if you want the pages to time out in specified time. The other timeouts that you mentioned would work as expected, you can rely on them (refer this link if you want to test if the things are working or not).
If you are performing some db operations then you should consider altering you connection time out for db connection.
Upvotes: 2