[Pgpool-general] can't connect : cannot get session context

Toshihiro Kitagawa kitagawa at sraoss.co.jp
Thu Oct 21 02:41:38 UTC 2010


> > These variables should set it as follows.
> >
> >    PostgreSQL         pgpool-II
> >    max_connections>= num_init_children * max_pool
> >
> > Will you confirm the max_connections setting of all backends?
> >
> currently I don't see the issue anymore (maybe because of the 3.0.1 
> upgrade),
> however the default settings are:
> 
> postgresql 9.0 from pgrpms:
> max_connections = 100
> 
> pgpool 3.0.1:
> num_init_children = 32
> max_pool = 4
> 
> obviously 32*4 < 100 which is not good
> I'd think that the defaults should be adjusted appropriately .
> (I never had to edit those settings before, normally I wouldn't touch them)

Certainly, I think that it's better the default value of max_pool is 3.

> BTW : can you explain a little on the max_pool variable and its 
> implications ?

The description of max_pool in pgpool-II manual is as follows.

-------------------------------------------------------------------------
max_pool

The maximum number of cached connections in pgpool-II children processes.
pgpool-II reuses the cached connection if an incoming connection is
connecting to the same database by the same username. If not, pgpool-II
creates a new connection to the backend. If the number of cached
connections exceeds max_pool, the oldest connection will be discarded,
and uses that slot for the new connection. Default value is 4. Please be
aware that the number of connections from pgpool-II processes to the
backend will be num_init_children * max_pool. This parameter can only
be set at server start. 
-------------------------------------------------------------------------

Therefore, when pgpool-II tries to cache connection beyond
max_connections, "sorry, too many clients already" error returns
from PostgreSQL.

-- 
Toshihiro Kitagawa
SRA OSS, Inc. Japan



More information about the Pgpool-general mailing list