<div dir="ltr">
<p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">Hi,</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">Does anyone have recommendations on scaling concurrent connections through the squid proxy to above the ephemeral port range?<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">I have squid v5.5 on Ubuntu with about 48K ephemeral ports available with the ip_local_port_range. The squid is bound to listen on port 3128 and has a single tcp_outgoing_address configured. We notice that after about 40-45k concurrent connections through the proxy it is unable to reuse ports and it severely limits local ports available to other applications running on the system. The squid is setup to run 30 workers; total CPU is still under 10% during peak connection rates.<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">Is any build config flag required to enable SO_REUSEPORT or SO_REUSEADDR on the outbound TCP sessions opened by squid?<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">It does not appear that there is an option to use the IP_BIND_ADDRESS_NO_PORT sockopt flag which can help with ephemeral port reuse.</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">We have tried enabling tcp_tw_reuse, ip_autobind_reuse and ip_nonlocal_bind flags, but unable to get the system reuse the ephemeral ports. The fs.file-max is set to 4M. Pasted some errors below. Any suggestions are appreciated!</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px">Thanks</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px">Praveen</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">2022/05/19 23:35:00 kid12| commBind Cannot bind socket FD 3075 to <<i>IP</i>>: (99) Cannot assign requested address</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue""><span class="gmail-Apple-converted-space"> </span>current master transaction: master48536607</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">2022/05/19 23:35:00 kid23| commBind Cannot bind socket FD 1320 to <<i>IP</i>>: (99) Cannot assign requested address</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue""><span class="gmail-Apple-converted-space"> </span>current master transaction: master26662366</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">2022/05/19 23:37:30 kid13| commBind Cannot bind socket FD 3346 to <<i>IP</i>>: (98) Address already in use</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue""><span class="gmail-Apple-converted-space"> </span>current master transaction: master11976056</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">2022/05/19 23:37:30 kid12| commBind Cannot bind socket FD 6459 to <<i>IP</i>>: (98) Address already in use</p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue""><span class="gmail-Apple-converted-space"> </span>current master transaction: master48561031</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font:13px "Helvetica Neue"">While the system is in this state, local curl’s to another endpoint on the same node are not able to obtain a TCP socket.</p><p class="gmail-p2" style="margin:0px;font:13px "Helvetica Neue";min-height:15px"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">
</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">curl: (7) Couldn't connect to server</p></div>