<div dir="ltr">Hi Team,<div><br></div><div>Thank you for the response. It was a mistake from our end, we had set jdbc url as (pgpool_ip,master_ip,slavei_p) so if pgpool and master goes down, it will start sending data to slave_ip. </div><div>This leads to problems in load balancing.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 20, 2020 at 5:50 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt;  - I tried this option to stop and start pgpool but this affects load<br>
&gt; balancing. We I use systemctl to stop and start pgpool, then write<br>
&gt; statements are sent to primary only but when I use stopping and starting<br>
&gt; with &quot;pgpool stop -mf&quot; and &quot;pgpool -f pgpool.conf -D&quot; respectively, pgpool<br>
&gt; doesn&#39;t recognize write and sends to standby, this is resolved only after<br>
&gt; restarting the application<br>
<br>
I am confused. How did you do when you say &quot;I tried this option to<br>
stop and start pgpool&quot;? Pgpool&#39;s stop option is nothing related to<br>
load balance.<br>
<br>
Anyway I suspect there&#39;s something wrong with the systemd setting for<br>
pgpool. Can you share /etc/sysconfig/pgpool?<br>
<br>
&gt; Because systemd kill -9 pgpool to not give a chance to remove the socket<br>
&gt; files.<br>
&gt; - This should not be the case right, because in production there will be<br>
&gt; connections all the time and after using systemctl these files should be<br>
&gt; removed<br>
<br>
You can configure systemctl&#39;s parmeter for pgpool to shut down pgpool<br>
properly even if there are connections from clients. That&#39;s why I am<br>
asking /etc/sysconfig/pgpool.<br>
<br>
&gt; Thanks and Regards,<br>
&gt; Nikhil<br>
&gt; <br>
&gt; <br>
&gt; On Fri, Jul 17, 2020 at 3:49 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt; <br>
&gt;&gt; First of all, you are asking questions about propriety<br>
&gt;&gt; packages. Please ask questions regarding propriety products to the<br>
&gt;&gt; vendor.<br>
&gt;&gt;<br>
&gt;&gt; &gt; Hi Team,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am testing pgpool for my workload.We have three nodes of pgpool used<br>
&gt;&gt; as a<br>
&gt;&gt; &gt; load balancer and connection pooler across three nodes of database<br>
&gt;&gt; servers.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; All application connections to the database are through the pgpool.<br>
&gt;&gt; Without<br>
&gt;&gt; &gt; stopping the application, if we want to stop the pgpool using &quot;systemctl<br>
&gt;&gt; &gt; stop edb-pgpool-4.0&quot; then it takes a long time because connections are<br>
&gt;&gt; &gt; still coming to the pgpool. Pgpool is stopped only after no new<br>
&gt;&gt; connections<br>
&gt;&gt; &gt; appear + existing connections are terminated.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Even after Pgpool is stopped, I can see that files(.s.PGSQL.9898 and<br>
&gt;&gt; &gt; .s.PGSQL.9999) under socket_dir which in our case is /tmp are not<br>
&gt;&gt; removed.<br>
&gt;&gt; &gt; This does not allow the pgpool to start using  &quot;systemctl start<br>
&gt;&gt; &gt; edb-pgpool-4.0&quot;. We have to manually remove the files under /tmp and then<br>
&gt;&gt; &gt; start pgpool.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have two questions:<br>
&gt;&gt; &gt; 1. Before stopping pgpool, how can we prevent new connections from coming<br>
&gt;&gt; &gt; into pgpool without stopping the application and terminate the<br>
&gt;&gt; &gt; existing connections so that the stop command does not wait.<br>
&gt;&gt;<br>
&gt;&gt; As other people already pointed out, there&#39;s an option to stop pgpool<br>
&gt;&gt; without waiting for clients disconnected to pgpool. Probably you can<br>
&gt;&gt; set the option to tweak systemectl related files. The way to do it<br>
&gt;&gt; depends how the package is created, which we don&#39;t know. If you are<br>
&gt;&gt; not sure, ask the vendor.<br>
&gt;&gt;<br>
&gt;&gt; &gt; 2. After stopping pgpool, why are files under /tmp not removed?<br>
&gt;&gt;<br>
&gt;&gt; Because systemd kill -9 pgpool to not give a chance to remove the<br>
&gt;&gt; socket files.<br>
&gt;&gt;<br>
&gt;&gt; &gt; PS:Files are removed from /tmp if there are no connections via<br>
&gt;&gt; pgpool(this<br>
&gt;&gt; &gt; will never be the case in production environment)<br>
&gt;&gt;<br>
&gt;&gt; Because if there&#39;s no connection from clients, pgpool can remove the<br>
&gt;&gt; socket files before systemd kills pgpool.<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
</blockquote></div>