View Issue Details

IDProjectCategoryView StatusLast Update
0000521Pgpool-IIEnhancementpublic2019-06-18 12:20
ReporterdruidccsosAssigned Topengbo 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionopen 
Platformaws ec2 instanceOSubuntuOS VersionUbuntu 16.04.6 L
Product Version4.0.2 
Target VersionFixed in Version 
Summary0000521: In streaming replication mode, load balancing mode on, load balancing happens only for executing queries not for db connections.
DescriptionMy use case is that I have two read replicas. The settings between master db and replicas are done in aws rds. I would like to use pgpool-2 to do connection pooling and load balancing. I notice that whenever a db connection request made to pgpool, pgpool always open a connection on both replicas. E.g. if I test with `pgbench -c 20 -t 1000`, pgpool will open 20 connections on replica1 and 20 connection connections on replica2. May I know if there is a way to split the 20 connections evenly to both replicas, e.g. open 10 connections to replica1 and 10 connections to replica2.

My pgpool.conf followed pgpool.conf.sample-stream.
Thank you very much for you time.
Tagsconnection splitting, load balancing, replication

Activities

pengbo

2019-06-14 10:10

developer   ~0002655

It is normal behavior when you use load balancing.
Because Pgpool-II sends WRITE query to primary and READ query to standby, Pgpool-II need to open connections to both of master db and replica db.

Did you setup the cluster including Pgpool-II and 3 DB nodes(1 master, 2 replicas)?
Or you setup the cluster only including Pgpool-II and 2 replicas?

druidccsos

2019-06-14 11:42

reporter   ~0002656

Hi @pengbo, thank you so much for replying. My existing setup includes only two ec2 instances running Pgpool and 2 rds db replicas. The master db is not included. Also I have some logic to make sure only read query can go to pgpool.

druidccsos

2019-06-14 12:10

reporter   ~0002657

May I know if we have any setting in pgpool.conf that I can twist, to kind of splitting / load balance the connections to the 2 replicas, e.g. when there are 20 connection request comes to pgpool, pgpool will open 10 connections to replica1 and 10 to the other replica. Thanks

pengbo

2019-06-17 14:18

developer   ~0002658

> May I know if we have any setting in pgpool.conf that I can twist, to kind of splitting / load balance the connections to the 2 replicas, e.g. when there are 20 connection request comes to > pgpool, pgpool will open 10 connections to replica1 and 10 to the other replica. Thanks

Pgpool-II opens connections to all backend nodes. The connection target node can not be configured.

druidccsos

2019-06-17 14:19

reporter   ~0002659

Got it, thank you @pengbo.

pengbo

2019-06-17 22:14

developer   ~0002660

Could you mark this issue status as "resolved"?

druidccsos

2019-06-18 11:23

reporter   ~0002662

Hi, may I know how to change the status to 'resolved'? I don't see any edit or control panel. Thanks.

pengbo

2019-06-18 12:19

developer   ~0002663

Edit -> Status -> Resolved.

I will mark this as "Resolved".

Issue History

Date Modified Username Field Change
2019-06-13 18:53 druidccsos New Issue
2019-06-13 18:54 druidccsos Tag Attached: load balancing
2019-06-13 18:54 druidccsos Tag Attached: replication
2019-06-13 18:54 druidccsos Tag Attached: connection splitting
2019-06-14 10:00 pengbo Assigned To => pengbo
2019-06-14 10:00 pengbo Status new => assigned
2019-06-14 10:10 pengbo Note Added: 0002655
2019-06-14 10:10 pengbo Status assigned => feedback
2019-06-14 11:42 druidccsos Note Added: 0002656
2019-06-14 11:42 druidccsos Status feedback => assigned
2019-06-14 12:10 druidccsos Note Added: 0002657
2019-06-17 14:18 pengbo Note Added: 0002658
2019-06-17 14:19 pengbo Status assigned => feedback
2019-06-17 14:19 druidccsos Note Added: 0002659
2019-06-17 14:19 druidccsos Status feedback => assigned
2019-06-17 22:14 pengbo Note Added: 0002660
2019-06-18 11:23 druidccsos Note Added: 0002662
2019-06-18 12:19 pengbo Note Added: 0002663
2019-06-18 12:20 pengbo Status assigned => resolved