Hello,
we used to monitor waiting connections with postgres 9.6.6 via this query :
select count (*) from pg_stat_activity where wait_event IS NOT NULL
Now with postgres 10 it seems a bit harder to understand when a query from the application is waiting.
I built this query but not sure I'm getting the right information.
select count (*) from pg_stat_activity where wait_event_type ='Client' and wait_event IN ('ClientRead','ClienteWrite') and state='idle'
Can anyone help me?
Thanks
On Mon, Jul 23, 2018 at 04:41:59PM +0000, Nicola Contu wrote:
> we used to monitor waiting connections with postgres 9.6.6 via this
> query:
>
> select count (*) from pg_stat_activity where wait_event IS NOT NULL
Please note that a wait event becomes NULL once it is reset, so what
this query does is to monitor backends which are not waiting on
something, not backends which are idle. Hence you would include
backends also doing some active work.
> select count (*) from pg_stat_activity where wait_event_type ='Client'
> and wait_event IN ('ClientRead','ClienteWrite') and state='idle'.
>
> Can anyone help me?
You are visibly looking for a WHERE clause defined with state IN
('idle', 'idle in transaction') when looking for connections waiting for
some activity to be generated by the application, which works also with
9.6.
--
Michael
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера