Merge pull request #1627 from alphagov/async-workers

Use eventlet workers for gunicorn
This commit is contained in:
Sakis
2018-02-06 16:38:12 +00:00
committed by GitHub
3 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,13 @@
import os
import sys
import traceback
workers = 5
worker_class = "eventlet"
worker_connections = 256
errorlog = "/home/vcap/logs/gunicorn_error.log"
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
def on_starting(server):
server.log.info("Starting Notifications API")

View File

@@ -1,7 +1,7 @@
---
buildpack: python_buildpack
command: scripts/run_app_paas.sh gunicorn -c /home/vcap/app/gunicorn_config.py --error-logfile /home/vcap/logs/gunicorn_error.log -w 5 -b 0.0.0.0:$PORT application
command: scripts/run_app_paas.sh gunicorn -c /home/vcap/app/gunicorn_config.py application
services:
- notify-db
env:

View File

@@ -8,6 +8,7 @@ Flask-Migrate==2.1.1
Flask-SQLAlchemy==2.3.2
Flask==0.12.2
click-datetime==0.2
eventlet==0.22.0
gunicorn==19.7.1
iso8601==0.1.12
jsonschema==2.6.0