Explorar o código

add gunicorn.config.py

liqian %!s(int64=2) %!d(string=hai) anos
pai
achega
71ccb5b77b
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      gunicorn.config.py

+ 16 - 0
gunicorn.config.py

@@ -0,0 +1,16 @@
+import os
+from multiprocessing import cpu_count
+# 日志配置
+# 本地日志存储路径
+log_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "logs")
+if not os.path.exists(log_path):
+    os.makedirs(log_path)
+loglevel = "info"
+accesslog = os.path.join(log_path, 'access.log')
+errorlog = os.path.join(log_path, 'error.log')
+
+# workers = 5
+workers = 2 * cpu_count() + 1
+# 设置工作模式为协程
+worker_class = "gevent"
+bind = "0.0.0.0:5002"