Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug
Date
Msg-id aKhlAe8ZiVWLhPPj@depesz.com
Whole thread Raw
In response to Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug  (Chris Wilson <chris+google@qwirx.com>)
List pgsql-general
On Thu, Aug 21, 2025 at 07:38:34PM +0100, Chris Wilson wrote:
> If all your queries are coming through pgBouncer, and only those hang (the
> server itself responds if you connect directly to it), then it might be
> this pgBouncer issue:
> 
> https://github.com/pgbouncer/pgbouncer/issues/1054
> 
> Although that issue is now "closed", because the invisible "debug" log
> message was upgraded to a warning (and I don't think that change is in any
> released version), the underlying problem still exists: pgbouncer hangs
> completely (stops forwarding packets) for a while if the PAM
> authentication queue becomes full.
> 
> If you have a relatively slow PAM service (such as pam_ldap) then you can
> trigger it by opening ~100 connections to pgBouncer simultaneously (without
> waiting for previous ones to authenticate), something like this:
> 
> for i in `seq 1 100`; do psql -h pgbouncer -p 6432 -U user db_name -c
> "SELECT 1" & done

Please note that during the time of problem *NOTHING* seems to be
happening in Pg. There are no messages in logs about anything.

We don't have direct access to db, so there is no sane way to check if
directly sent queries will work.

I can, of course, start shell, and run queries there, but ephemeral
nature of the problem makes it more difficult.

As for authentication - there is no ldap/pam in place. All auth is based
on certs/passowrds-in-file, and we never noticed authentication
slowdowns.

Plus - queries like 'DISCARD ALL' are not ran because someone connected…

Best regards,

depesz





pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug
Next
From: Adrian Klaver
Date:
Subject: Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug