Skip to content

Commit 1f52e7c

Browse files
committed
Add resource limits/reservations
1 parent 18e172b commit 1f52e7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

services/rabbit/docker-compose.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
# https://discourse.haproxy.org/t/haproxy-high-availability-configuration/11983
88
replicas: ${RABBIT_LB_REPLICAS}
99
# necessary to preserve client ip
10-
# otherwise we see overlay network lb ip
10+
# otherwise we see overlay rabbit network lb ip
1111
# (rabbitmq management dashboard connection section)
1212
endpoint_mode: dnsrr
1313
# healthcheck: https://github.com/haproxy/haproxy/issues/3091
@@ -27,6 +27,14 @@ services:
2727
placement:
2828
constraints:
2929
- node.labels.rabbit0{{ ix }} == true
30+
resources:
31+
# https://www.rabbitmq.com/docs/production-checklist#minimum-hardware
32+
limits:
33+
cpus: "4.0"
34+
memory: "4G"
35+
reservations:
36+
cpus: "1.0"
37+
memory: "1G"
3038
environment:
3139
# https://www.rabbitmq.com/docs/configure#supported-environment-variables
3240
RABBITMQ_DEFAULT_USER: ${RABBIT_USER}

0 commit comments

Comments
 (0)