Re: More activity in pg_stat_activity

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Erik Jones <erik(at)myemma(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: More activity in pg_stat_activity
Date: 2007-01-05 22:36:19
Message-ID: 200701052236.l05MaJH02383@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Erik Jones wrote:
> Hi, this question is mostly born of curiosity: when monitoring our
> database I often use the following queries to get a current query count
> and listing of individual queries:
>
> select count(*)
> from pg_stat_activity
> where current_query not ilike '<idle>';
>
> select procpid, (now() - query_start) as query_time, client_addr as
> client_host, current_query
> from pg_stat_activity
> where current_query not ilike '<idle>'
> --and procpid=4452
> --and currrent_query ilike ' '
> order by (now() - query_start) desc;
>
> Before migrating to 8.2, even during peak times, unless queries were
> seriously stacking (not completing in a timely manner), we'd see at most
> 50 - 100 queries active at any given time (we did have
> stats_command_string = on). Since the migration, during peak times it's
> not uncommon to see the query count vary radically between around 80 and
> the upper 400s (we have max_connections set to 512). This variation is
> per second and when the count is high, the vast majority listed are
> sub-second. It would seem that this is due to some fine tuning
> somewhere on th backside of 8.2 versus previous versions. Was there
> previously a more limited precision to the query lengths that would be
> picked up by the pg_stat_activity view?

8.2 gives a much more up-to-date list of active queries than previous
versions.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Chernow 2007-01-05 22:44:29 Re: Database versus filesystem for storing images
Previous Message John McCawley 2007-01-05 22:28:50 Re: Database versus filesystem for storing images