[Pgpool-general] pgpool problems

Tatsuo Ishii t-ishii at sra.co.jp
Thu Feb 24 11:39:30 GMT 2005


> Tatsuo Ishii wrote:
> > greetings to Denmark!
> 
> nearly :) .de is Germany.

Oops, sorry.

> > If your web application connect to PostgreSQL as all same user, say
> > "nobody", raising max_pool will not benefit at all. Actually in this
> > case max_pool = 1 is sufficiant. However since max_pool slot eat very
> > little memory, you might want to leave as it is.
> > 
> > Changing num_init_children will affect the total throughput. In
> > theory, lowering num_init_children will decrease the load of
> > PostgreSQL but increase the chance for pg_connect waiting for next
> > available pgpool's child process. Increasing num_init_children will
> > have opposite effect. So there must be a sweet spot for
> > num_init_children. I suggest you play around several num_init_children
> > settings seeking for the sweet spot.
> 
> This is how I understand pgpool:
> 
> num_init_children is amount of preforked processes, each is connected to 
> postgresql. (postgresql processes = num_init_children)

Right.

> max_pool is amount of connections that each pgpool child accepts.
> (max connections to pgpool possible = num_init_children * max_pool)
> If I set max_pool to 10 then each pgpool child accepts 10 connections 
> which get all "tunneled" through the one connection from this pgpool 
> child to postgresql process.

Um, no. A pgpool process always accept one connection at the
time. max_pool actually means the upper limit of number of established
connections (connection cache) to PostgreSQL.

> This means to lower idle postgresql processes I can in theory lower 
> num_init_children and raise max_pool to satisfy my (low number of) 
> postgresql connections.
> 
> My understanding seems to be wrong if you say that max_pool = 1 is 
> sufficiant if I only have one database user.
> 
> Can you enlighten me? :)

For example, if num_init_children = 10 and max_pool = 4, then up to 40
connections will established between pgpool and PostgreSQL. If
num_init_children = 4 and max_pool = 10, then total number of
connections will be 40 too. However there's a difference. In former
case up to 10 *live* connections can be made between client and
pgpool, thus 10 of 40 connections to PostgreSQL will be active (30
connections will be idle). In later case only 4 connections will be
active (36 connections will be idle).
--
Tatsuo Ishii


More information about the Pgpool-general mailing list