views:

66

answers:

3

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.

A: 

The default timeout will work for most scenarios. If it doesn't in yours and you encounter problems you could modify it. Lowering this timeout could be good in cases where you want to immediately throw an exception if there are problems connecting to avoid monopolizing worker threads.

Darin Dimitrov
+1  A: 

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.

Guffa
A: 

Mostly that should be good. If you encounter problems you could experiment with tweaking it but the most important thing then, and always actually, is the measure the impact of your changes.

Another thing to keep things from going more smoothly is to use caching. There are open source tools available like memcached. Microsoft also has its own distributed caching mechanism: AppFabric.

XIII