<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 25, 2016 at 7:18 AM, Brandon Ridler <span dir="ltr">&lt;<a href="mailto:brandonr@motiga.com" target="_blank">brandonr@motiga.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I&#39;ve scoured the site and the interwebs with out being able to find information in regards to what I&#39;m seeing and am hoping I can be pointed in the right direction, or given an explanation as to why it appears every connection to pgpool is resulting in a connection to every backend I have.  My general setup when compared to a default is:<br></div><div><br></div><div>1.  I have 3 backends, all weight 1.</div><div>2.  I have master/slave mode enabled with stream.</div><div>3.  I have load_balancing on.</div><div>4.  I have connection_cache off.</div><div>5.  I have connection_life_time set to 60.</div><div>6.  I have watchdog enabled and configured.</div><div><br></div><div>I&#39;m using 3.5.0 pgpool2 running on an ubuntu 14.0.4 inside a docker container.  I also tried 3.3.2 from the ubuntu apt repos.</div><div><br></div><div>It doesn&#39;t matter if it&#39;s our custom app, an established app like ejabberd, or me using psql to connect to it, it will always make connections to all backends listed.  I&#39;d like to know if that is expected behavior but haven&#39;t found anything in the docs to confirm or deny this other than a reference to when your making transactions.</div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Assuming the above is correct, I tried to use the connection_life_time value.  Thinking that if the front-end connection to pgpool is idle, and thus the backend is idle, that at least pgpool would close the backend and re-establish it if anything came down from the apps.</div></div></blockquote><div><br></div><div><div>Yes It is expected by pgpool-II to make connections with all configured backend nodes And for the second part, the connection_life_time only disconnects the idle cached backend connections. While the backend connection which is in use by the front-end even if the front-end is idle is not considered as idle by pgpool-II. To disconnect the idle frontend connections you can set the client_idle_limit config parameter.</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Can you please let me know if I&#39;m misunderstanding the intent of pgpool here or if there&#39;s a configuration that I may be overlooking.  I thought when I originally set up pgpool a month ago that I saw like 300 connection to pgpool and only 50-60 connections to each of the backends.</div></div></blockquote><div><br></div><div style=""><font color="#000000" face="sans-serif"><span style="line-height:19.2px">When the connection cache is enabled on pgpool-II, then pgpool-II does not close the backend connection even when the client application disconnects. Each connection is identified by database_name and user_name values of the connection, So when the client connection request arrives to the pgpool-II child and that child already have a cached connection with the same credentials(same database_name and user_name pair), then no new backed connection is opened by the pgpool-II while pgpool-II hooks the incoming client connection with that already cached backend connection. Only when the database_name and user_name pair of incoming client connection does not exist in the connection cache pgpool-II opens a new backend connection.</span></font></div><div style=""><font color="#000000" face="sans-serif"><span style="line-height:19.2px">The number of backend connection cached by a pgpool-II child can be configured by the <i>max_pool</i> config paramete. And theoretically PostgreSQL server can have up to  (max_pool*num_init_children) opened connection when the connection cache is enabled, even when no client is connected to pgpool-II</span></font><br></div><div style=""><font color="#000000" face="sans-serif"><span style="font-size:12.8px;line-height:19.2px"><br></span></font></div><div style=""><font color="#000000" face="sans-serif"><span style="font-size:12.8px;line-height:19.2px">Regards</span></font></div><div style=""><font color="#000000" face="sans-serif"><span style="font-size:12.8px;line-height:19.2px">Muhammad Usama</span></font></div><div style="font-size:12.8px"><span style="font-size:small"> </span><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Regards,</div><div>Brandon</div></div>
<br>_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
<br></blockquote></div><br></div></div>