Re: Getting time-dependent load statistics

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Getting time-dependent load statistics
Date: 2009-02-20 18:39:54
Message-ID: dcc563d10902201039h538c15a0ub8819d7305d757c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 20, 2009 at 9:11 AM, Torsten Bronger
<bronger(at)physik(dot)rwth-aachen(dot)de> wrote:
> Hallöchen!
>
> Yesterday I ported a web app to PG. Every 10 minutes, a cron job
> scanned the log files of MySQL and generated a plot showing the
> queries/sec for the last 24h. (Admittedly queries/sec is not the
> holy grail of DB statistics.)
>
> But I still like to have something like this. At the moment I just
> do the same with PG's log file, with
>
> log_statement_stats = on
>
> But to generate these plots is costly (e.g. I don't need all the
> lines starting with !), and to interpret them is equally costly. Do
> you have a suggestion for a better approach?

You can turn on log duration, which will just log the duration of
queries. That's a handy little metric to have and every so often I
turn it on and chart average query run times etc with the actual
queries. I also turn on logging long running queries of say 5 or 10
seconds or more.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Cott Lang 2009-02-20 19:01:11 Fixing invalid owners on pg_toast tables in 8.3.5
Previous Message Torsten Bronger 2009-02-20 18:37:27 Re: Getting time-dependent load statistics