Files
shikharbhardwaj aa743881c4 Create multiple pgbouncer instances
Configure a systemd template to create multiple pgbouncer instances, to
avoid bottlenecks created due to it being single-threaded.

To have pgbouncer connect to PG via a domain socket, we need to specify
a unix_socket_dir in the pgbouncer config. But this config value cannot
be shared between different pgbouncer instances, thus we use systemd
socket activation to have pgbouncer use the same server connection
socket but separate listening sockets. [1]

This change also adds a [peers] section to the pgbouncer config, to
allow processing cancellation requests correctly. Since this needs a
unique `peer_id` to be set for each process, we create separate config
files for each process here. [2]

[1]: a980f572d5/src/pooler.c (L510)
[2]: https://www.pgbouncer.org/config.html#section-peers
2025-04-17 14:32:13 +05:30
..