SQLServer high concurrency problem

In SQL Server, if the DataReader is used to read the data, the program or IIS may hang when the amount of data is large, and the DataReader is exclusively connected. Try to avoid using it in places with a large amount of data.

1. Use DataAdapter and DataSet to get database data

2. Increase the connection database string: Max Pool Size=512;

If the value of max pool size is not specified in the connectionString , then max pool size = 100. When the number of accessors connected to the database at the same time is 101, wait for the time set by SqlConnection.ConnectionTimeout (the default is 15 seconds). Available Connections will show the above error "The timeout period has expired. The timeout period has expired, but the connection has not been obtained from the pool. This situation may occur because all pool connections are in use and the maximum pool size has been reached."

3. Use cache

Guess you like

Origin blog.csdn.net/a159357445566/article/details/109250557
Recommended