<div dir="ltr">I was reading all the available information:<div><br></div><div>***********************</div><div>-&gt; <a href="http://www.pgpool.net/mediawiki/index.php/Relationship_between_max_pool,_num_init_children,_and_max_connections">http://www.pgpool.net/mediawiki/index.php/Relationship_between_max_pool,_num_init_children,_and_max_connections</a></div><div><br></div><div> -&gt; <a href="http://www.sraoss.jp/pipermail/pgpool-general/2012-January/000186.html">http://www.sraoss.jp/pipermail/pgpool-general/2012-January/000186.html</a> <div><br></div><div>-&gt; <a href="https://groups.google.com/forum/#!topic/pgsql.general/7ghmD-YAlqc">https://groups.google.com/forum/#!topic/pgsql.general/7ghmD-YAlqc</a> <div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02832.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02832.html</a> <div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg01961.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg01961.html</a> </div><div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg00263.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg00263.html</a> </div><div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02093.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02093.html</a> </div><div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02524.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg02524.html</a> </div><div><br></div><div>-&gt; <a href="https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg00237.html">https://www.mail-archive.com/pgpool-general%40pgfoundry.org/msg00237.html</a></div></div></div></div><div><br></div><div>***********************</div><div><br></div><div>My question regards &quot;<span style="font-size:12.8px">What I don&#39;t have clear is if the pair {num_init_children, max_pool} is applied as a whole to all the Postgres server behind of pgpool (i.e. host_1, host_2 and host_3), or it is applied to each Postgres server behind of pgpool. Then in the last case, I will need to set &quot;num_init_children&quot; = 30 and &quot;max_pool&quot; =1</span>&quot; it is coming from reading the post <a href="http://www.sraoss.jp/pipermail/pgpool-general/2012-January/000186.html">http://www.sraoss.jp/pipermail/pgpool-general/2012-January/000186.html</a> , it says the following:</div><div><br></div><div>&quot;But with pgpool it gives the same error. I was under the impression that since for read there are two servers, the number of connections available would be doubled. The observation I made is that moment connections are sent via pgpool, the same number of connections are created on the master as well as the slave instantaneously. So that when the max connections were used  it actual opened up all of them in both the servers and hence met the same limit. Is this expected behavior or I have messed up on the configuration.  ---&gt; Yes, if you connect to pgpool with 200 connections, pgoool tries to connect to PostgreSQL servers 200 connections *each*. So if max_connections of PostgreSQL is lower than 200, you&#39;ll get the error message.&quot;</div><div><br></div><div>From this, it appear that the configuration {num_init_children, max_pool} is applied to each backend (<a href="http://i.e.in">i.e.in</a> my case to each physical host). In this case if I set {num_init_children=30, max_pool=1}, then in fact I will have 90 concurrent connections, 30 to the host_1, 30 to the host_2 and 30 to the host_3</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 12:55 PM, Hu Veja <span dir="ltr">&lt;<a href="mailto:huveja@gmail.com" target="_blank">huveja@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I&#39;ve the following scenario:</div><div><br></div><div>Master is running in a physical host_1 and two readable Slaves are running in the physical host_2 and host_3 respectively. The scenario is configured with Asynchronous streaming replication using a Physical Replication Slot.</div><div><br></div><div>I&#39;m trying to have the following:</div><div><br></div><div>(a) Be able to serve 12 concurrent connections in host_1 (i.e. Master). It is because that is approximately the number of concurrent writes that I have. The server has 6 cores and 2 SDDs.</div><div><br></div><div>(b) Be able to serve 30 concurrent connections in host_2 and host_3 (i.e. 30 in each host). I&#39;ve around 60 concurrent reads, and each server is having 12 cores and 2 SDDs.</div><div><br></div><div>The questions I have are the following:</div><div><br></div><div>**************</div><div>1. In order to try to redirect most of the reads to host_2 and host_3, I have set &quot;weight&quot; for host_1 to 1, &quot;weight&quot; for host_2 to 2 and &quot;weight&quot; for host_3 to 2.  Is it OK?</div><div><br></div><div>**************<br></div><div>2. How do I need to configure &quot;max_pool&quot; and &quot;num_init_children&quot; in order to have (a) and (b)?</div><div><br></div><div>I suppose that the needed configuration is &quot;num_init_children&quot; = 75 (12 + 30 + 30), and &quot;max_pool&quot; =1 (because the application is using 1 user -db_usr- and it is connecting to the same database -my_db-).</div><div><br></div><div>What I don&#39;t have clear is if the pair {num_init_children, max_pool} is applied as a whole to all the Postgres server behind of pgpool (i.e. host_1, host_2 and host_3), or it is applied to each Postgres server behind of pgpool. Then in the last case, I will need to set &quot;num_init_children&quot; = 30 and &quot;max_pool&quot; =1.<br></div><div>**************<br></div><div><br></div><div>Thanks in advance!</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
</blockquote></div><br></div>