mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-09 23:00:59 +00:00
Tell openedx gunicorn to fork workers based on CPU count
This commit is contained in:
parent
d2f6783306
commit
f812ed7dc3
@ -89,6 +89,9 @@ ENV SETTINGS tutor.production
|
||||
# Entrypoint will fix permissions of all files and run commands as openedx
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
# Copy gunicorn settings file
|
||||
COPY gunicorn_conf.py /openedx/gunicorn_conf.py
|
||||
|
||||
# Run server
|
||||
EXPOSE 8000
|
||||
CMD gunicorn --name ${SERVICE_VARIANT} --bind=0.0.0.0:8000 --max-requests=1000 ${SERVICE_VARIANT}.wsgi:application
|
||||
CMD gunicorn -c file:/openedx/gunicorn_conf.py --name ${SERVICE_VARIANT} --bind=0.0.0.0:8000 --max-requests=1000 ${SERVICE_VARIANT}.wsgi:application
|
||||
|
5
tutor/templates/build/openedx/gunicorn_conf.py
Normal file
5
tutor/templates/build/openedx/gunicorn_conf.py
Normal file
@ -0,0 +1,5 @@
|
||||
import multiprocessing
|
||||
|
||||
# The recommended number of workers is twice the
|
||||
# CPU count plus one
|
||||
workers = (multiprocessing.cpu_count()-1) * 2 + 2
|
Loading…
Reference in New Issue
Block a user