[PG14] Fix pgBouncer configuration and Upgrade pgbouncer to a recent version
As pointed out here we need to adjust OS settings for pgBouncer, db-migration#13 (comment 1362693195).
Summary of changes:
PgBouncer
-
version : 1.19.1 -
listen_backlog = 8192
Linux kernel:
-
net.core.somaxconn=65535 -
net.core.netdev_max_backlog=10000- currently: 300000 (it's ok)
-
net.ipv4.tcp_max_syn_backlog=8192 -
net.ipv4.ip_local_port_rang=10000 65535 a wider range of ports provides more available ports for use. -
net.ipv4.tcp_tw_reuse=1 -
net.netfilter.nf_conntrack_max=1048576
Test results
Test A, Reusing connections for each transaction
Metrics:
- T1 CURRENT settings: TPS from
3201
to3476
- T2 NEW settings: TPS from
3169
to3456
TPS volume in T2 ranges from +8% to -9% of T1, therefore it seems that there's no performance impact from the new settings for workloads with long persistent client connections;
tcp_tw_reuse=1
on client side)
Test B, new connections for each transaction (fixed with Metrics:
- T1 CURRENT settings: TPS from
2646
to2789
(including connections establishing) - T2 NEW settings: TPS from
2693
to2734
(including connections establishing)
TPS volume in T2 ranges from +7% to -5% of T1, therefore it seems that there's no performance impact from the new settings for workloads with long persistent client connections;
Change requests
-
GSTG Primary pgbouncers - production#16148 (closed) -
GPRD Primary pgbouncers - production#16181 (closed)
Edited by Rafael Henchen