Finding ASP.Net Timeout Cause (During Long Operations)

I have an asp.net web application. He interacts with the business layer through WCF. There is a lengthy database operation (two hours). This is a regular synchronous call. I initially received exceptions related to WCF timeouts. For these exceptions, there used to be an exception on the user interface page ("Socket Timeout"). I solved this using WCF binding settings both in the service and in the client.

Now, after (exactly) one hour, I get an error in the browser window. Despite the fact that our application has a page with a user application error, it does not show the configured error. Since there are no exceptions in the user interface, I assume that this may be due to ASP.Net timeout, not WCF. I also do not see a relevant event log.

What are the ways / tools that I can use to determine the exact cause of the timeout?

Is this broswer setting / asp.net/iis setting a problem?

IE Error Message: The page you are looking for is currently unavailable. The website may be experiencing technical difficulties, or you may need to adjust your browser settings. Note: it says below: “Cannot find server or DNS error”

Note. This feature is used once a month. This is the functionality for the administrator. Thus, two hours is good for us.

Note. I have the following WCF configuration. Service (receiveTimeout = "05:30:00") and Client (receiveTimeout = "05:30:00" and sendTimeout = "05:30:00").

Note. It cannot go to our user error page and no exception is thrown.

Note. I am developing Visual Studio 2005.

Note. WCF itself is intended for testing.

Note. This is NetTCPBinding in WCF

Some configuration values ​​used in the application are listed below:

<httpRuntime maxRequestLength="20000" executionTimeout="900"/> 

  <forms loginUrl="Default.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="30" defaultUrl="Home.aspx"> </forms> </authentication> 

and-

 <roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All"> <providers> <clear/> <add name="MyRoleProvider" type="My.AccessControl.ServiceLayer.MyRoleProvider" /> </providers> </roleManager> 

Note. I plan to disable "Show friendly HTTP error messages" in IE. I also plan to make customErrors mode = "Off" in system.web to check it further.

+4
source share
5 answers

At first, the browser will wait so much time until the web server responds and starts issuing a response. IE 7/8, I believe that a deposit in 60 minutes. Dunno about IE 9. For details, see KB181050 . Firefox, Chrome, Safari, Opera are likely to differ in how long they are ready to wait before deciding what is not there on the server.

Honestly, I think it takes 60 minutes to wait a very long time before deciding that the server is not going to respond. 5 minutes should be more than enough. What would you suggest if you asked to create a web page and did not receive any response from the server for more than a minute or two: could you usually assume that the server is down and cancels the request?

In any case, when the browser refuses the request, it is going to close the socket, and you will get a page with an error in the browser. You will not see anything on the server: it is still fun to wave it off. I assume, however, that IIS notices when a socket falls. Hopefully at this point IIS will complete the request.

Second , IIS itself will wait so long before deciding that something has gone south with request processing. You should get an exception for this, I believe.

Why would you expect your users (and their web browser) to wait 2 hours for an HTTP request?

Install the administrator application, so requests like these will be queued and processed asynchronously by some daemon (or create a thread to perform asynchronous processing). Send some kind of ticket so that the requesting page periodically polls to find out if the long request is completed: at this point, discard everything that constitutes the actual response for the request.

In the client’s browser, create such a request through an AJAX post. Let client-side javascript use the returned ticket to poll every 30 seconds or so until the request is completed. Voila! No more browser timeouts.

+5
source

If you can host it on an IIS server, you can try using the FailedRequestTracing module.

http://learn.iis.net/page.aspx/266/troubleshooting-failed-requests-using-tracing-in-iis-7/

I used it to eliminate timeouts earlier.

+2
source

Can a session time out or close an application (website) in one hour?

0
source

You are better off using a duplex notification service between WCF and ASP.net and AJAX for notification between the client and the web server.

0
source

The whole HTTP wait concept for what you yourself described as a TWO HOUR operation is corrupted from git -go. As mentioned in other posters, you need to rethink your strategy. Refusing it in the queue process, and then providing users with some method for polling to complete, or even sending them an email notification with a link in it, is one way.

Go with the flow.

0
source

All Articles