diff --git a/gunicorn_config.py b/gunicorn_config.py index d22c829dac..2818b62c1d 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -1,6 +1,6 @@ import os -from notifications_utils.gunicorn_defaults import set_gunicorn_defaults +from notifications_utils.gunicorn.defaults import set_gunicorn_defaults set_gunicorn_defaults(globals()) @@ -16,10 +16,12 @@ def child_exit(server, worker): workers = 4 -worker_class = "eventlet" -worker_connections = 8 # limit runaway greenthread creation +worker_class = "notifications_utils.gunicorn.eventlet.NotifyEventletWorker" +#worker_connections = 8 # limit runaway greenthread creation +worker_connections = 256 # re-enabling the problem statsd_host = "{}:8125".format(os.getenv("STATSD_HOST")) -keepalive = 0 # disable temporarily for diagnosing issues +keepalive = 35 # re-enabling the problem +#keepalive = 0 # disable temporarily for diagnosing issues timeout = int(os.getenv("HTTP_SERVE_TIMEOUT_SECONDS", 30)) # though has little effect with eventlet worker_class debug_post_threshold = os.getenv("NOTIFY_GUNICORN_DEBUG_POST_REQUEST_LOG_THRESHOLD_SECONDS", None) diff --git a/requirements.in b/requirements.in index 16c91b8743..9d54a9be58 100644 --- a/requirements.in +++ b/requirements.in @@ -25,7 +25,7 @@ psutil>=6.0.0,<7.0.0 notifications-python-client==10.0.1 # Run `make bump-utils` to update to the latest version -notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@94.0.1 +notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@2d56aef11c9d34acf15176a1b2b20cc874b4deec # gds-metrics requires prometheseus 0.2.0, override that requirement as 0.7.1 brings significant performance gains prometheus-client==0.14.1 diff --git a/requirements.txt b/requirements.txt index 1227758274..b146015d18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -95,7 +95,9 @@ gds-metrics @ git+https://github.com/alphagov/gds_metrics_python.git@6f1840a57b6 govuk-bank-holidays==0.15 # via notifications-utils greenlet==3.0.3 - # via eventlet + # via + # eventlet + # sqlalchemy gunicorn @ git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64 # via # -r requirements.in @@ -147,7 +149,7 @@ mistune==0.8.4 # via notifications-utils notifications-python-client==10.0.1 # via -r requirements.in -notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@d6311c3ab83b8225265277f781157c48f9318ae9 +notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@2d56aef11c9d34acf15176a1b2b20cc874b4deec # via -r requirements.in ordered-set==4.1.0 # via notifications-utils diff --git a/requirements_for_test.txt b/requirements_for_test.txt index 6eed37af49..6c4742eb05 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -151,6 +151,7 @@ greenlet==3.0.3 # via # -r requirements.txt # eventlet + # sqlalchemy gunicorn @ git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64 # via # -r requirements.txt @@ -219,7 +220,7 @@ moto==5.0.11 # via -r requirements_for_test.in notifications-python-client==10.0.1 # via -r requirements.txt -notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@d6311c3ab83b8225265277f781157c48f9318ae9 +notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@2d56aef11c9d34acf15176a1b2b20cc874b4deec # via -r requirements.txt ordered-set==4.1.0 # via