1
Fork 0

Add multiple workers and threads

Also move gunicorn config into file
This commit is contained in:
Jake Howard 2020-05-03 17:28:02 +01:00
parent 2987726bd9
commit c05efa783b
Signed by: jake
GPG Key ID: 57AFB45680EDD477
3 changed files with 9 additions and 1 deletions

View File

@ -23,4 +23,4 @@ RUN ./scripts/setup-python.sh
RUN rm -rf ./static
EXPOSE 8000
CMD ["gunicorn", "-b", "0.0.0.0:8000", "--preload", "--access-logfile", "/dev/stdout", "website.wsgi:application"]
CMD ["gunicorn", "-c", "website/gunicorn.conf.py", "--access-logfile", "/dev/stdout", "website.wsgi:application"]

View File

@ -19,3 +19,5 @@ isort -rc -c website/
mypy website/
eslint static/src/js
gunicorn --check-config -c website/gunicorn.conf.py website.wsgi:application

6
website/gunicorn.conf.py Normal file
View File

@ -0,0 +1,6 @@
import multiprocessing
bind = "0.0.0.0:8000"
workers = multiprocessing.cpu_count() * 2 + 1
threads = 2
preload = True