Calculate number of workers for gunicorn
This commit is contained in:
parent
be7cf1f819
commit
f9da3c74b9
2 changed files with 5 additions and 1 deletions
2
deploy
2
deploy
|
@ -7,4 +7,4 @@ sudo service nginx stop
|
|||
echo "Starting the server..."
|
||||
cd /home/vagrant/server
|
||||
sudo service nginx start
|
||||
gunicorn --bind 0.0.0.0:8000 -w 1 "app:app"
|
||||
gunicorn "app:app" -c /home/vagrant/scripts/gunicorn.py.ini
|
||||
|
|
4
scripts/gunicorn.py.ini
Normal file
4
scripts/gunicorn.py.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
from multiprocessing import cpu_count
|
||||
|
||||
bind = "0.0.0.0:8000"
|
||||
workers = cpu_count() * 2 + 1
|
Loading…
Reference in a new issue