[pgpool-general: 2213] Re: Pgpool2 3.3.0: idle connections

Tatsuo Ishii ishii at postgresql.org
Thu Oct 24 10:52:07 JST 2013

> Hi! 
> I have the following setup: 1 pgpool2 server with 2 postgresql 9.2 backends with streaming replication.
> Recently I've noticed a strange thing - the number of idle pgpool connections on pgpool2 server is very low. Like 
> # ps uax |grep -i pgpool | grep -i idle | wc -l
> 1

It's normal. Idle pgpool process are shown something like this:

18809 pts/3    S      0:00 pgpool: wait for connection request

> And the number of idle postgresql connections on backends is much higher 
> 1st-backend# ps uax |grep -i postgres |grep -i idle | wc -l
> 46
> 2nd-backend# ps uax |grep -i postgres |grep -i idle | wc -l
> 47

Again, it's normal. When a client connects to pgpool, pgpool connects
to PostgreSQL of course. After the client disconnects to pgpool,
pgpool keeps the connection to PostgreSQL. This is the reason why you
see lots of idle state of PostgreSQL. Next time another client
connects to pgpool, pgpool *might* reuse the connection to PostgreSQL
which avoids the connection establishing overhead of PostgreSQL. The
reason I said *might" is, the process chosen by the kernel is random
(more precisely, follows the kernel scheduler). In a long term. all
pgpool process have connections to PostgreSQL, and it is likely that a
connecting client to pgpool can use the (cached ) connection.
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