[pgpool-general: 603] Re: About configuration parameters

Tatsuo Ishii ishii at postgresql.org
Thu Jun 7 07:38:46 JST 2012


No, we frequently have had similar questions from people and I think
the doc surely has a room to enhance. So please don't hesitate to
propose enhancement of the doc if you have a good idea.

Regarding your question, a short answer is no, but I think it's better
to explain what actually happens inside pgpool:

0) Wait for connection request from clients.

1) pgpool child receives connection request from a client.

2) The pgpool child looks for existing connection in the pool which
   has requested database/user pair

3) If found, reuse it.

4) If not found, opens a new connection to PostgreSQL and registers to
   the pool.  If the pool has no empty slot, closes the oldest
   connection to PostgreSQL and reuse the slot.

5) Do some query processing until the client sends session close request.

6) Close the connection to client but keeps the connection to
   PostgreSQL for future use.

7) Go to #0
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

> Tatsuo, sorry for my questions. It is not my intention to criticize the documentation because I think the documentation of pgpool-II is very good. I just write you because I need understand some things that I do not know. Maybe my questions are not writen in a good way. 
> 
> When max_pool has a value such as 4. It means that the same child process can be opened 4 connections regardless of the connections that can be reused? 
> 
> Thank you very much for your time. 
> 
> Regards. 
> 
> ----- Mensaje original -----
> 
> 
>> Hello everyone in the list. In other mails I asked about this topic, but I have some doubt with this configuration parameters. As I know, connection pooling software like pgpool-II, has a number of connections opened and reuses them whenever a new connection with the same properties comes in. 
>> 
>> About these configuration parameters: 
>> 
>> max_connections: Is the maximum concurrent connections between clients and postgresql server. (postgresql property) 
>> 
>> num_init_children: Like max_connections, it is the maximum concurrent connections between clients and pgpool-II. (pgpool property) 
>> 
>> max_pool: The maximum number of cached connections in pgpool-II children processes. pgpool-II reuses the cached connection if an incoming connection is connecting to the same database with the same username. If not, pgpool-II creates a new connection to the backend. If the number of cached connections exceeds max_pool, the oldest connection will be discarded, and uses that slot for the new connection. (According pgpool-II documentation) 
>> 
>> 
>> 1. Why max_connexion must satisfy this formula max_connexion >= (Nun_init_children * max_pool) and not this max_connexion >= nun_init_children? 
>> 
>> 2. A child process only opens one connection in the database server and it can be use concurrently (max_pool), or for each child process, it open a total of max_pool connections in the database server? 
>> 
>> 3. When is possible that the number of cached connections exceeds max_pool? 
> 
> Have you read this section in the pgpool doc? If yes and still have 
> questions please clarify. I would love to hear from you to enhance our 
> document. 
> 
> <dt><a name="MAX_POOL"></a>max_pool</dt> 
> <dd> 
> <p>The maximum number of cached connections in pgpool-II children processes. 
> pgpool-II reuses the cached connection if an incoming connection is 
> connecting to the same database with the same username. 
> If not, pgpool-II creates a new connection to the backend. 
> If the number of cached connections exceeds max_pool, 
> the oldest connection will be discarded, and uses that slot for the new connection. 
> 
>> The answers about these questions are welcome. 
>> Thank you very much for your time and sorry for such insistence. 
>> Regards 
>> 
>> 
>> 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... 
>> CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION 
>> 
>> http://www.uci.cu 
>> http://www.facebook.com/universidad.uci 
>> http://www.flickr.com/photos/universidad_uci 
> 
> 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... 
> CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION 
> 
> http://www.uci.cu 
> http://www.facebook.com/universidad.uci 
> http://www.flickr.com/photos/universidad_uci 
> 
> 
> 
> 
> 
> 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
> CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION
> 
> http://www.uci.cu
> http://www.facebook.com/universidad.uci
> http://www.flickr.com/photos/universidad_uci


More information about the pgpool-general mailing list