From 0eee0cecde9504b84105e2a93662f64cf891bf94 Mon Sep 17 00:00:00 2001 From: Claudio Date: Sun, 10 May 2026 21:09:51 +0200 Subject: [PATCH] perf(backend): drop uvicorn --reload, run 2 workers in compose Production runs were on the dev --reload single-worker config. The frontend fans out ~15 parallel API calls on first paint (folders/tree, tags, heaps, sharing/*, stats, photos, worker-status, scan/status); they all serialized on one event loop and felt slow. Switch to 2 workers without --reload for real concurrency. --proxy-headers preserved client IPs through nginx. Co-Authored-By: Claude Opus 4.7 (1M context) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 782fec9..e412235 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: # then Alembic runs migrations for existing installs. On fresh DBs # create_all already built the full schema, so bootstrap.py stamps # alembic head to skip redundant ALTER statements. - command: sh -c "python -c 'import asyncio; from app.database import init_db; asyncio.run(init_db())' && python bootstrap.py && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload" + command: sh -c "python -c 'import asyncio; from app.database import init_db; asyncio.run(init_db())' && python bootstrap.py && uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2 --proxy-headers" environment: - DATABASE_URL=postgresql+asyncpg://mulita:mulita@db:5432/mulita - REDIS_URL=redis://redis:6379