<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">pg_syn_count</span>, i use it in connect_inet_domain_socket_by_port.<br></div><div><br></div><div><span style="text-align:justify">In linux default setting is 5 (cat /proc/sys/net/ipv4/tcp_syn_retries), which would lead to an aproximate of </span><font color="#333333" face="Lucida Grande, Helvetica, Arial, Verdana, sans-serif" style="text-align:justify"><span style="font-size:12px;line-height:18px">20</span></font><span style="text-align:justify"> seconds delay before the connection times out. 20 second is very much for web.</span><br>
</div><div class="gmail_extra"><div style="text-align:justify"><br></div><div style="text-align:justify">new diff pool_connection_pool.c see in attache (use code src/backend/libpq/pqcomm.c)</div><div style="text-align:justify">
<br></div><br><div class="gmail_quote">2013/11/14 Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span><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">
Thanks for the patch!<br>
<div class="im"><br>
> Code to allow tcp keepalive connection. It helps to define dead postgres<br>
> connections.<br>
><br>
> based on ticket #83<br>
><br>
> Recommended params for web server<br>
><br>
> pg_keepalives_idle = 10 # TCP_KEEPIDLE, in seconds;<br>
> pg_keepalives_interval = 3 # TCP_KEEPINTVL, in seconds;<br>
> pg_keepalives_count = 5 # TCP_KEEPCNT;<br>
<br>
</div>You need to check the existence of TCP_KEEPALIVE and<br>
SIO_KEEPALIVE_VALS in configure. See PostgreSQL's source code<br>
(src/backend/libpq/pqcomm.c etc.)<br>
<div class="im"><br>
> pg_syn_count = 3 # TCP_SYNCNT<br>
><br>
><br>
> TCP_SYNCNT work on linux?<br>
<br>
</div>Don't know. Anyway pg_syn_count is not used anywhere else in your<br>
patch. Is it intended?<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div><br></div></div>