Skip to content

CR-1: Add container resource limits to prevent OOM and noisy-neighbor issues #73

Description

@szachovy

Problem

No container has memory limits, CPU limits, or PID limits. Without mem_limit, a MySQL query causing excessive memory allocation will OOM-kill the host or steal memory from Redis (Celery broker dies). Without CPU limits, one container can starve others under heavy load. Also a prerequisite for meaningful InnoDB buffer pool tuning (MY-1).

Files: src/container.py, services/mysql-mgmt/docker_compose.yml

Fix

Container mem_limit cpus pids_limit
MySQL Server 2G 2.0 500
MySQL Mgmt 1G 1.0 200
Redis 768M 0.5 100
Superset 2G 2.0 500

Set memswap_limit equal to mem_limit for all containers (no swap).

Acceptance Criteria

  • MySQL Server containers: mem_limit=2G, cpus=2.0, pids_limit=500
  • MySQL Mgmt containers: mem_limit=1G, cpus=1.0, pids_limit=200
  • Redis container: mem_limit=768M, cpus=0.5, pids_limit=100
  • Superset container: mem_limit=2G, cpus=2.0, pids_limit=500
  • memswap_limit equals mem_limit for all containers (no swap)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions