fix(celery): cap worker memory at 3g
This commit is contained in:
@@ -84,11 +84,16 @@ services:
|
||||
target: runtime-celery
|
||||
container_name: mostovik_celery_worker
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
CELERY_WORKER_CONCURRENCY: "1"
|
||||
CELERY_WORKER_MAX_MEMORY_PER_CHILD_KB: "3145728"
|
||||
env_file:
|
||||
- .env.dev
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
mem_limit: 3g
|
||||
memswap_limit: 3g
|
||||
volumes:
|
||||
- ./src:/app/src
|
||||
- ./logs:/app/logs
|
||||
|
||||
@@ -48,11 +48,16 @@ services:
|
||||
image: ${CELERY_IMAGE:-mostovik/celery:latest}
|
||||
container_name: mostovik_celery_worker
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
CELERY_WORKER_CONCURRENCY: "1"
|
||||
CELERY_WORKER_MAX_MEMORY_PER_CHILD_KB: "3145728"
|
||||
env_file:
|
||||
- .env.prod
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
mem_limit: 3g
|
||||
memswap_limit: 3g
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
- ./input:/app/input
|
||||
|
||||
@@ -17,4 +17,5 @@ esac
|
||||
|
||||
exec celery -A core worker \
|
||||
--loglevel="${CELERY_LOG_LEVEL:-INFO}" \
|
||||
--concurrency="${CELERY_WORKER_CONCURRENCY:-2}"
|
||||
--concurrency="${CELERY_WORKER_CONCURRENCY:-1}" \
|
||||
--max-memory-per-child="${CELERY_WORKER_MAX_MEMORY_PER_CHILD_KB:-3145728}"
|
||||
|
||||
Reference in New Issue
Block a user