mirror of
https://github.com/openfaas/faas.git
synced 2025-06-16 21:06:54 +00:00
Add memory limits and reservations for OF services
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
parent
6c039efe0b
commit
9eff3e7d99
@ -16,6 +16,11 @@ services:
|
||||
depends_on:
|
||||
- nats
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 50M
|
||||
reservations:
|
||||
memory: 20M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
@ -35,6 +40,11 @@ services:
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 125M
|
||||
reservations:
|
||||
memory: 50M
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.platform.os == linux'
|
||||
@ -44,6 +54,11 @@ services:
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 50M
|
||||
reservations:
|
||||
memory: 20M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
@ -55,6 +70,8 @@ services:
|
||||
|
||||
# End
|
||||
|
||||
# Start monitoring
|
||||
|
||||
prometheus:
|
||||
image: functions/prometheus:latest # autobuild from Dockerfile in repo.
|
||||
command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093"
|
||||
@ -68,6 +85,11 @@ services:
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 500M
|
||||
reservations:
|
||||
memory: 200M
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
@ -77,8 +99,6 @@ services:
|
||||
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
# volumes:
|
||||
# - ./prometheus/alertmanager.yml:/alertmanager.yml
|
||||
command:
|
||||
- '-config.file=/alertmanager.yml'
|
||||
networks:
|
||||
@ -86,6 +106,11 @@ services:
|
||||
ports:
|
||||
- 9093:9093
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 50M
|
||||
reservations:
|
||||
memory: 20M
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
|
@ -10,14 +10,28 @@ services:
|
||||
- functions
|
||||
environment:
|
||||
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
|
||||
read_timeout: 8
|
||||
write_timeout: 8
|
||||
|
||||
# Start Add for NATS Streaming
|
||||
depends_on:
|
||||
- nats
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 50M
|
||||
reservations:
|
||||
memory: 20M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 20
|
||||
window: 380s
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
- 'node.platform.os == linux'
|
||||
# End
|
||||
|
||||
# Start monitoring
|
||||
|
||||
prometheus:
|
||||
image: functions/prometheus:latest # autobuild from Dockerfile in repo.
|
||||
command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093"
|
||||
@ -31,6 +45,11 @@ services:
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 500M
|
||||
reservations:
|
||||
memory: 200M
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
@ -40,8 +59,6 @@ services:
|
||||
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
# volumes:
|
||||
# - ./prometheus/alertmanager.yml:/alertmanager.yml
|
||||
command:
|
||||
- '-config.file=/alertmanager.yml'
|
||||
networks:
|
||||
@ -49,10 +66,16 @@ services:
|
||||
ports:
|
||||
- 9093:9093
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 50M
|
||||
reservations:
|
||||
memory: 20M
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
- 'node.platform.os == linux'
|
||||
|
||||
# Sample functions go here.
|
||||
|
||||
# Service label of "function" allows functions to show up in UI on http://gateway:8080/
|
||||
|
Loading…
x
Reference in New Issue
Block a user