I'd like my HAProxy Load Balancer to be able to handle at least 1M connections. I need this to deploy a stress test.
I tried setting:
maxconn 1000000
in my haproxy.cfg
but HAProxy failed to start with:
[haproxy.main()] Cannot raise FD limit to 2000029, limit is 1048576.
I'm running HAProxy in a Docker Container on Ubuntu Linux 20.04 LTS that is an Amazon AWS Lightsail VPS instance.
I've looked at various questions on the internet on how to manually increase open files
limit (ulimit -n
) and copy pasted numerous configurations into my host. Nothing worked - I couldn't increase this limit to anything higher than 1048576.
I've found the following related posts on the subject of hard limit for the number of open files:
- Fixing ulimit: open files: cannot modify limit: Operation not permitted
- On Linux - set maximum open files to unlimited. Possible?
This question seems almost identical to mine:
Am I approaching the issue from the wrong angle? Is there another way to configure HAProxy so that it can handle a million connections (that is, without increasing ulimit -n
)?