From: Michael Paquier <michael@paquier.xyz>
To: Nicola Contu <Nicola.Contu@gtt.net>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Alessandro Aste <alessandro.aste@gtt.net>
Subject: Re: Waiting connections postgres 10
Date: Tue, 24 Jul 2018 14:58:09 +0900
Message-ID: <20180724055809.GE4736@paquier.xyz> (raw)
In-Reply-To: <e7a0c47ac21d455ca8e4ba9642c83dd5@gtt.net>
References: <e7a0c47ac21d455ca8e4ba9642c83dd5@gtt.net>
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
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: michael@paquier.xyz, Nicola.Contu@gtt.net, alessandro.aste@gtt.net
Subject: Re: Waiting connections postgres 10
In-Reply-To: <20180724055809.GE4736@paquier.xyz>
References: <e7a0c47ac21d455ca8e4ba9642c83dd5@gtt.net> <20180724055809.GE4736@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox