Calculate number of workers for gunicorn

This commit is contained in:
James Wang 2015-12-23 17:24:37 -05:00
parent be7cf1f819
commit f9da3c74b9
2 changed files with 5 additions and 1 deletions

2
deploy
View file

@ -7,4 +7,4 @@ sudo service nginx stop
echo "Starting the server..." echo "Starting the server..."
cd /home/vagrant/server cd /home/vagrant/server
sudo service nginx start 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
View file

@ -0,0 +1,4 @@
from multiprocessing import cpu_count
bind = "0.0.0.0:8000"
workers = cpu_count() * 2 + 1