diff --git a/tutor/templates/build/notes/Dockerfile b/tutor/templates/build/notes/Dockerfile index 662fa4d..c1669e0 100644 --- a/tutor/templates/build/notes/Dockerfile +++ b/tutor/templates/build/notes/Dockerfile @@ -12,4 +12,4 @@ WORKDIR /openedx/edx-notes-api RUN pip install -r requirements/base.txt EXPOSE 8000 -CMD gunicorn --workers=3 --name notes --bind=0.0.0.0:8000 --max-requests=1000 notesserver.wsgi:application +CMD gunicorn --workers=2 --name notes --bind=0.0.0.0:8000 --max-requests=1000 notesserver.wsgi:application diff --git a/tutor/templates/build/openedx/gunicorn_conf.py b/tutor/templates/build/openedx/gunicorn_conf.py index 5e9bc10..40e6288 100644 --- a/tutor/templates/build/openedx/gunicorn_conf.py +++ b/tutor/templates/build/openedx/gunicorn_conf.py @@ -1,4 +1,4 @@ -import multiprocessing +import os -# Set the number of gunicorn workers to the number of CPU -workers = multiprocessing.cpu_count() +# Set the number of gunicorn workers +workers = int(os.environ.get("GUNICORN_WORKERS", "2")) \ No newline at end of file diff --git a/tutor/templates/build/xqueue/Dockerfile b/tutor/templates/build/xqueue/Dockerfile index 1801ef2..559a6ed 100644 --- a/tutor/templates/build/xqueue/Dockerfile +++ b/tutor/templates/build/xqueue/Dockerfile @@ -12,4 +12,4 @@ WORKDIR /openedx/xqueue RUN pip install -r requirements.txt EXPOSE 8040 -CMD gunicorn --workers=3 --name xqueue --bind=0.0.0.0:8040 --max-requests=1000 xqueue.wsgi:application +CMD gunicorn --workers=2 --name xqueue --bind=0.0.0.0:8040 --max-requests=1000 xqueue.wsgi:application