How it works...
We enable this functionality by setting the server_fast_close parameter in pgbouncer.ini to 1. This parameter causes PgBouncer to mark a server connection with a special close_needed attribute any time a session might be affected by a change to the [databases] section of the configuration file, or someone issues an explicit RECONNECT.
When this attribute is active, PgBouncer will terminate the server connection as soon as the current transaction completes. This prevents interrupting transactions that are in progress, such as long running jobs, or even any transactions in-flight from an extremely active application. It also means we don't need to wait until the client explicitly disconnects. The server_fast_close setting should ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access