Re: Connection Pooling

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Brandon Phelps <bphelps(at)gls(dot)com>
Cc: Adam Cornett <adam(dot)cornett(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Connection Pooling
Date: 2011-10-07 18:05:38
Message-ID: 1318010739.2116.20.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2011-10-07 at 13:51 -0400, Brandon Phelps wrote:
> So we decided to go with pgpool-II. The documentation is a little lacking for pgpool-II so I have one question:
>
> How are connections handled once the default levels are reached? Here are my pgpool settings:
>
> num_init_children = 32
> max_pool = 4
>

This configuration means you can have at most 32 clients sending queries
at the same time to PostgreSQL via pgpool. With a max_pool of 4, each
pgpool process can handle four different connections to the same server:
they could differ either by the database name or by the user name.

> This creates 32 child processes when we start pgpool which I understand. Each time I browse to a page from our web app and do a netstat -an on the web server (running pgpool) I see an additional connection to the database server, which looks good. I assume that once 32 connections are opened at once then pgpool will start re-using them, based on the num_init_children * max_pool... But since 32 * 4 = 128, what will happen on the 129th connection? Will a new child get created, allowing for 4 more connections (1 * max_pool), or will that connection be denied?
>

Connection is not denied (that would be the behaviour of PostgreSQL).
Connection is on hold waiting for a pgpool process to be available.
Meaning you don't want long connections.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jack Christensen 2011-10-07 18:23:33 Failure controlling PG 9.1 service on Ubuntu 10.04 32-bit
Previous Message Brandon Phelps 2011-10-07 17:51:13 Re: Connection Pooling