<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><br><div dir="ltr">Wysłane z iPhone'a</div><div dir="ltr"><br><blockquote type="cite">Wiadomość napisana przez Bo Peng <pengbo@sraoss.co.jp> w dniu 23.08.2022, o godz. 06:59:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Hello,</span><br><span></span><br><blockquote type="cite"><span>Hi,</span><br></blockquote><blockquote type="cite"><span>I am using pgoool version 4.2.5 and  noticed somerhing disturbing.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>pg_stat_statements showed one query in active state for long time, then I checked  network connecrions between pgpool and postgresql using netstat and connection between pgpool and frontend.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Connection between pgpool and postgresql is established but between pgpool and frontend is missed. </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>command on pgpool:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>ps aux showed IP and port of „connected„ frontend but connection in netstat is missed.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Why and what could have happened ?</span><br></blockquote><blockquote type="cite"><span>How I can diagnose that ?</span><br></blockquote><span></span><br><span>Your question is why the established connections was remained even there aren't any clients?</span><br><span>This behavior is due to connection pooling feature.</span><br><span></span><br><span>You can disable this feature using:</span><br><span></span><br><span>    connection_cache = off</span><br><span></span><br><span>-- </span><br><span>Bo Peng <pengbo@sraoss.co.jp></span><br><span>SRA OSS LLC</span><br><span>https://www.sraoss.co.jp/</span><br></div></blockquote><div><br></div> Connection cache is enabled in my configuration it’s a fact, <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); -webkit-text-size-adjust: auto;">but in my understanding, connection cache should work for connections with "idle" state with substring "DISCARD ALL" what means frontend is diskonected and pgpool cacheing this connection for some period of time (cached connection will be finished after time defined by child_life_time and I have it set to 60s).</span><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0); -webkit-text-size-adjust: auto;"><br></span></font><div><div style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">In my case connection was in "active" state for few hours, client was disconeted and pgpool kept this connection, from postgresql point of  view it was wiat_event  ClientRead.</div><div style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></div><div style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Something strange from my point of view.</div></div></div><div style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></div></body></html>