Tuesday, June 13, 2017

How can a slow internet on client side be a reason for server time out exception in asp.net?

Leave a Comment

I have a .Net application up and running.

We have had a fluctuating connection yesterday. While testing in such scenarios we had received multiple server time out exception emails like below.

Server Time Out

Type : System.Web.HttpException, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  Message : Request timed out. Source : Help link : WebEventCode : 3001 ErrorCode : -2147467259 Data : System.Collections.ListDictionaryInternal TargetSite : HResult : -2147467259 Stack Trace : The stack trace is unavailable. Additional Info: 

IMPORTANT: Above exception occurred while doing a ajax post by a button placed with in update panel.

My question here is why would a slow internet on client side raise such server time out exception?

Isn't server timeout exception is related to such cases where server cannot execute the request in underlying time mention in HttpRuntime setting? May be due to some lengthy operation or some long database execution which takes longer than the time mentioned in setting under HttpRuntime.

If server is not able to connect to the client due to clients fluctuating internet, then Client Disconnected exception would be raised which we did yesterday. But I am not able to conclude the reason for this server timeout exception.

I already know that increasing the execution timeout will fix the issue, but I have to provide technical explanation for the reason as to why such exception of Server Timeout raised.

My best guess here is that the ajax request would be doing some continuous communication with server for executing of single request server and would raise timeout exception if it does not receives some required further communication messages due to client's bad internet. I have search over internet for the same to support my guess but in vain.

Also to provide environmental details, there is a load balancer serving the request.

Any help would be highly appreciated.

1 Answers

Answers 1

It is because (as you write) the connection of client to server is slow, so if the server (or client) sending data to this server, connection can´t handle it, so you get timeout error, because the data can´t been transfered in defined time.

You also write, that this is caused by sending Ajax request, so maybe try to increase execusion timeout in web configuration file (web.config):

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

enter image description here

More about executionTimeout here and here about Ajax requests.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment