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

Re: Polling a database - Performance question by Mark

Mark
Fri Jul 14 14:20:09 CDT 2006

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" <rlrcstr@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



Re: Polling a database - Performance question by rlrcstr

rlrcstr
Fri Jul 14 15:15:02 CDT 2006

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.

"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" <rlrcstr@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
>
>
>

Re: Polling a database - Performance question by Robbe

Robbe
Sat Jul 15 20:04:53 CDT 2006

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





"rlrcstr" <rlrcstr@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