[pgpool-general: 4260] Re: Question about num_init_children and max_pool

Muhammad Usama m.usama at gmail.com
Wed Dec 23 17:14:20 JST 2015


*num_init_children* configuration parameter is used to specify how many
child processes pgpool-II should spawn to handle client connections. Since
one pgpool-II child can handle one client connection at a time, so at any
time pgpool-II can handle a maximum num_init_children number of concurrent
connections.

As far as for the *max_pool* parameter, It configures how many different
connections to cache per pgpool-II child. A client connection is identified
by a user and a database pair,  So the pgpool-II child process opens a new
backend connection only if the requested [user, database] pair is not
already in the cache of the pgpool-II child accepting that client
connection. And if the application uses only one user to connect to only
one database, then each child will continue to reuse the first cached
connection and will never open a second connection. But if the client uses
more than one pair of user and database, then each child can cache up to a
max_pool number of different client connection.

So keeping in mind the above, relation between num_init_children, max_pool
and PostgreSQL's max_connections is as follows.

The max_connection setting for PostgreSQL, should satisfy the condition,
max_pool times num_init_children in pgpool-II should be less than or equal
to PostgreSQL max_connectiopn minus PostgreSQL
superuser_reserved_connections.

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

Thanks
Best regards
Muhammad Usama








On Tue, Dec 22, 2015 at 6:10 PM, <aegir at free.fr> wrote:
>
> Hello,
>
> Something doesn't sound clear to me with pgPool configuration.
>
> Let's say it's configured with :
>
> num_init_children = 2
> and
> max_pool = 4
>
> while the postmasters are configured with max_connections=10
>
> How many "psql  -p 9999 -U user_1 DB_1" could I run from terminals
without beig blocked ? 2, 8 or 10 ?
>
> IMHO, according the available documentation I should'nt be blocked
because as I use always same user/db pgPool is supposed to reuse always the
same connection in each child pool, so the 11th concurrent connexion should
be rejected (not blocked) due to the max_connections limit.
>
> But by running some tests, it seems that the 3rd connection is blocked.
>
> Could you please give me any clue about the expected behaviour ?
>
> Thank you.
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20151223/57b92ad6/attachment.html>


More information about the pgpool-general mailing list