[Pgpool-general] about num_init_children and max_pool

Tatsuo Ishii ishii at sraoss.co.jp
Mon May 24 08:01:59 UTC 2010


> Suppose that, i have a limit  of 100 connections on postgres, no more no 
> less, now my question are:
> 
>   if   i set a num_init_children to 100 , have i  set  max_pool  to 1 
> only???
> or
> if i set  num_init_children to 50, have i set  max_pool  to 2 only??????
> or
> if i set num_init_children to 25, have i set  max_pool  to 4 only???
> 
> i mean:
> 
> num_init_children * max_pool =    postgres's connections ??

All are correct. Plus, you need to consider
superuser_reserved_connections (see postgresql.conf). Also you need to
consider query cancelation, which requires one more connection per
concurrent query cancel operations. In summary, you need to satisfy
one of them:

1) max_pool*num_init_children <= (max_connections - superuser_reserved_connections)

2) max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connections)

#2 includes query cancelation worst case.

For example, default setting of max_pool = 4 and num_init_children =
32 requires max_connections = 131 at least(assuming
superuser_reserved_connections = 3) for #1, 259 for #2.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-general mailing list