]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] add support for binding to source port ranges during connect
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Jun 2009 09:09:37 +0000 (11:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 Jul 2009 18:13:26 +0000 (20:13 +0200)
commit16401e816202ad3915424a1ce1b514c0117cc85d
treed12705c2509981e577ca3591977d249b210db2e8
parentf20cad6b3214f2b1b3db7fbeeecc0ef109185c2d
[MEDIUM] add support for binding to source port ranges during connect

Some users are already hitting the 64k source port limit when
connecting to servers. The system usually maintains a list of
unused source ports, regardless of the source IP they're bound
to. So in order to go beyond the 64k concurrent connections, we
have to manage the source ip:port lists ourselves.

The solution consists in assigning a source port range to each
server and use a free port in that range when connecting to that
server, either for a proxied connection or for a health check.
The port must then be put back into the server's range when the
connection is closed.

This mechanism is used only when a port range is specified on
a server. It makes it possible to reach 64k connections per
server, possibly all from the same IP address. Right now it
should be more than enough even for huge deployments.
(cherry picked from commit c6f4ce8fc4a9da9f4c31e8d088fab1ed4f631ed0)
doc/configuration.txt
include/common/standard.h
include/proto/port_range.h [new file with mode: 0644]
include/types/fd.h
include/types/port_range.h [new file with mode: 0644]
include/types/server.h
src/backend.c
src/cfgparse.c
src/checks.c
src/fd.c
src/standard.c