-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganise h's config files #8386
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bind = "0.0.0.0:5000" | ||
graceful_timeout = 0 | ||
timeout = 0 | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to have separate
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bind = "localhost:5001" | ||
worker_class = "h.streamer.Worker" | ||
graceful_timeout = 0 | ||
workers = 2 | ||
worker_connections = 8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bind = "unix:/tmp/gunicorn-websocket.sock" | ||
worker_class = "h.streamer.Worker" | ||
graceful_timeout = 0 | ||
workers = 2 | ||
worker_connections = 8192 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bind = "0.0.0.0:5000" | ||
worker_class = "h.streamer.Worker" | ||
graceful_timeout = 0 | ||
workers = 2 | ||
worker_connections = 8192 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bind = "unix:/tmp/gunicorn-web.sock" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,6 @@ use: call:h.app:create_app | |
[filter:proxy-prefix] | ||
use: egg:PasteDeploy#prefix | ||
|
||
[server:main] | ||
use: egg:gunicorn#main | ||
bind: unix:/tmp/gunicorn-web.sock | ||
proc_name: web | ||
Comment on lines
-12
to
-15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed |
||
|
||
[loggers] | ||
keys = root, alembic, gunicorn.error, h | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,15 @@ nodaemon = true | |
silent = true | ||
|
||
[program:web] | ||
command = pserve --reload conf/development-app.ini | ||
command = gunicorn --paste conf/development.ini --config conf/gunicorn-dev.conf.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. h was the only one of our apps that was running Gunicorn indirectly via This is unusual for a Pyramid app: the Pyramid docs tell you to use I've gone for a The cookiecutter will put these Notes on Gunicorn configurationTo understand Gunicorn configuration you need to read the Running Gunicorn, Configuration Overview and Settings pages in the Gunicorn docs and combine them in your head. Here's a short summary: Gunicorn reads configuration from five locations and merges them. You can use all five of these at once, each successive location overriding earlier ones:
|
||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
stopsignal = KILL | ||
stopasgroup = true | ||
autostart = %(ENV_ENABLE_WEB)s | ||
|
||
[program:websocket] | ||
command = pserve --reload conf/websocket-dev.ini | ||
command = gunicorn --paste conf/websocket-dev.ini --config conf/gunicorn-websocket-dev.conf.py | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
stopsignal = KILL | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,21 +13,30 @@ stderr_events_enabled=true | |
autostart = %(ENV_ENABLE_NGINX)s | ||
|
||
[program:web] | ||
command=newrelic-admin run-program pserve conf/app.ini | ||
command=newrelic-admin run-program gunicorn --paste conf/production.ini --config conf/gunicorn.conf.py | ||
stdout_logfile=NONE | ||
stderr_logfile=NONE | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
autostart = %(ENV_ENABLE_WEB)s | ||
|
||
[program:websocket] | ||
command=pserve %(ENV_WEBSOCKET_CONFIG)s | ||
command=newrelic-admin run-program gunicorn --paste conf/websocket.ini --config conf/gunicorn-websocket.conf.py | ||
stdout_logfile=NONE | ||
stderr_logfile=NONE | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
autostart = %(ENV_ENABLE_WEBSOCKET)s | ||
|
||
[program:websocket-monolithic] | ||
command=newrelic-admin run-program gunicorn --paste conf/websocket-monolithic.ini --config conf/gunicorn-websocket-monolithic.conf.py | ||
stdout_logfile=NONE | ||
stderr_logfile=NONE | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
autostart = %(ENV_ENABLE_WEBSOCKET_MONOLITHIC)s | ||
process_name = websocket | ||
Comment on lines
+31
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously there was a single This will no longer work now that we have separate PasteDeploy and Gunicorn config files. You'd need two separate envvars I've changed this to instead define two separate These |
||
|
||
[program:worker] | ||
command=newrelic-admin run-program hypothesis celery worker --loglevel=INFO | ||
stdout_logfile=NONE | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
development-app.ini
to justdevelopment.ini
, the same as our other apps.This
[server:main]
section contained Gunicorn config settings. Gunicorn only reads settings from the[server:main]
block of the PasteDeploy config file if Gunicorn is being run indirectly viapserve
. We're no longer usingpserve
, so these Gunicorn settings have now moved intogunicorn-dev.conf.py
.The
proc_name
setting was unnecessary: the app is already calledweb
insupervisord-dev.conf
, so I didn't copy that intogunicorn-dev.conf.py
.The
errorlog
setting was also unnecessary:-
is the default. Didn't copy that either.