mirror of
https://github.com/openfaas/faas.git
synced 2025-06-17 12:46:59 +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:
|
depends_on:
|
||||||
- nats
|
- nats
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 50M
|
||||||
|
reservations:
|
||||||
|
memory: 20M
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
delay: 5s
|
delay: 5s
|
||||||
@ -35,6 +40,11 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 125M
|
||||||
|
reservations:
|
||||||
|
memory: 50M
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.platform.os == linux'
|
- 'node.platform.os == linux'
|
||||||
@ -44,6 +54,11 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 50M
|
||||||
|
reservations:
|
||||||
|
memory: 20M
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
delay: 5s
|
delay: 5s
|
||||||
@ -55,6 +70,8 @@ services:
|
|||||||
|
|
||||||
# End
|
# End
|
||||||
|
|
||||||
|
# Start monitoring
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: functions/prometheus:latest # autobuild from Dockerfile in repo.
|
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"
|
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:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 500M
|
||||||
|
reservations:
|
||||||
|
memory: 200M
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
@ -77,8 +99,6 @@ services:
|
|||||||
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
||||||
environment:
|
environment:
|
||||||
no_proxy: "gateway"
|
no_proxy: "gateway"
|
||||||
# volumes:
|
|
||||||
# - ./prometheus/alertmanager.yml:/alertmanager.yml
|
|
||||||
command:
|
command:
|
||||||
- '-config.file=/alertmanager.yml'
|
- '-config.file=/alertmanager.yml'
|
||||||
networks:
|
networks:
|
||||||
@ -86,6 +106,11 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 9093:9093
|
- 9093:9093
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 50M
|
||||||
|
reservations:
|
||||||
|
memory: 20M
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
|
@ -10,14 +10,28 @@ services:
|
|||||||
- functions
|
- functions
|
||||||
environment:
|
environment:
|
||||||
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
|
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
|
||||||
read_timeout: 8
|
# Start Add for NATS Streaming
|
||||||
write_timeout: 8
|
depends_on:
|
||||||
|
- nats
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 50M
|
||||||
|
reservations:
|
||||||
|
memory: 20M
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 20
|
||||||
|
window: 380s
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
- 'node.platform.os == linux'
|
- 'node.platform.os == linux'
|
||||||
|
# End
|
||||||
|
|
||||||
|
# Start monitoring
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: functions/prometheus:latest # autobuild from Dockerfile in repo.
|
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"
|
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:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 500M
|
||||||
|
reservations:
|
||||||
|
memory: 200M
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
@ -40,8 +59,6 @@ services:
|
|||||||
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
|
||||||
environment:
|
environment:
|
||||||
no_proxy: "gateway"
|
no_proxy: "gateway"
|
||||||
# volumes:
|
|
||||||
# - ./prometheus/alertmanager.yml:/alertmanager.yml
|
|
||||||
command:
|
command:
|
||||||
- '-config.file=/alertmanager.yml'
|
- '-config.file=/alertmanager.yml'
|
||||||
networks:
|
networks:
|
||||||
@ -49,10 +66,16 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 9093:9093
|
- 9093:9093
|
||||||
deploy:
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 50M
|
||||||
|
reservations:
|
||||||
|
memory: 20M
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
- 'node.platform.os == linux'
|
- 'node.platform.os == linux'
|
||||||
|
|
||||||
# Sample functions go here.
|
# Sample functions go here.
|
||||||
|
|
||||||
# Service label of "function" allows functions to show up in UI on http://gateway:8080/
|
# Service label of "function" allows functions to show up in UI on http://gateway:8080/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user