Skip to content

fix(selfhost): add memory/CPU resource limits to docker-compose services #2495

Description

@JSONbored

Parent: #1936

Problem

No service in docker-compose.yml (613 lines) — including the core gittensory app — declares a memory or CPU limit (mem_limit/deploy.resources.limits/cpus). Any --profile combination (e.g. --profile ollama --profile observability) lets one runaway optional service (Ollama loading a multi-GB model, Postgres, Qdrant, or the whole Prometheus/Loki/Tempo/Grafana observability stack) exhaust host RAM/CPU and OOM-kill or starve the core review-pipeline container instead of the intended optional service.

This is exactly the gap issue #1828 ("profile stack resources and tune defaults") calls out, and currently has zero mitigation anywhere in the compose file.

Fix

Add deploy.resources.limits.memory (and optionally cpus) to at least the heavyweight/optional services (ollama, qdrant, postgres, prometheus, loki, tempo, grafana) and a sane limit for the core gittensory/redis services, with operator-overridable values via .env (e.g. OLLAMA_MEM_LIMIT) so beginner-friendly defaults don't silently allow one profile to take down the host.

Verification

  • Confirm the exact line numbers/service list against current docker-compose.yml (line numbers may have shifted since this was audited).
  • docker compose --profile ollama --profile observability config still validates after adding limits.
  • Document the override env vars in .env.example.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions