From 0b443892f60997d180a035e8b774de2ba6bcd9f5 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Wed, 8 Jan 2020 13:21:36 +0100 Subject: [PATCH] gunicorn: updated gunicorn config based on release changes --- configs/gunicorn_config.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/configs/gunicorn_config.py b/configs/gunicorn_config.py index 713c73f1..ffb59953 100644 --- a/configs/gunicorn_config.py +++ b/configs/gunicorn_config.py @@ -1,16 +1,6 @@ """ -gunicorn config extension and hooks. Sets additional configuration that is -available post the .ini config. - -- workers = ${cpu_number} -- threads = 1 -- proc_name = ${gunicorn_proc_name} -- worker_class = sync -- worker_connections = 10 -- max_requests = 1000 -- max_requests_jitter = 30 -- timeout = 21600 - +Gunicorn config extension and hooks. This config file adds some extra settings and memory management. +Gunicorn configuration should be managed by .ini files entries of RhodeCode or VCSServer """ import gc @@ -247,9 +237,11 @@ def pre_request(worker, req): def post_request(worker, req, environ, resp): total_time = time.time() - worker.start_time + # Gunicorn sometimes has problems with reading the status_code + status_code = getattr(resp, 'status_code', '') worker.log.debug( "GNCRN POST WORKER [cnt:%s]: %s %s resp: %s, Load Time: %.4fs", - worker.nr, req.method, req.path, resp.status_code, total_time) + worker.nr, req.method, req.path, status_code, total_time) _check_memory_usage(worker)