Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be the ideal connection timeout in asp.net application?

What should be the ideal connection timeout in asp.net application? Does it prove to be a bottleneck in the performance of a application. Thanks in advance.

like image 595
HotTester Avatar asked Nov 14 '22 12:11

HotTester


1 Answers

The connection timeout I like is at around 30s. Also, newer browsers will time out the page in around the same timespan.

Make certain that you do take a few things into consideration though, look here for what I mean.

As quoted:

It is very common for an ASP.NET application to call a Web service. If your application's Web page times out before the call to the Web service times out, this causes an unmanaged resource leak and a ThreadAbortException. This is because I/O completion threads and sockets are used to service the calls. As a result of the exception, the socket connection to the Web service is not closed and cannot be reused by other outbound requests to the Web service. The I/O thread continues to process the Web service response.

To avoid these issues, set timeouts appropriately as follows:

  • Set your proxy timeout appropriately.
  • Set your ASP.NET timeout greater than your Web service timeout.
  • Abort connections for ASP.NET pages that timeout before a Web services call completes.
  • Consider the responseDeadlockInterval attribute.
like image 103
Kyle Rosendo Avatar answered Dec 21 '22 02:12

Kyle Rosendo