fix: Limit HAProxy maximum concurrent connections

If the limit is not configured, HAProxy derives it from the file
descriptor limit. The higher the limit, the more memory HAProxy
allocates. That limit can be so high on modern Linux distros that
HAproxy allocates all available memory.
This commit is contained in:
Daniel Lipovetsky
2023-03-03 10:11:12 -08:00
parent 93ac40b5aa
commit 47dfc9e840
2 changed files with 6 additions and 0 deletions

View File

@@ -14,6 +14,10 @@
# minimal config file to avoid haproxy exiting due to invalid / missing config
# kind will rewrite this config at runtime
global
# limit memory usage to approximately 18 MB
maxconn 100000
frontend controlPlane
bind 0.0.0.0:6443
mode tcp

View File

@@ -36,6 +36,8 @@ global
log /dev/log local0
log /dev/log local1 notice
daemon
# limit memory usage to approximately 18 MB
maxconn 100000
resolvers docker
nameserver dns 127.0.0.11:53