gunicorn: updated gunicorn config based on release changes
marcink -
r4176:7419365e default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -1,16 +1,6
1 """
1 """
2 gunicorn config extension and hooks. Sets additional configuration that is
2 Gunicorn config extension and hooks. This config file adds some extra settings and memory management.
3 available post the .ini config.
3 Gunicorn configuration should be managed by .ini files entries of RhodeCode or VCSServer
4
5 - workers = ${cpu_number}
6 - threads = 1
7 - proc_name = ${gunicorn_proc_name}
8 - worker_class = sync
9 - worker_connections = 10
10 - max_requests = 1000
11 - max_requests_jitter = 30
12 - timeout = 21600
13
14 """
4 """
15
5
16 import gc
6 import gc
@@ -247,9 +237,11
247
237
248 def post_request(worker, req, environ, resp):
238 def post_request(worker, req, environ, resp):
249 total_time = time.time() - worker.start_time
239 total_time = time.time() - worker.start_time
240 # Gunicorn sometimes has problems with reading the status_code
241 status_code = getattr(resp, 'status_code', '')
250 worker.log.debug(
242 worker.log.debug(
251 "GNCRN POST WORKER [cnt:%s]: %s %s resp: %s, Load Time: %.4fs",
243 "GNCRN POST WORKER [cnt:%s]: %s %s resp: %s, Load Time: %.4fs",
252 worker.nr, req.method, req.path, resp.status_code, total_time)
244 worker.nr, req.method, req.path, status_code, total_time)
253 _check_memory_usage(worker)
245 _check_memory_usage(worker)
254
246
255
247
Comments 0
You need to be logged in to leave comments. Login now