[pgpool-general: 8538] Re: DISCARD ALL connections in idle

Bo Peng pengbo at sraoss.co.jp
Wed Jan 4 14:59:35 JST 2023


Hi,

> I am using 30 num_childs with connection pooling on and child_life_time 0.
> 
> I am not sure why but when I am looking on the pg_stat_activity I can see
> 29 connection in idle state and the query is DISCARD ALL.
> 
> And after some time the application name changed to psql in all the
> connection.
> 
> I looking in the code but didn’t find anything about the DISCARD ALL query.
> 
> I can guess maybe it’s related for the connection reuse but still can’t
> explain why the query appears as DISCARD_ALL.

PostgreSQL's "pg_stat_activity.query" shows the text of this backend's most recent query.
If state is active this field shows the currently executing query. 
In all other states, it shows the last query that was executed.

https://www.postgresql.org/docs/15/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW

If the connection is in idle state, the query "DISCARD ALL" is the
last query that was issued by pgpool.

If a client session terminates, Pgpool-II will sent the queries specified in
"reset_query_list" to reset the backend connection.

The default value is 'ABORT; DISCARD ALL'.

https://www.pgpool.net/docs/latest/en/html/runtime-config-connection-pooling.html#RUNTIME-CONFIG-CONNECTION-POOLING-SETTINGS

-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS LLC
https://www.sraoss.co.jp/


More information about the pgpool-general mailing list