<div dir="ltr"><div><div><div><div><div><div><div>Hello all!<br><br><br></div>I have a pgpool setup in load balancing + streaming replication modes with 4 PostgreSQL nodes.<br><br><br></div>Every single connection arriving at pgpool generates 4 conections to the backends. Is that correct?<br><br></div>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.<br><br></div>In my benchmarks, a workload with 100 concurrent connections to pgpool, generates 400 connections to backends (100 connections to each one).<br><br></div>Any idea on this?<br><br></div>Thanks in advance.<br><br></div><br><br>A slice of my pgpool.conf:<br><br><br>num_init_children = 895<br>                                   # Number of pools<br>                                   # (change requires restart)<br>max_pool = 2<br>                                   # Number of connections per pool<br>                                   # (change requires restart)<br><br><br>child_life_time = 300<br>                                   # Pool exits after being idle for this many seconds<br>child_max_connections = 0<br>                                   # Pool exits after receiving that many connections<br>                                   # 0 means no exit<br>connection_life_time = 20<br>                                   # Connection to backend closes after being idle for this many seconds<br>                                   # 0 means no close<br>client_idle_limit = 0<br>                                   # Client is disconnected after being idle for that many seconds<br>                                   # (even inside an explicit transactions!)<br>                                   # 0 means no disconnection<br>connection_cache = on<br>                                   # Activate connection pools<br>                                   # (change requires restart)<br><br>                                   # Semicolon separated list of queries<br>                                   # to be issued at the end of a session<br>                                   # The default is for 8.3 and later<br>reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>                                   # The following one is for 8.2 and before<br><br><br><br>replication_mode = off            <br>                                   # Activate replication mode<br>                                   # (change requires restart)<br>replicate_select = off            <br>                                   # Replicate SELECT statements<br>                                   # when in replication or parallel mode<br>                                   # replicate_select is higher priority than<br>                                   # load_balance_mode.<br>load_balance_mode = on<br>                                   # Activate load balancing mode<br>                                   # (change requires restart)<br>ignore_leading_white_space = on   <br>                                   # Ignore leading white spaces of each query<br>white_function_list = &#39;&#39;<br>                                   # Comma separated list of function names<br>                                   # that don&#39;t write to database<br>                                   # Regexp are accepted<br>black_function_list = &#39;currval,lastval,nextval,setval&#39;<br>                                   # Comma separated list of function names<br>                                   # that write to database<br>                                   # Regexp are accepted<br><br><br><br>master_slave_mode = on            <br>                                   # Activate master/slave mode<br>                                   # (change requires restart)<br>master_slave_sub_mode = &#39;stream&#39;  <br>                                   # Master/slave sub mode<br><br clear="all"><div><div><div><div><div><div><div><div><div><div>master_slave_sub_mode = &#39;stream&#39;<br>                                   # Master/slave sub mode<br>                                   # Valid values are combinations slony or<br>                                   # stream. Default is slony.<br>                                   # (change requires restart)<br>parallel_mode = off<br>                                   # Activates parallel query mode<br>                                   # (change requires restart)<br>enable_query_cache = off<br>                                   # Activates query cache<br>                                   # (change requires restart)<br>backend_hostname0 = &#39;200.129.20.31&#39;<br>backend_port0 = 5432<br>backend_weight0 = 0<br>backend_data_directory0 = &#39;/var/lib/postgresql/9.1/main/&#39;<br>backend_flag0= &#39;DISALLOW_TO_FAILOVER&#39;<br>backend_hostname1 = &#39;200.129.20.34&#39;<br>backend_port1 = 5432<br>backend_weight1 = 0<br>backend_data_directory1 = &#39;/var/lib/postgresql/9.1/main/&#39;<br>backend_flag1= &#39;DISALLOW_TO_FAILOVER&#39;<br>backend_hostname2 = &#39;200.129.20.22&#39;<br>backend_port2 = 5432<br>backend_weight2 = 0<br>backend_data_directory2 = &#39;&#39;<br>backend_flag2= &#39;ALLOW_TO_FAILOVER&#39;<br>backend_hostname3 = &#39;200.129.20.24&#39;<br>backend_port3 = 5432<br>backend_weight3 = 1<br>backend_data_directory3 = &#39;&#39;<br>backend_flag3= &#39;ALLOW_TO_FAILOVER&#39;<br><br>-- <br><div class="gmail_signature"><div dir="ltr">-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>Pedro Roger Magalhães Vasconcelos<br><a href="http://www.proger.eti.br" target="_blank">http://www.proger.eti.br</a></div></div>
</div></div></div></div></div></div></div></div></div></div></div>