物料-采购件入库页面功能实现
This commit is contained in:
21
inventory-backend/gunicorn.conf.py
Normal file
21
inventory-backend/gunicorn.conf.py
Normal file
@ -0,0 +1,21 @@
|
||||
# inventory-backend/gunicorn.conf.py
|
||||
|
||||
import multiprocessing
|
||||
|
||||
# 原来的写法:根据 CPU 自动算,容易在强机上算太多
|
||||
# workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
# --- 优化后的写法 ---
|
||||
# 我们设置一个上限:如果是开发环境或为了省资源,最多不超过 8 个
|
||||
# 这样既有并发能力(8个分身足够开发测试用了),又不会撑爆数据库
|
||||
cpu_calc = multiprocessing.cpu_count() * 2 + 1
|
||||
workers = min(cpu_calc, 8)
|
||||
|
||||
# 线程数保持不变
|
||||
threads = 2
|
||||
|
||||
bind = "0.0.0.0:8000"
|
||||
timeout = 120
|
||||
loglevel = 'info'
|
||||
accesslog = '-' # 输出到标准输出(Docker logs 能看到)
|
||||
errorlog = '-'
|
||||
Reference in New Issue
Block a user