Re: current transaction in productive database - Mailing list pgsql-performance

From Euler Taveira de Oliveira
Subject Re: current transaction in productive database
Date
Msg-id 49C3D76C.9040400@timbira.com
Whole thread Raw
In response to current transaction in productive database  ("ml@bortal.de" <ml@bortal.de>)
List pgsql-performance
ml@bortal.de escreveu:
> is there a way to find out, how many transactions my currenc productive
> database is doing?
>
If you're looking for number of transactions then you can query the catalogs as:

$ export myq="select sum(xact_commit+xact_rollback) from pg_stat_database"
$ psql -U postgres -c "$myq" && sleep 60 && psql -U postgres -c "$myq"
    sum
-----------
 178992891
(1 row)

    sum
-----------
 178996065
(1 row)

$ bc -q
scale=3
(178996065-178992891)/60
52.900

Depending on your workload pattern, it's recommended to increase the sleep time.


--
  Euler Taveira de Oliveira
  http://www.timbira.com/

pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: current transaction in productive database
Next
From: Scott Carey
Date:
Subject: Re: Proposal of tunable fix for scalability of 8.4