[Pgpool-general] Pgpool maximum number of children

Yoshiyuki Asaba y-asaba at sraoss.co.jp
Wed Apr 9 10:30:49 UTC 2008


Hi,

From: "Stéphane A. Schildknecht" <stephane.schildknecht at postgresqlfr.org>
Subject: [Pgpool-general] Pgpool maximum number of children
Date: Wed, 09 Apr 2008 10:38:43 +0200

> # Number of pre-forked child processes
> num_init_children = 32

This parameter is the number of pool workers. One process can handle
one active session.

  client-1  <--> pgpool-1
  client-2  <--> pgpool-2
  ...
  client-32 <--> pgpool-32


> # Number of connection pools allowed for a child process
> max_pool = 4

This parameter is the number of connection cache slots in each
worker. Connection slots are mapped by user name and database name.

           | <---> PostgreSQL (user: x, database: y)
  pgpool-1 | <---> PostgreSQL (user: x, database: z)
           | <---> PostgreSQL (user: y, database: z)
           | <---> PostgreSQL (user: y, database: y)
  ...
           | <---> PostgreSQL (user: x, database: y)
  pgpool-32| <---> PostgreSQL (user: x, database: z)
           | <---> PostgreSQL (user: y, database: z)
           | <---> PostgreSQL (user: y, database: y)

If slot is full, pgpool discards the oldest cache and creates a new
connection cache.

> I wonder how it works in reality.
> 
> What would be the best value to give these paramters if I want mu pg server to
> accept 200 connections ?
> 
> Would it be relevant to have
> NIC=200
> MP=1

This is better if you have a single database.


> NIC=50
> MP=4

This is better if you have multiple databases.

Regards,
--
Yoshiyuki Asaba
y-asaba at sraoss.co.jp


More information about the Pgpool-general mailing list