pooled connections

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

I am getting an error about my # pooled connections
exceeded or timeout exceeded. I am searching my code for
any open data readers.

I have read that i can use perfmon to watch the number of
pooled connections using .net clr data and
counter "sqlclient:current #pooled and nonpooled".

My question/problem is my application is not in the
instances select list to the right of the counter listbox.

How do i monitor only my application?

Will this counter tell me how many connections are
currently in use?
thx
dave
 
Since you're using SQL Server, you can monitor the SQL Server perf counter
(general) network connections. The perf counters are not particularly
reliable, but yes you can monitor the number of connections in the pool.
In all known cases, the reason boils down to not closing an opened
connection. This is often because when you pass a DataReader to another
context where the Connection is not visible--unless you use
CommandBehavior.CloseConnection.

hth

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Hi Dave,
Is it a web application? If yes then you may not be able
to monitor it individually if it is being run as a part
of aspnet_wp.exe process (pooled).

hth
 
Yes, this is a web application.

I am using perfmon on the server and looking through the
performance objects. Which performance object is it that
I would find general - network connections?

Last night, i removed all instances of a datareader but
one. I have subsequently replaced with datasets in an
effort to avoid any hanging data readers. I was using
the CommandBehavior.CloseConnection parameter.

It sure would be nice to able to view the connections via
perfmon/profiler so that i can immediately view the
number of connections open/close.

I appreciate your help.
dave
 
SQL Server General Statistics User Connections.
Since this is a web site, all connections will be "owned" by the ASPNET
account. You won't be able to see the individual instances of each ASP
invocation. You can also monitor the .NET CLR Data counters with perf mon
(or an application). But as I said these counters have some issues. They
work for the most part, but just take the results with a grain of salt. A
typical ASP site should run up a dozen or so connections in the pool
(assuming the ConnectionString is not changing on each invocation). If it
keeps rising it means that either the connections are not getting closed,
the amount of processing required is too great to handle the load, there are
lock contentions that prevent applications from completing their work in a
timely fashion, or something else that's preventing the code from closing
the connection.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top