Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgpool num_init_children with 10000 Concurrent connections

Yesterday I have test pgpool with pgbench :

pgbench -c 30 -T 20 -r pgbench -p9999 -h192.168.8.28

Concurrent connections is 30, pgpool default num_init_children is 32.

So, when I set -c 33 ,test will blocked unless I break out.


My question is :

If my concurrent connections online is 10000, should I set num_init_children=10000? 

It is terrible that num_init_children=10000 means pgpool start with 10000 process.

Is there something wrong ?

How can I config pgpool with 10000 concurrent connections?

like image 393
scofier Avatar asked Oct 25 '25 08:10

scofier


1 Answers

One pgpool child process can handle exactly one client connection at any time. So value of num_init_children is directly proportional to the number of expected maximum concurrent connections. If you want 10,000 concurrent connections through pgpool there is no other way than setting num_init_children to 10,000. PostgreSQL also spawns a dedicated process to handle each client connection so if at any instance the PostgreSQL sever has 10,000 connected clients, it would also have 10,000 child processes. The difference in pgpool and PostgreSQL in this respect is that pgpool prespawns the num_init_children number of connections and PostgreSQL do it on demand.

like image 91
Muhammad Usama Avatar answered Oct 27 '25 00:10

Muhammad Usama



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!