<div dir="auto">Thanks for the reply.<div dir="auto">I did more tests (stop pgpool on master node) capturing the traffic at server side, but even from this point of view some of the established connections didn&#39;t receive a fin packet from the server to close the connection.</div><div dir="auto">Anyway I&#39;m quite satisfied handling this situation (dead established connections at client side) using the keepalive parameters in the connection string to pgpool.</div><div dir="auto">By,</div><div dir="auto">luca</div></div><br><div class="gmail_quote"><div dir="ltr">Il gio 2 ago 2018, 07:18 Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; Hi to all,<br>
&gt; this is my frist email to this ml, and I would like to thanks all the<br>
&gt; community working around the pgpool project.<br>
&gt; <br>
&gt; My current configuration is the following:<br>
&gt; 2 servers both with pgpool 3.7.3 and postgresql 9.4.18 with bdr support and<br>
&gt; watchdog enabled.<br>
&gt; <br>
&gt; Both pgpool and postgers are compiled from source code.<br>
&gt; <br>
&gt; Here below the relevant (I hope) configuration settings for pgpool:<br>
&gt; <br>
&gt; port = 5433<br>
&gt; listen_backlog_multiplier = 2<br>
&gt; serialize_accept = off<br>
&gt; <br>
&gt; num_init_children = 500<br>
&gt; max_pool = 1<br>
&gt; child_life_time = 300<br>
&gt; child_max_connections = 0<br>
&gt; connection_life_time = 0<br>
&gt; client_idle_limit = 0<br>
&gt; <br>
&gt; load_balancing=on<br>
&gt; master_slave_mode = on<br>
&gt; master_slave_sub_mode = &#39;logical&#39;<br>
&gt; <br>
&gt; use_watchdog = on<br>
&gt; <br>
&gt; In my current environment there are 6 clients and each of them establish<br>
&gt; around 55-65 connections each. When all clients are running around 350<br>
&gt; backend connections are established against the pgpool node where the VIP<br>
&gt; is exposed.<br>
&gt; <br>
&gt; When the total amount of connections is around 350 the problem I&#39;m<br>
&gt; experiencing is the following : issuing as root a pgpool -m fast stop<br>
&gt; command on the master pgpool, quite frequently, not all the connections<br>
&gt; previously established by the client to the VIP are closed at the client<br>
&gt; side.<br>
&gt; <br>
&gt; Issuing, as root, a netstat -antpd | grep 5433 on the client that has not<br>
&gt; closed all connections, I can still see some connections in ESTABLISHED<br>
&gt; state; obviously these connections are the ones the client had established<br>
&gt; to the previous pgpool master.<br>
&gt; <br>
&gt; I&#39;ve even run a tcpdump capture at the client side to check if a fin packet<br>
&gt; was sent by the old pgpool master (the one holding the VIP) for all the<br>
&gt; connections, but I got evidence, at least from those captures, that not all<br>
&gt; connections,at client side, received a fin packet from server.<br>
&gt; <br>
&gt; Currently we handled this issue configuring in the connection string of our<br>
&gt; client the tcp_keepalives parameters (interval=5, count=2, idle=20).<br>
&gt; I was wondering if the lack of fin packet is dued to a bug or it could be<br>
&gt; normal while stopping pgpool in fast mode.<br>
&gt; <br>
&gt; Regards,<br>
&gt; luca<br>
<br>
In my understanding when Pgpool-II server exits by &quot;pgpool -m fast<br>
stop&quot;, close(2) is automatically done by the kernel and FIN packet<br>
will be send out if the pgpool process has a socket to frontend. In<br>
another word, Pgpool-II doesn&#39;t need to do anything than call exit(3).<br>
<br>
As far as I know, PostgreSQL behaves like this when they exit.<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div>