[pgpool-general: 4124] LB + streaming replication. Doubling connections to backend

Pedro Roger progerjkd at gmail.com
Mon Oct 19 05:12:12 JST 2015


Hello all!


I have a pgpool setup in load balancing + streaming replication modes with
4 PostgreSQL nodes.


Every single connection arriving at pgpool generates 4 conections to the
backends. Is that correct?

I gues that at maximum two connections should be opened (if necessary), one
to the read-write node, and another to a read-only node.

In my benchmarks, a workload with 100 concurrent connections to pgpool,
generates 400 connections to backends (100 connections to each one).

Any idea on this?

Thanks in advance.



A slice of my pgpool.conf:


num_init_children = 895
                                   # Number of pools
                                   # (change requires restart)
max_pool = 2
                                   # Number of connections per pool
                                   # (change requires restart)


child_life_time = 300
                                   # Pool exits after being idle for this
many seconds
child_max_connections = 0
                                   # Pool exits after receiving that many
connections
                                   # 0 means no exit
connection_life_time = 20
                                   # Connection to backend closes after
being idle for this many seconds
                                   # 0 means no close
client_idle_limit = 0
                                   # Client is disconnected after being
idle for that many seconds
                                   # (even inside an explicit transactions!)
                                   # 0 means no disconnection
connection_cache = on
                                   # Activate connection pools
                                   # (change requires restart)

                                   # Semicolon separated list of queries
                                   # to be issued at the end of a session
                                   # The default is for 8.3 and later
reset_query_list = 'ABORT; DISCARD ALL'
                                   # The following one is for 8.2 and before



replication_mode = off
                                   # Activate replication mode
                                   # (change requires restart)
replicate_select = off
                                   # Replicate SELECT statements
                                   # when in replication or parallel mode
                                   # replicate_select is higher priority
than
                                   # load_balance_mode.
load_balance_mode = on
                                   # Activate load balancing mode
                                   # (change requires restart)
ignore_leading_white_space = on
                                   # Ignore leading white spaces of each
query
white_function_list = ''
                                   # Comma separated list of function names
                                   # that don't write to database
                                   # Regexp are accepted
black_function_list = 'currval,lastval,nextval,setval'
                                   # Comma separated list of function names
                                   # that write to database
                                   # Regexp are accepted



master_slave_mode = on
                                   # Activate master/slave mode
                                   # (change requires restart)
master_slave_sub_mode = 'stream'
                                   # Master/slave sub mode

master_slave_sub_mode = 'stream'
                                   # Master/slave sub mode
                                   # Valid values are combinations slony or
                                   # stream. Default is slony.
                                   # (change requires restart)
parallel_mode = off
                                   # Activates parallel query mode
                                   # (change requires restart)
enable_query_cache = off
                                   # Activates query cache
                                   # (change requires restart)
backend_hostname0 = '200.129.20.31'
backend_port0 = 5432
backend_weight0 = 0
backend_data_directory0 = '/var/lib/postgresql/9.1/main/'
backend_flag0= 'DISALLOW_TO_FAILOVER'
backend_hostname1 = '200.129.20.34'
backend_port1 = 5432
backend_weight1 = 0
backend_data_directory1 = '/var/lib/postgresql/9.1/main/'
backend_flag1= 'DISALLOW_TO_FAILOVER'
backend_hostname2 = '200.129.20.22'
backend_port2 = 5432
backend_weight2 = 0
backend_data_directory2 = ''
backend_flag2= 'ALLOW_TO_FAILOVER'
backend_hostname3 = '200.129.20.24'
backend_port3 = 5432
backend_weight3 = 1
backend_data_directory3 = ''
backend_flag3= 'ALLOW_TO_FAILOVER'

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Pedro Roger Magalhães Vasconcelos
http://www.proger.eti.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20151018/11c9f219/attachment.html>


More information about the pgpool-general mailing list