Re: [squid-users] Re: squid 3.2.0.14 with TPROXY => commBind: Cannot bind socket FD 773 to xxx.xxx.xxx.xx: (98) Address

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 10 Sep 2013 14:51:16 -0600

On 09/09/2013 04:45 AM, Nikolai Gorchilov wrote:

> Seems the issue is not TPROXY related, but kicks in always when a
> socket bind is requested to an IP (local or foreign, doesn't matter)
> without specifying a port number. In this scenario the broken logic of
> the kernel is to take the difference between max and min of
> /proc/sys/net/ipv4/ip_local_port_range and use it as a cap of the
> number of automatically assigned ports. The counter of assigned ports
> is global, not per IP, this is what creates the issue.

Hi Niki,

    We have seen similar problems with high-performance Web Polygraph
tests and added an option for Polygraph clients to explicitly manage
client port assignment instead of relying on kernel's ephemeral ports
algorithm. Polygraph code also detects runtime collisions with other
programs and moves conflicting ports into a "do not use unless
absolutely necessary" pile.

The combination of the two approaches solves the problem, provided you
have enough IP addresses to accommodate all concurrent outgoing TCP
connections (in all relevant TCP states) for your request rates.

You can add a similar feature to Squid. If your SMP workers share
outgoing IP addresses, then specifying non-overlapping worker-specific
port ranges should work without the need for synchronization among workers.

HTH,

Alex.
Received on Tue Sep 10 2013 - 20:51:25 MDT

This archive was generated by hypermail 2.2.0 : Sat Sep 14 2013 - 12:00:04 MDT