Fix some issues
This commit is contained in:
+15
-2
@@ -12,8 +12,21 @@ worker_connections= 2000
|
||||
timeout = 300
|
||||
keepalive = 75
|
||||
|
||||
# Preloading ensures eventlet.monkey_patch() in run.py runs once before fork
|
||||
preload_app = True
|
||||
# preload_app must be False with the eventlet worker.
|
||||
#
|
||||
# With preload_app = True, gunicorn loads the WSGI app in the master process
|
||||
# before forking workers. At that point gunicorn's own internals have already
|
||||
# imported `logging` and other stdlib modules, creating real OS RLocks.
|
||||
# The eventlet worker calls eventlet.monkey_patch() at its own import time —
|
||||
# but that import happens *after* the master has already loaded the app, so
|
||||
# the patch arrives too late and eventlet emits:
|
||||
# "1 RLock(s) were not greened"
|
||||
#
|
||||
# With preload_app = False, workers are forked first. The eventlet worker
|
||||
# module is imported inside each worker process, its module-level
|
||||
# monkey_patch() fires before the app is loaded, and all subsequent imports
|
||||
# (including logging) get the green versions from the start.
|
||||
preload_app = False
|
||||
|
||||
# Application
|
||||
wsgi_app = "run:app"
|
||||
|
||||
Reference in New Issue
Block a user