2

We have a web page that calls a stored procedure. The stored procedure takes ~ 5 minutes to run. When called from ASP.NET, it times out at ~ 2 minutes and 40 seconds with an HTTP execution timeout error.

I tried setting an HTTP timeout property in my web.config file as:

<httpRuntime executionTimeout="600">

But it didn't help.

Any ideas appreciated. thanks

4
  • 1
    Maybe you already did this but...can't you speed up the stored proc? It feels like fixing the end that is not broken... Commented Feb 25, 2013 at 20:30
  • Could you post the full exception details please. I know you've said it's an HTTP execution timeout but to my knowledge, setting executionTimeout should have fixed the problem. I'm wondering if the timeout value on your database connection is causing the problem instead. Commented Feb 25, 2013 at 21:02
  • The proc has to take that long.. it's just what it's doing. Here is the error: Server Error in '/' Application. Request timed out. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Request timed out. Commented Feb 25, 2013 at 21:25
  • Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Request timed out.] Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 Commented Feb 25, 2013 at 21:27

1 Answer 1

2

You should not create a web application with a page that could require such a long response time from the server. As a general rule, anything that you know will take longer than 10 seconds or so should be done as an asynchronous process. You've probably seen websites that display a "please wait" screen for long running processes, most times these pages work by delegating the long-running job to a background process or message queue, then polling until the job either completes successfully or errors out.

I know this may seem like a tall order if you've not done it before, but it really is the professional way to handle the scenario you're faced with. In some cases, your clients may be working from networks with proxy servers set up to abort the HTTP request regardless of what you've set your timeouts to.

This is a dated link, and I believe the .NET framework has introduced other ways of doing this, but I actually still use the following approach today in certain scenarios.

http://www.devx.com/asp/Article/29617

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.