Re: Connection Pooling - Mailing list pgsql-general

From Brandon Phelps
Subject Re: Connection Pooling
Date
Msg-id 4E8F56BC.7010207@gls.com
Whole thread Raw
In response to Re: Connection Pooling  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: Connection Pooling  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-general
Forgive me, I'm still a bit confused by how max_pool works with num_init_children.  First you said that at most I can
have32 clients sending queries, but then you said that each process can handle 4 different connections... so does this
meanthat I can have 128 connections from pgpool to my postgresql database? 

Sorry, not quite understanding.

On 10/07/2011 02:05 PM, Guillaume Lelarge wrote:
> 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
appand do a netstat -an on the web server (running pgpool) I see an additional connection to the database server, which
looksgood.  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.
>
>

pgsql-general by date:

Previous
From: Bosco Rama
Date:
Subject: select vs cursor/fetch speed disparity
Next
From: Derrick Rice
Date:
Subject: Re: Postgres 8.4: archive_timeout vs. checkpoint_timeout