We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d8a687 commit f1d9cc0Copy full SHA for f1d9cc0
fs/etc/services.d/haproxy/run
@@ -1,4 +1,5 @@
1
-#!/usr/bin/execlineb -P
+#!/usr/bin/with-contenv sh
2
3
-with-contenv
4
-/usr/local/sbin/haproxy -W -db -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy-aux.cfg
+MEMLIMIT=$(free -m | awk '/Mem:/ {print int($2 * 2 / 3)}')
+
5
+exec /usr/local/sbin/haproxy -W -db -m "${MEMLIMIT}" -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy-aux.cfg
0 commit comments