On Fri, Jun 04, 2010 at 09:35:54AM +0100, Laurie Young wrote: > Hi, That is useful to know > > Specifically I'm looking to use HAProxy in front of a cluster of backend > servers, with lots of long running connections. > > I keep hearing references on Linux to 65K max sockets, implying about 30k > max connections (2 sockets per connection - one in and one out?). This is > not going to be enough for us :( > > But I'm struggling to find out if this 65k thing is a fact or a myth. I > found some references suggesting it was per process not per host.
This is a pure myth based on the fact that people generally don't know they can bind to a specific source port and IP when connecting to a remote host. Haproxy has this feature implemented. You can specify a port range in the "source" directive of a server, and it will maintain a per-server list of source ports and addresses. That means you'll have up to 65k ports per server. You can even run higher numbers of connections per servers if you're running in transparent mode, because haproxy will not have to maintain a list of source ports, instead it will use the one found in the incoming connection. However, doing this tends to cause other issues like ACK storms if some packets from the server manage to reach the real client. > What (roughly) architecture was the 150k connection experience you mentioned > running on? One I know was running on low-end machines (eg: dual core with 2-4 GB). Another one I've been informed about was running on larger machines with gigs of ram, but I don't have more precisions. The guys are on the list though, so maybe they'll step up and provide more info. Regards, Willy

