Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ADMIN] Queries and Transactions per second - PostgreSQL 9.2

0 views
Skip to first unread message

Patrick B

unread,
Jun 29, 2016, 12:02:44 AM6/29/16
to
Hi guys,

I wanna get how many queries and transactions my DB is doing per second...

is that a way to get that? maybe using pg_stat_statements?


cheers

Steve Crawford

unread,
Jun 29, 2016, 12:05:36 AM6/29/16
to
Check out pgbadger and/or pgfouine.

Cheers,
Steve

bricklen

unread,
Jun 29, 2016, 1:11:50 PM6/29/16
to
On Tue, Jun 28, 2016 at 9:00 PM, Patrick B <patrick...@gmail.com> wrote:
I wanna get how many queries and transactions my DB is doing per second...

is that a way to get that? maybe using pg_stat_statements?

As mentioned in another reply, you can determine the queries per second being executed if you turn on full logging and run the log through pgbadger (for example).
For transactions, sampling the pg_stat_database relation will give you transaction stats.
For example:
SELECT current_setting('port')::INTEGER as port, datname AS dbname, SUM(xact_commit)+SUM(xact_rollback) AS transactions
FROM pg_stat_database
WHERE datname NOT IN ('template0','template1')
GROUP BY datname ;
 
0 new messages