Lets say I have 100 PostgreSQL nodes and one instance of pgpool-II.
Does a pgpool-II instance have a limit on concurrent connections?
I know PostgreSQL has a limit for connections, but I know the pgpool is load balancing too. Lets say I have 100 pg node, per node it has a limit of 100 concurrent users, if we calculated 100*100 nodes, that is 10,000 connections.
I want to know if pgpool has a connection limit based on that per pg node or pgpool itself.
If based on pgpool itself, will the pgpool watchdog promote a new pgpool instance if the pgpool connection limit is exceeded?
2
Answers
One pgpool process can handle one client connection at a time.
num_init_children will be proportional to the number of concurrent connections you want to have (if you want to have 10,000 concurrent connections through pgpool you need to have num_init_children = 10,000).
Total connections that can be handled by postgres should be proportional to the number of incoming client connection requests. In pgpool
The factors that we would need to consider are,
In Pgpool,
In Postgres
There’s a correlation b/w pgpool and postgres
The total connections to postgres = (num init children * max pool size)
By default num init children is 32 and max pool size is 15 , so that’s 480 , so pgpool can handle upto 480 connections to your backend nodes (postgres server), hence maxConnections should always be greater than (num init children * max pool size)