6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-27 19:59:02 +00:00

Adjust the number of gunicorn workers

Given that each gunicorn worker uses ~200-250Mb virtual memory, we should
really avoid running too many of them. Here, we reduce the default
number of workers to 2. For the LMS and the CMS, this number can be
adjusted by setting an environment variable GUNICORN_WORKERS.

This is related to #207.
This commit is contained in:
Régis Behmo 2019-05-02 08:42:09 +02:00
parent 25d1d38f85
commit ce03d5fe4a
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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"))

View File

@ -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