mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-02 10:41:30 +08:00
Add support for SIGTTIN and SIGTTOU signals to the dirty arbiter, allowing dynamic scaling of dirty workers at runtime without restarting gunicorn. Changes: - Add TTIN/TTOU to DirtyArbiter.SIGNALS - Add num_workers instance variable for dynamic count - Add _get_minimum_workers() to enforce app worker constraints - Add signal handlers for TTIN (increase) and TTOU (decrease) - Update manage_workers() to use dynamic count - Add documentation for dynamic scaling - Add unit tests for signal handling - Add Docker integration tests The minimum worker constraint ensures TTOU cannot reduce workers below what apps require (e.g., if an app has workers=3, minimum is 3). Closes #3489
18 lines
433 B
Docker
18 lines
433 B
Docker
FROM python:3.12-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl procps \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Install gunicorn from source
|
|
COPY . /gunicorn-src/
|
|
RUN pip install --no-cache-dir /gunicorn-src/
|
|
|
|
# Copy test app
|
|
COPY tests/docker/dirty_ttin_ttou/app.py /app/
|
|
COPY tests/docker/dirty_ttin_ttou/gunicorn_conf.py /app/
|
|
|
|
CMD ["gunicorn", "-c", "gunicorn_conf.py", "app:app"]
|