I am using pgbouncer in transaction mode & trying to allow close to 500 active transaction. The purpose is simply to stress test the setup
Current setup: [ \'n\'
If you are running PgBouncer on the same host as PostgreSQL, you should increase CPU priority of pgbouncer
process with renice
.
renice -10 -p `pidof pgbouncer`
Default Linux scheduler is round-robin and it starves PgBouncer because it treats all processes equally - and hundreds of postgres
processes overwhelm single pgbouncer
process.
It's usually not a problem under moderate load, but it can be a really important factor when running lots of small transactions.
Even renice cannot do magic: if you run more than 10k+ TPS, you probably have to consider some load balancing (HAProxy?) in front of (multiple) PgBouncer.