Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart NASSL worker every hour to solve memory issues #1326

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,23 @@ services:
command: celery --app internetnl worker --without-gossip --pool=eventlet --time-limit=300 --concurrency=$WORKER_CONCURRENCY
--queues nassl_worker

# cron daemon with access to Docker socket to restart worker-nassl periodically to solve memory issues
restart-nassl-worker:
image: alpinelinux/docker-cli:latest
command: crond -f -d7
configs:
- source: restart_nassl_worker_cron
target: /etc/periodic/hourly/restart_nassl_worker
mode: 0755
restart: unless-stopped
logging:
driver: $LOGGING_DRIVER
options:
tag: '{{.Name}}'
network_mode: "none"
volumes:
- /var/run/docker.sock:/var/run/docker.sock

# worker for slow and long running tasks that could require a lot of memory (eg: hof update)
worker-slow:
# copy all attributes from 'worker' service and overwrite specific settings below
Expand Down Expand Up @@ -882,6 +899,12 @@ configs:
}
restart_nassl_worker_cron:
content: |
#!/bin/sh
set -e
# find nassl worker and restart the container
docker restart $(docker ps --filter label=com.docker.compose.service=worker-nassl --quiet)
networks:
# disable default network
Expand Down
Loading