My DB application connected with pgBouncer and pgpool
Node info:
- 3 Pgbouncer
- 3 pgpool
- 3 dbnode (1 is primary 2 is standby)
For pgbouncer: default_pool_size=200 ,reserve_pool_size=10
For pgpool: num_init_children=2000 ,max_pool=4
For postgres: max_connection=29000, wal_sync_method=fsync, shared_buffer=8GB, wal_buffers=16MB,max_wal_size=8GB,min_wal_size=2GB,max_parallel_workers = 16
System: RAM: 40GB, CPU:24, SWAP:16GB
My issue is that when TPS is too high in that time suddenly my application become slow. Here my average TPS between 40K - 60K. But suddenly it is over 100K-300K where active session 200-290. I am not sure why it is happening? Is it due to slow query or configuration (pgbouncer,pgpool) issue? Need expert opinion.