Polling a database - Performance question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a couple of custom performance monitor counters. Basically I have
a service that runs and updates the counter on an interval as often as once
per second.

So the question is, for performance on the SQL Server and the app itself, so
I establish the connection once and maintain it until the service is stopped,
or do I reconnect every time the counters get updated?

(It's a small query, just reading blocks and database names from a couple of
the master tables.)

Thanks.

Jerry
 
Personally I would collect the information and cache it in the service and
then write it to the database every 30seconds or so.
 
I'm not writing anything to the database. I'm reading statistics from the
database and updating performance monitor counters that I created. There's
no caching or the stats would be invalid.
 
Connection pooling should take care of this in the background
for you. So, I doubt you'd notice much difference by
opening and closing it each time.
 
Back
Top