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: Nikolai Gorchilov <niki_at_x3me.net>
Date: Sat, 14 Sep 2013 19:49:39 +0300

On Tue, Sep 10, 2013 at 11:51 PM, Alex Rousskov
<rousskov_at_measurement-factory.com> wrote:
> 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.

Thanks for the valuable advice.

In our scenario it's much easier, because we use TPROXY. How many
ports per IP will be known to the kernel of our proxy? 10-20-50-100
(the number of http connections of this user). There are 665535 ports
available, so random port selection will hit existing port in use
very, very rarely. Say once on 600 binds. On EADDRINUSE you just retry
with another port (say, previous port plus 1) until you stop getting
EADDRINUSE.

Niki
Received on Sat Sep 14 2013 - 16:50:26 MDT

This archive was generated by hypermail 2.2.0 : Sun Sep 15 2013 - 12:00:04 MDT