Re: current transaction in productive database

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: "ml(at)bortal(dot)de" <ml(at)bortal(dot)de>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: current transaction in productive database
Date: 2009-03-20 17:50:36
Message-ID: 49C3D76C.9040400@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

ml(at)bortal(dot)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/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2009-03-20 18:53:50 Re: Proposal of tunable fix for scalability of 8.4
Previous Message Greg Smith 2009-03-20 17:34:00 Re: current transaction in productive database