I have a haproxy server which gets limited to some 60k connections. I think it is because of ephemeral port limit as I have 1:1 connection mapping, so all my outgoing connections go to the same server.

Here is what I think could help me: I can add a new network interface (eth1) with a new IP. I would then add a duplicate backend server definition and I believe the new destination will get a new ephemeral port limit as long as it uses a different interface. This should let my connection counts grow.

However, I can't seem to find a way to force haproxy to use eth0 for one backend server definition and eth1 for another. Is it possible to do that, or are there other ways of achieving what I need?

The system in question is running Debian and haproxy 1.4.8 (default on Debian).


From HAProxy manual, section 5:

The "source" parameter sets the source address which will be used when connecting to the server. It follows the exact same parameters and principle as the backend "source" keyword, except that it only applies to the server referencing it. Please consult the "source" keyword for details.

| improve this answer | |

Florin's answer is great.

Failing that (say, if this wasn't HAproxy), a workaround would have been to configure an address in a separate subnet on the secondary device.

The backend server would need to be reachable in that subnet as well, of course - the new server declaration would not be a duplicate, but rather an independent entry that would incidentally end up at the same machine.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.