Skip to content

Commit

Permalink
BUG/MINOR: Add -m to HAProxy arguments to set memory limit to 2/3 of RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorunic authored and ivanmatmati committed Jun 15, 2022
1 parent 3d8a687 commit f1d9cc0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/etc/services.d/haproxy/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/execlineb -P
#!/usr/bin/with-contenv sh

with-contenv
/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)}')

exec /usr/local/sbin/haproxy -W -db -m "${MEMLIMIT}" -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy-aux.cfg

0 comments on commit f1d9cc0

Please sign in to comment.