Check the connection pool (connection pool) overflow problem!

Source: Internet
Author: User

Another project error is reported today:

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and Max pool size was reached.

 

The first response is that the brother wrote datareader and did not close it. This does not start to look for datareader in the whole project. Well, let alone, there are two fucking readers working there ....

 

After half a day, errors come back ....

 

This can make me depressed. The next thought is of course to view the number of data links. The link corresponding to the query is not closed.

There are different ways to view the number of links on the Internet, and there is no such statement ....

First:

Select * From DBO. sysprocesses where db_name (dbid) = 'youdbname'

This is not the so-called Number of connections...

Of course, it still has a certain relationship with the number of connections, as long as a click, the total number will increase a few, after the reset, it will reach more than 600 in half an hour...

Khan ....

Who? Who did it? The link corresponding to the statement cannot be found...

 

No way, you can only get it done. Now that you know this stuff has a certain relationship with the connection, let's take a look at its specific information.

Check msdn and find that the SQL _handle field corresponds to the SQL statement ....

The next thing, of course, is to find the corresponding SQL statement.

Use master
Select db_name (s1.dbid ),
S2.text
From sysprocesses as S1
Cross apply SYS. dm_exec_ SQL _text (SQL _handle) as S2
Where s2.objectid is null
Order by s1. SQL _ HANDLE

 

Now you know what it is, and you will know which statement corresponds to a high number of connections. When you know the statement, you will know that the corresponding operation is not closing the connection...

In this way, it is more convenient to find the problem that the number of connections is too high?

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.