ASP.NET - System.Web.HttpException (0x80004005): Request timed out

Posted on 2011-10-18
Last Modified: 2012-05-12
I've developed a ASP.NET application which consumes WCF service. I hosted in server successfully. From the server I browse one particular page. Its browsing correctly. The same page is working fine while browsing the page from another server. But System.Web.HttpException (0x80004005): Request timed out error is thrown while browsing from my local machine on a button click event.

What could be the problem? Any help is much appreciated.

Question by:Easwaran Paramasivam
    LVL 3

    Expert Comment


    not sure if I got your problem correctly.
    Is the exception only thrown, when you use your local computer as a client (while the server is some other machine)?
    Does the same operation work on other machines?

    Could this be due to firewall-settings (local or enterprise) or anything like that?


    LVL 16

    Author Comment

    by:Easwaran Paramasivam
    Not only from my machine the error is thrown but also from all dev machines.

    But other sites are working properly. Particular site makes the problem.
    LVL 3

    Expert Comment


    okay, so you can browse also pages and actions on some environment and you can't from any dev machine. Is that correct?
    Are they configured identically? Do you use different databases in dev and on the servers (I guess you do)? Is the timeout thrown when calling the WCF-Service within the context of the page execution?


    LVL 3

    Accepted Solution

    Please check the following links,

    From the error message you provided, it seems that the problem is caused by the timeout of your http execution.

    Based on my knowledge, this kind of issue is typically occurs when a server-side code function or macro executes for a period of time longer than the maximum timeout period allowed for server-side code execution.

    Then the first solution we can see is to increase the executionTimeout settings in your Web.Config.

    Second, since you are using HttpWebRequest. Typically, a request to Web uses one worker thread to execute the code that sends the request and one completion port thread to receive the callback from the Web. However, if the request is redirected or requires authentication, the call may use as many as two worker and two completion port threads. Therefore, you can exhaust the managed ThreadPool when multiple Web service calls occur at the same time. For example, suppose that the ThreadPool is limited to 10 worker threads, and all 10 worker threads are currently executing code that is waiting for a callback to execute. The callback can never execute because any work items that are queued to the ThreadPool are blocked until a thread becomes available.

    Third, other potential source of contention is the maxconnection parameter that the System.Net namespace uses to limit the number of connections. Generally, this limit works as expected. However, if many applications try to make many requests to a single IP address at the same time, threads may have to wait for an available connection.

    To resolve these problems, you can tune the following parameters in your Machine.config file to best fit your situation:

    • maxWorkerThreads
    • minWorkerThreads
    • maxIoThreads
    • minFreeThreads
    • minLocalRequestFreeThreads
    • maxconnection
    • executionTimeout

    For more information, you can refer the following link:  
    LVL 16

    Author Closing Comment

    by:Easwaran Paramasivam
    I've resolved myself. However thanks for your comments.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now