[pgpool-general: 7954] Re: increase in the number of connections from Pgpool to database

Tatsuo Ishii ishii at sraoss.co.jp
Thu Dec 23 09:48:42 JST 2021


> Thank you for the interesting information. But, unfortunately, not
> enough to fully understand what is happening. This article says:
> "So if the application uses only one user to connect to only one
> database, say [pguser1,pgdb1], then each child will continue to reuse
> the first connection and will never open a second connection"
> 
> But, all services for us work each with its own base and under one
> user, i.e. with one pair of "user-database". However, the number of
> connections grows if they are not forcibly killed.

The key is "each child". When a connection request arrives to the
listening port for pgpool, the kernel assigns it to one of pgpool
child process in "waiting for request" state. If the assigned process
already has connection pool for [pguser1,pgdb1], then it will be
reused. If it does not have the pool yet, it will create a new
connection to PostgreSQL. In the last, probably all pgpool process
will have [pguser1,pgdb1] and no new connection to PostgreSQL will not
be created.

> Could you tell me where to find a description of what mechanism of
> work of connections in Pgpool in the following cases:
> 
> 1. Parameter connection_cache = off.

It just forget the connection pool once the client disconnects to pgpool.

> 2. Parameter max_pool = 0

You cannot do this. max_pool must be greater than 0.

> 3. In what cases the existing connection with a pair of user-database
> is not reused, but a new one is created.

See above.

Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list