View Issue Details

IDProjectCategoryView StatusLast Update
0000502Pgpool-IIBugpublic2019-05-17 09:27
Reportersiva Assigned Topengbo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
Product Version3.7.9 
Summary0000502: Load is not working distributing properly between Master and Slave
DescriptionHi Team,

Good After Noon,

This is regarding to the load balancing functionality of pool 3.7.9.

we have master , one slave pgpool and master and one slave DB servers. we have load distribution as 1:1 between the master and slave DB servers, but the actual load distribution is very abnormal, most of the load is going to master and very few queries are routing to the slave .

Please find the configuration details:

Configuration :
DB servers: 172.16.251.26(DB Master) , 172.16.251.27(DB Slave)
pool server: 172.16.251.25(Master),172.16.251.26(Slave) , VIP 172.16.251.128

[root@s2n pgpool-II]# hostname -I
172.16.251.25 172.16.251.128

[root@s2n pgpool-II]# psql -h 172.16.251.128 -p 9999 -U pgpool postgres -c "show pool_nodes"
 node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------
 0 | 172.16.251.26 | 5432 | up | 0.500000 | primary | 242 | false | 0
 1 | 172.16.251.27 | 5432 | up | 0.500000 | standby | 4 | true | 0
(2 rows)

[root@INHUSZ1-V1625126 pgpool-II]# hostname -I
172.16.251.26 192.168.122.1

[root@INHUSZ1-V1625126 pgpool-II]# psql -h 172.16.251.128 -p 9999 -U pgpool postgres -c "show pool_nodes"
 node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------
 0 | 172.16.251.26 | 5432 | up | 0.500000 | primary | 242 | true | 0
 1 | 172.16.251.27 | 5432 | up | 0.500000 | standby | 4 | false | 0
(2 rows)

Master pool Config File settings for backends:

# - Backend Connection Settings -

backend_hostname0 = '172.16.251.26'
                                   # Host name or IP address to connect to for backend 0
backend_port0 = 5432
                                   # Port number for backend 0
backend_weight0 = 1
                                   # Weight for backend 0 (only in load balancing mode)
backend_data_directory0 = '/var/lib/pgsql/data'
                                   # Data directory for backend 0
backend_flag0 = 'ALLOW_TO_FAILOVER'
                                   # Controls various backend behavior
                                   # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER
                                   # or ALWAYS_MASTER
backend_hostname1 = '172.16.251.27'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'

On Slave pgpool server:

# - Backend Connection Settings -

backend_hostname0 = '172.16.251.26'
                                   # Host name or IP address to connect to for backend 0
backend_port0 = 5432
                                   # Port number for backend 0
backend_weight0 = 1
                                   # Weight for backend 0 (only in load balancing mode)
backend_data_directory0 = '/var/lib/pgsql/data'
                                   # Data directory for backend 0
backend_flag0 = 'ALLOW_TO_FAILOVER'
                                   # Controls various backend behavior
                                   # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER
                                   # or ALWAYS_MASTER
backend_hostname1 = '172.16.251.27'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'

Please suggest us, how to make distribute the equally between the master and slave.

Thanks a lot for your support and much appreciate for your help.
TagsNo tags attached.

Activities

pengbo

2019-04-25 14:49

developer   ~0002575

Pgpool-II load balancing decides the load balancing node at the session start time and the selected load balancing node will not be changed until the session end.
So, if you are using the same session, during this session the select query will be sent to the same node.

BTW, here is a bug reporting system. If you want to ask questions, please send email to pgpool-general@pgpool.net.
Before sending email, you need to subscribe from the URL below.
https://www.pgpool.net/mailman/listinfo/pgpool-general

Issue History

Date Modified Username Field Change
2019-04-25 13:46 siva New Issue
2019-04-25 14:49 pengbo Note Added: 0002575
2019-05-07 08:46 administrator Assigned To => pengbo
2019-05-07 08:46 administrator Status new => feedback
2019-05-17 09:27 administrator Status feedback => closed