|
|
@@ -1,4 +1,5 @@
|
|
|
# Sample Gunicorn configuration file.
|
|
|
+from pool.thread_pool import init_workers
|
|
|
|
|
|
#
|
|
|
# Server socket
|
|
|
@@ -65,7 +66,7 @@ backlog = 2048
|
|
|
# A positive integer. Generally set in the 1-5 seconds range.
|
|
|
#
|
|
|
|
|
|
-workers = 1
|
|
|
+workers = 5
|
|
|
worker_class = 'sync'
|
|
|
worker_connections = 1000
|
|
|
timeout = 15
|
|
|
@@ -181,6 +182,11 @@ proc_name = None
|
|
|
# A callable that takes a server instance as the sole argument.
|
|
|
#
|
|
|
|
|
|
+
|
|
|
+def on_starting():
|
|
|
+ init_workers()
|
|
|
+
|
|
|
+
|
|
|
def post_fork(server, worker):
|
|
|
server.log.info("Worker spawned (pid: %s)", worker.pid)
|
|
|
|