[pgpool-general: 302] Re: Calculating num_init_children..?

Matt Wise matt at nextdoor.com
Tue Mar 27 08:15:45 JST 2012


Lonni,
  Ok thanks... I was afraid of that, we had mis-understood the setting. Since we have two poolers that we distribute our connections over, and we leave some headroom for other tools... it ends up looking like this for us:

Postgres Servers: 512 max_connections
  (-3 for system connections)
  (-128 for a local pgbouncer that we use for some legacy purposes)
  = 381 available connections

PGPool Servers (2 of them): 190 num_init_children, max_pool 1
  (* 2 servers)
  = 380 total potential connections it can make

Our client machines run pgbouncer locally.. which has its own connection settings that have to tune based on the number of frontend servers, and the pgpool server settings. Thanks!

—Matt

On Mar 26, 2012, at 3:53 PM, Lonni J Friedman wrote:

> On Mon, Mar 26, 2012 at 3:51 PM, Matt Wise <matt at nextdoor.com> wrote:
>> In our environment we have 4 DB servers (db1/2/3/4) and db1 is the master. If we want to allow 512 total connections to each of our DB servers (so 2048 in total, among all 4 servers) ... whats the best tuning for pgpool's connection parameters. Assume we have 1 primary database, and 1 user that we connect to the database with.
>> 
>> Do we want to do:
>>  num_init_children = (512 * 4) = 2048
>>  max_pool = 1
>> 
>> Or when a client makes a connection, does PGPool simultaneously connect to all 4 DBs... and therefore we want:
>>  num_init_children = 512
>>  max_pool = 1
>> 
> 
> num_init_children is the number of connections that are opened to
> *all* database servers specified in pgpool.conf.  If you set
> num_init_children=2048, then you need to set max_connections=2048 in
> postgresql.conf.
> 
> Based on your description above, I think what you want is to set
> num_init_chidlren=512.



More information about the pgpool-general mailing list