perf: reduce RAM usage for 1GB host

- MariaDB: limit innodb buffer pool to 128M, max 20 connections
- Celery worker: concurrency 2→1
- Flower: moved to 'flower' profile (opt-in, not started by default)
  Start with: docker compose --profile flower up -d flower

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-05-13 11:16:58 +03:00
parent 7df5da76d7
commit e816672e16

View File

@@ -2,6 +2,7 @@ services:
db: db:
image: mariadb:11.4 image: mariadb:11.4
restart: unless-stopped restart: unless-stopped
command: --innodb-buffer-pool-size=128M --max-connections=20
environment: environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME} MYSQL_DATABASE: ${DB_NAME}
@@ -73,7 +74,7 @@ services:
condition: service_healthy condition: service_healthy
db: db:
condition: service_healthy condition: service_healthy
command: celery -A web.tasks.celery_app worker --loglevel=info --concurrency=2 --queues=default,sync,health,notifications -E command: celery -A web.tasks.celery_app worker --loglevel=info --concurrency=1 --queues=default,sync,health,notifications -E
beat: beat:
build: build:
@@ -97,6 +98,7 @@ services:
context: . context: .
dockerfile: Dockerfile.web dockerfile: Dockerfile.web
restart: unless-stopped restart: unless-stopped
profiles: [flower]
ports: ports:
- "5555:5555" - "5555:5555"
environment: environment: