Update nr_open limit value in the amphora

Using haproxy 2.x, the ideal rlimit value for nr_open is close to
connection_limit * 2.5 (see compute_ideal_* in src/haproxy.c).
Set this limit to 2,600,000 in the amphora to support a loadbalancer
with maxconn 1M.

This prevents the following warning messages when launching/reloading
haproxy:

* "Cannot raise FD limit to 2375058, limit is 2097152."
* "FD limit (2097152) too low for maxconn=950000/maxsock=2375058. Please
  raise 'ulimit-n' to 2375058 or more to avoid any trouble."

Change-Id: I6251cd17bd6fa9faf5109e50c2190dda3614908d
(cherry picked from commit 4174f4a5a4)
(cherry picked from commit f55376bf5d)
(cherry picked from commit c177987f81)
(cherry picked from commit e4300558e1)
This commit is contained in:
Gregory Thiemonge 2021-04-22 10:58:08 +02:00
parent b1cc4467a9
commit eff1c1a63e
3 changed files with 9 additions and 3 deletions

View File

@ -13,8 +13,8 @@ sysctl-write-value net.core.somaxconn 65534
sysctl-write-value net.ipv4.tcp_synack_retries 3
sysctl-write-value net.core.netdev_max_backlog 100000
# This should allow HAProxy maxconn to be 1,000,000
sysctl-write-value fs.file-max 2097152
sysctl-write-value fs.nr_open 2097152
sysctl-write-value fs.file-max 2600000
sysctl-write-value fs.nr_open 2600000
# It's ok for these to fail if conntrack module isn't loaded
sysctl-write-value net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait 5 || true

View File

@ -30,7 +30,7 @@ Type=notify
KillMode=mixed
Restart=always
LimitNOFILE=2097152
LimitNOFILE=2600000
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Increase the limit value for nr_open and file-max in the amphora, the new
value is based on what HAProxy 2.x is expecting from the system with the
greatest maxconn value that Octavia can set.