To check the number of queries per second (QPS) on the PostgreSQL DB instance run the following SQL query:
with
t1 as (select sum(calls) n from pg_stat_statements),
t2 as (select sum(calls) n from pg_stat_statements , pg_sleep(1))
select
t2.n-t1.n the_num_of_queries_per_second
from
t1,t2;
Example:
postgres=> with
postgres-> t1 as (select sum(calls) n from pg_stat_statements),
postgres-> t2 as (select sum(calls) n from pg_stat_statements , pg_sleep(1))
postgres-> select
postgres-> t2.n-t1.n the_num_of_queries_per_second
postgres-> from
postgres-> t1,t2;
the_num_of_queries_per_second
-------------------------------
1234
(1 row)
postgres=>
ask_dima@yahoo.com
Top comments (0)