pgpool and postgresql lots of idle connection

2.8k Views Asked by At

I'm using postdock (https://github.com/paunin/PostDock)

Postgres version: 10 Pgpool version: 3.7

1 pgpool 1 master 1 slave 1 backup (barman)

My application is connecting with pgpool ( I'hv 1 databases and 7 user/app) and I'hv seen from background that in PostgreSQL has lots of IDLE connection that was running query DISCARD ALL.

I increased the postgresql max connection from 100 to 1500. because sometimes idle connection goes up to 850 and for that connection is impacting our services.

Now we're killing the idle connection manually every 5 min.

Our application is closing connection properly because in our existing DB system (without pgpool) it only opened 12 DB connection.

have anyone face this similar problem?

I'm using the same configuration that is provided with postdock.

1

There are 1 best solutions below

0
On

I don't know much about postdock, but it seems this pgpool.conf(https://github.com/paunin/PostDock/blob/master/src/pgpool/configs/pgpool.conf) is used for settings. and you can see "connection_life_time = 0" connection_life_time is the time in seconds to terminate the cached connections to the PostgreSQL backend and 0 means connections will not be disconnected. you should specify certain specific number.