소스 검색

Merge branch 'gunicorn-config-20220913' into test

liqian 2 년 전
부모
커밋
7619ae3027
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      gunicorn.config.py

+ 3 - 1
gunicorn.config.py

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