Re: pgpool Connections Distributions Among Nodes - Mailing list pgsql-general

From Tatsuo Ishii
Subject Re: pgpool Connections Distributions Among Nodes
Date
Msg-id 20180130.074630.2078004443171957980.t-ishii@sraoss.co.jp
Whole thread Raw
In response to pgpool Connections Distributions Among Nodes  ("Kumar, Virendra" <Virendra.Kumar@guycarp.com>)
List pgsql-general
> We have 4-node cluster (1 master and 3 hot standby).  We are using pgpool as load balancer. We have an observation
whereif application requests for 3 connections, pgpool connects to all 4 servers and I see 3 connections on each of
them.I was expecting it have a total of 3 connections from either of 4 servers but I can easily see 12 connections in
all.

Yes, that's an expected behavior.

Why?

When client A connects to pgpool, it connects to all PostgreSQL (a, b,
c, d). But actually pgpool sends query to one of them (in case load
balance node is primary) or two of them (in case load balance node is
not primary). Suppose it sends to a and b. Client A logs off, but
connections to a and b remain because of connection pooling. Client B
comes in. B uses c and d. The connections to c and d remain.

So eventually pgpool needs to connect to all backend anyway.

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


pgsql-general by date:

Previous
From: Ibrahim Edib Kokdemir
Date:
Subject: best way to storing logs
Next
From: Jan De Moerloose
Date:
Subject: Meaning of query age in pg_stat_activity