feat(infra): add cpu and memory limits to all services
This commit is contained in:
@@ -13,3 +13,6 @@ CACHE_URL_FILE=/run/secrets/cache_url
|
|||||||
|
|
||||||
API_REPLICAS=2
|
API_REPLICAS=2
|
||||||
IDEMPOTENCY_TTL_SECONDS=86400
|
IDEMPOTENCY_TTL_SECONDS=86400
|
||||||
|
|
||||||
|
API_CPUS=0.5
|
||||||
|
API_MEM=256M
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ services:
|
|||||||
- cache_url
|
- cache_url
|
||||||
deploy:
|
deploy:
|
||||||
replicas: ${API_REPLICAS:-2}
|
replicas: ${API_REPLICAS:-2}
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: "${API_CPUS:-0.5}"
|
||||||
|
memory: ${API_MEM:-256M}
|
||||||
depends_on:
|
depends_on:
|
||||||
migrate:
|
migrate:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
@@ -33,6 +37,11 @@ services:
|
|||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: "1.0"
|
||||||
|
memory: 512M
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
@@ -54,6 +63,11 @@ services:
|
|||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: "0.25"
|
||||||
|
memory: 128M
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
load_balancer:
|
load_balancer:
|
||||||
@@ -62,6 +76,11 @@ services:
|
|||||||
- "127.0.0.1:8080:8080"
|
- "127.0.0.1:8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- ./deploy/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./deploy/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: "0.5"
|
||||||
|
memory: 128M
|
||||||
depends_on:
|
depends_on:
|
||||||
api:
|
api:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user