Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 860
Dinesh Prajapati Avatar asked May 26 '17 11:05

Dinesh Prajapati


People also ask

Why does my Internet connection keep timing out?

If you're too far from your router, your internet may cut in and out as Wi-Fi signals struggle to reach your device. Obstructions between your device and router may also cause intermittent disconnections. Pay attention to your device's Wi-Fi signal meter to see where your Wi-Fi signal gets weak and disconnects.

What is connection timeout error?

ERR_CONNECTION_TIMED_OUT, also called the timeout error, means a website took too long to respond to the browser's request. Generally, a site can establish communication with a computer within 30 seconds. If it takes longer than that, the browsing application will terminate the connection.


1 Answers

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.

like image 162
Samuel Tulach Avatar answered Oct 06 '22 09:10

Samuel Tulach