Home All Groups Group Topic Archive Search About

Polling a database - Performance question

Author
14 Jul 2006 6:15 PM
rlrcstr
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

Author
14 Jul 2006 7:20 PM
Mark
Personally I would collect the information and cache it in the service and
then write it to the database every 30seconds or so.

--
Best regards
Mark Baldwin

Show quote
"rlrcstr" <rlrc***@discussions.microsoft.com> wrote in message
news:1B193E79-1FCD-44DB-B5E3-E63D18F911F9@microsoft.com...
>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
Author
14 Jul 2006 8:15 PM
rlrcstr
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.

Show quote
"Mark" wrote:

> Personally I would collect the information and cache it in the service and
> then write it to the database every 30seconds or so.
>
> --
> Best regards
> Mark Baldwin
>
> "rlrcstr" <rlrc***@discussions.microsoft.com> wrote in message
> news:1B193E79-1FCD-44DB-B5E3-E63D18F911F9@microsoft.com...
> >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
>
>
>
Author
16 Jul 2006 1:04 AM
Robbe Morris [C# MVP]
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.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp





Show quote
"rlrcstr" <rlrc***@discussions.microsoft.com> wrote in message
news:1B193E79-1FCD-44DB-B5E3-E63D18F911F9@microsoft.com...
>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

AddThis Social Bookmark Button