Add multiple workers and threads
Also move gunicorn config into file
This commit is contained in:
parent
2987726bd9
commit
c05efa783b
3 changed files with 9 additions and 1 deletions
|
@ -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"]
|
||||
|
|
|
@ -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
6
website/gunicorn.conf.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
import multiprocessing
|
||||
|
||||
bind = "0.0.0.0:8000"
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
threads = 2
|
||||
preload = True
|
Reference in a new issue