From 8814dd899491b9f1d251f4ee95fda694c3ead2a5 Mon Sep 17 00:00:00 2001 From: Ryan Chen Date: Thu, 7 Aug 2025 23:59:00 -0400 Subject: [PATCH] perf: reduce Gunicorn workers to 1 for stability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change from 4 workers to 1 worker in both Dockerfile and docker-compose.yml - Helps reduce resource usage and connection reset issues - Better for single-user or low-traffic deployment scenarios 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1979c0..76c5a4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN uv venv && \ ENV FLASK_APP=main.py ENV FLASK_ENV=production ENV PATH="/app/.venv/bin:$PATH" -ENV GUNICORN_CMD_ARGS="--workers=4 --bind=0.0.0.0:5000 --timeout=120" +ENV GUNICORN_CMD_ARGS="--workers=1 --bind=0.0.0.0:5000 --timeout=120" # Expose port EXPOSE 5000 diff --git a/docker-compose.yml b/docker-compose.yml index a38ff51..93db27d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: environment: - FLASK_APP=main.py - FLASK_ENV=production - - GUNICORN_CMD_ARGS=--workers=4 --bind=0.0.0.0:5000 --timeout=120 --keep-alive=5 --worker-class=sync --worker-connections=1000 --max-requests=1000 --max-requests-jitter=50 + - GUNICORN_CMD_ARGS=--workers=1 --bind=0.0.0.0:5000 --timeout=120 --keep-alive=5 --worker-class=sync --worker-connections=1000 --max-requests=1000 --max-requests-jitter=50 # Application configuration - UPLOAD_FOLDER=app/static/uploads - DATABASE_PATH=pet_pictures.db