Monitoring number of backends

From: andy <andy(at)squeakycode(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Monitoring number of backends
Date: 2013-10-22 17:41:58
Message-ID: 5266B8E6.1080500@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

My website is about to get a little more popular. I'm trying to add in
some measurements to determine an upper limit of how many concurrent
database connections I'm currently using.

I've started running this:

SELECT sum(numbackends) AS count, sum(xact_commit) as ttlcommit FROM
pg_stat_database;

Every 10 seconds or so. I don't think its what I want though. It seems
way too small. I'm guessing that its not a measure of the previous 10
seconds. Its a count of how many backends are in use at the exact
moment I run the sql.

Is there a cumulative count someplace?

Thanks for your time,

-Andy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2013-10-22 17:59:37 Re: Monitoring number of backends
Previous Message Rémi Cura 2013-10-22 17:21:36 Error with "return query" ( "return next" working ) with custom type