Skip to content

Commit f1d9cc0

Browse files
dkorunicivanmatmati
authored andcommitted
BUG/MINOR: Add -m to HAProxy arguments to set memory limit to 2/3 of RAM
1 parent 3d8a687 commit f1d9cc0

File tree

1 file changed

+4
-3
lines changed
  • fs/etc/services.d/haproxy

1 file changed

+4
-3
lines changed

fs/etc/services.d/haproxy/run

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/execlineb -P
1+
#!/usr/bin/with-contenv sh
22

3-
with-contenv
4-
/usr/local/sbin/haproxy -W -db -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy-aux.cfg
3+
MEMLIMIT=$(free -m | awk '/Mem:/ {print int($2 * 2 / 3)}')
4+
5+
exec /usr/local/sbin/haproxy -W -db -m "${MEMLIMIT}" -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy-aux.cfg

0 commit comments

Comments
 (0)