Kaynağa Gözat

add gunicorn.config.py

liqian 2 yıl önce
ebeveyn
işleme
71ccb5b77b
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  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"