Thread: Average connections

Average connections

From
Pedro Doria Meunier
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all

I've googled for an answer but couldn't find one.
Is there anyway to monitor the average connections to a database?

Thank you in advance for any insights.

BR,

- --
Pedro Doria Meunier
GSM: +351 96 17 20 188
Skype: pdoriam

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFKL4ph2FH5GXCfxAsRAqOBAJwOJ2H4FVKAuIMxFtWasZpdI0cdggCgv2qM
5+JF4AV8VBobs1lVqeIQw9o=
=Am3y
-----END PGP SIGNATURE-----


Re: Average connections

From
Bill Moran
Date:
In response to Pedro Doria Meunier <pdoria@netmadeira.com>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all
>
> I've googled for an answer but couldn't find one.
> Is there anyway to monitor the average connections to a database?
>
> Thank you in advance for any insights.

The pg_stat_activity table holds 1 row for each connection with information
on what that connection is doing.

It wouldn't be very difficult to write a passthrough script for something
like MRTG to graph this data.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

Re: Average connections

From
Pedro Doria Meunier
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thank you Bill for your tip.

As far as the table's name is concerned the only one I can find is
'pg_statistic' (under pg_catalog). I'm using PGSQL 8.2.9 on x86_64.

BR,

Pedro Doria Meunier
GSM: +351 96 17 20 188
Skype: pdoriam




Bill Moran wrote:
> In response to Pedro Doria Meunier <pdoria@netmadeira.com>:
>
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>
>> Hi all
>>
>> I've googled for an answer but couldn't find one. Is there anyway
>> to monitor the average connections to a database?
>>
>> Thank you in advance for any insights.
>
> The pg_stat_activity table holds 1 row for each connection with
> information on what that connection is doing.
>
> It wouldn't be very difficult to write a passthrough script for
> something like MRTG to graph this data.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFKL8ND2FH5GXCfxAsRAu/XAJ43UGqlzv5gfzg1YgECbhvL2MaPzwCdEnt3
GfewITsorV/t7cfpq3WxVqM=
=84cI
-----END PGP SIGNATURE-----


Re: Average connections

From
Brad Nicholson
Date:
On Wed, 2009-06-10 at 15:29 +0100, Pedro Doria Meunier wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thank you Bill for your tip.
>
> As far as the table's name is concerned the only one I can find is
> 'pg_statistic' (under pg_catalog). I'm using PGSQL 8.2.9 on x86_64.
>
> BR,

http://www.postgresql.org/docs/8.2/interactive/monitoring-stats.html#MONITORING-STATS-VIEWS-TABLE

pg_stat_database also has the number of active server processes
connected to a database.

>
>
> Bill Moran wrote:
> > In response to Pedro Doria Meunier <pdoria@netmadeira.com>:
> >
> >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> >>
> >> Hi all
> >>
> >> I've googled for an answer but couldn't find one. Is there anyway
> >> to monitor the average connections to a database?
> >>
> >> Thank you in advance for any insights.
> >
> > The pg_stat_activity table holds 1 row for each connection with
> > information on what that connection is doing.
> >
> > It wouldn't be very difficult to write a passthrough script for
> > something like MRTG to graph this data.
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iD8DBQFKL8ND2FH5GXCfxAsRAu/XAJ43UGqlzv5gfzg1YgECbhvL2MaPzwCdEnt3
> GfewITsorV/t7cfpq3WxVqM=
> =84cI
> -----END PGP SIGNATURE-----
>
>
--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.



Re: Average connections

From
Bill Moran
Date:
In response to Pedro Doria Meunier <pdoria@netmadeira.com>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thank you Bill for your tip.
>
> As far as the table's name is concerned the only one I can find is
> 'pg_statistic' (under pg_catalog). I'm using PGSQL 8.2.9 on x86_64.

Can't imagine why you're not seeing it.  It existed in 8.2, and I don't
know of any config setting that would make it not show up.

> Bill Moran wrote:
> > In response to Pedro Doria Meunier <pdoria@netmadeira.com>:
> >
> >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> >>
> >> Hi all
> >>
> >> I've googled for an answer but couldn't find one. Is there anyway
> >> to monitor the average connections to a database?
> >>
> >> Thank you in advance for any insights.
> >
> > The pg_stat_activity table holds 1 row for each connection with
> > information on what that connection is doing.
> >
> > It wouldn't be very difficult to write a passthrough script for
> > something like MRTG to graph this data.
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iD8DBQFKL8ND2FH5GXCfxAsRAu/XAJ43UGqlzv5gfzg1YgECbhvL2MaPzwCdEnt3
> GfewITsorV/t7cfpq3WxVqM=
> =84cI
> -----END PGP SIGNATURE-----
>


--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

Re: Average connections

From
Pedro Doria Meunier
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

First of all thank you very much to everyone that shared their views
on the task at hand!

I've actually accomplished it using MRTG :)

BR,

Pedro Doria Meunier
GSM: +351 96 17 20 188
Skype: pdoriam




Bill Moran wrote:
> In response to Pedro Doria Meunier <pdoria@netmadeira.com>:
>
> Thank you Bill for your tip.
>
> As far as the table's name is concerned the only one I can find is
> 'pg_statistic' (under pg_catalog). I'm using PGSQL 8.2.9 on x86_64.
>
>
>> Can't imagine why you're not seeing it.  It existed in 8.2, and I
>>
> don't
>> know of any config setting that would make it not show up.
>
> Bill Moran wrote:
>>>> In response to Pedro Doria Meunier <pdoria@netmadeira.com>:
>>>>
>>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>>>
>>>>> Hi all
>>>>>
>>>>> I've googled for an answer but couldn't find one. Is there
>>>>> anyway to monitor the average connections to a database?
>>>>>
>>>>> Thank you in advance for any insights.
>>>> The pg_stat_activity table holds 1 row for each connection
>>>> with information on what that connection is doing.
>>>>
>>>> It wouldn't be very difficult to write a passthrough script
>>>> for something like MRTG to graph this data.
>>>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFKL/fv2FH5GXCfxAsRAiFmAKCP5i4lH7g0F/aldAM3+jzRO5KfdACgsU73
2ui5R+4Gb8HPCt+4uO7SH8w=
=GTGK
-----END PGP SIGNATURE-----