Problem:
The PgBouncer pause script was hanging indefinitely on highly loaded database servers (more than 20,000 inserts per second) because the 'timeout' command was applied to the 'ssh' session, which includes the 'psql' command execution. In cases where the database server was under heavy load, the 'PAUSE' command could not complete within the expected time frame, causing the entire script to hang.
Solution:
Modified the script to apply the 'timeout' command directly to the 'psql' command. This ensures that if the 'psql' command does not complete within a 2-second timeout, it will be forcibly terminated, preventing the script from hanging.
Additionally
Add pgbouncer_pool_pause_timeout variable.
the maximum waiting time (in seconds) for the pool to be paused. For each iteration of the loop when trying to pause all pools. Default 2
Problem: The PgBouncer pause script was hanging indefinitely on highly loaded database servers (more than 20,000 inserts per second) because the 'timeout' command was applied to the 'ssh' session, which includes the 'psql' command execution. In cases where the database server was under heavy load, the 'PAUSE' command could not complete within the expected time frame, causing the entire script to hang.
Solution: Modified the script to apply the 'timeout' command directly to the 'psql' command. This ensures that if the 'psql' command does not complete within a 2-second timeout, it will be forcibly terminated, preventing the script from hanging.
Additionally
pgbouncer_pool_pause_timeout
variable.2