Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long should the connectionString timeout be in ASP.NET applications? (sqlclient)

In my ASP.NET application, I have a sqlclient connectionstring in my web.config file, What is the recommended timeout setting for production environment? Default is 15 seconds.

My web farm and database cluster are on the same switch, so there should not be much latency.

like image 378
frankadelic Avatar asked Jun 29 '26 10:06

frankadelic


1 Answers

The default of 15 seconds is a reasonable value, and there is rarely any reason to change it.

A reason to have a longer timeout is for example if your database server is sometimes running heavy queries that makes it unresponsive for a few seconds.

A reason to have a shorter timeout would be if you want an error early instead of waiting when the database is unresponsive, for example if you can use cached data as a backup.

like image 199
Guffa Avatar answered Jul 01 '26 05:07

Guffa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!