[pgpool-general: 289] connection management issues

Lonni J Friedman netllama at gmail.com
Sat Mar 24 05:58:21 JST 2012


I'm running pgpool-II-3.1.2 on a 64bit Linux server, sitting in front
of a PostgreSQL-9.0.4 cluster doing streaming replication (1 master, 2
slaves).    All the postgres servers have max_connections = 200.  I'm
using pgpool for load balancing and connection pooling.  All clients
are going through pgpool to connect to the cluster (nothing is
connecting directly to the database cluster, other than pgpool).

In pgpool.conf, I have the following:
num_init_children = 195
max_pool = 1
child_life_time = 300
connection_life_time = 3
client_idle_limit = 90

Unfortunately, several times every day, I see the following error in
the pgpool log:
pool_read_kind: error message from master backend:sorry, too many
clients already


I'm assuming that I'm getting those errors because all 200 connections
on the backend are in use.  Ideally, what I'd prefer is for pgpool to
accept 300 client connections at any given time, and manage them so
that the extra 100 (above max_connections) are queued up and fed to
the backend as available.  I've read the official documentation
several times, and the more I read it, the more confused I get.  If I
set max_pool=2 and num_init_children=200, would that would establish
200 backend connections at any time, with another 200 queued up by
pgpool as needed (which isn't quite what I want, but I guess it would
be sufficient)?  On one hand, that seems like the best possible
solution, but then the documentation warns that (max_pool *
num_init_children) <= max_connections, and clearly that is going to be
violated with what I'm trying to accomplish.

Ultimately, I want to avoid the scenario of client connections being
rejected, and get pgpool to always accept and manage them.

thanks


More information about the pgpool-general mailing list