feat(ops): worker/beat healthchecks, resource limits, Redis AOF (#84) #169
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/84-healthchecks-limits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
docker-compose.ymlhad healthchecks for db/redis/backend/bot but none for worker/beat/frontend, no memory limits anywhere, and redis ran RDB-only persistence while holding sessions (DB 0) + the Celery broker (DB 1, tasks queued up to 7 days out). A hung worker/beat looked healthy; a redis crash between snapshots dropped queued work and logged everyone out; a runaway container could take down the host.Changes (
docker-compose.yml)celery … inspect ping -d celery@$$HOSTNAME(pings only the local worker; generous start_period).touches/tmp/beat-heartbeatevery 60s (wrapping beat viash -c … exec), healthcheck fails if the file is >3min stale — thecelerybeat-schedulemtime isn't a reliable liveness signal.mem_limit): worker 1g, backend 512m, beat 256m, bot 512m; how to raise them is documented.--appendonly yes+ an OPERATIONS.md note on theappendfsync everysecdurability/IO trade-off.depends_on.backendservice_started→service_healthy.wget --spider http://localhost/(verified the current nginx:alpine ships wget).Preserves #89's one-shot
migrateservice and themigrate: service_completed_successfullyordering (merged main in and reconciled the beat block so it has both the migrate dependency and the heartbeat command).Verification
docker compose configfor base,+dev, and+prodoverlays all resolve cleanly with the new healthchecks + mem_limits (validated on the dev Docker host). Runtime acceptance (pause worker → unhealthy; sessions survivedocker compose restart rediswith AOF) is documented as a manual checklist in OPERATIONS.md.Closes #84
🤖 Generated with Claude Code