mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Optimize serialization and jwt performance (#382)
* Optimize serialization and algorithm performance * Fix get tree data to async * Removed CPU-intensive multi-threaded execution * Update pdm pre commit to 2.18.0 * Add jwt user info cache * Update ci * Fix ci * Fix redis delete prefix * Adapt to JWT user instance * Update jwt middleware token parse
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
# fmt: off
|
||||
# 监听内网端口
|
||||
bind = "0.0.0.0:8001"
|
||||
bind = '0.0.0.0:8001'
|
||||
|
||||
# 工作目录
|
||||
chdir = "/fba/backend/"
|
||||
chdir = '/fba/backend/'
|
||||
|
||||
# 并行工作进程数
|
||||
workers = 1
|
||||
@@ -22,25 +23,25 @@ timeout = 120
|
||||
daemon = False
|
||||
|
||||
# 工作模式协程
|
||||
worker_class = "uvicorn.workers.UvicornWorker"
|
||||
worker_class = 'uvicorn.workers.UvicornWorker'
|
||||
|
||||
# 设置最大并发量
|
||||
worker_connections = 2000
|
||||
|
||||
# 设置进程文件目录
|
||||
pidfile = "/fba/gunicorn.pid"
|
||||
pidfile = '/fba/gunicorn.pid'
|
||||
|
||||
# 设置访问日志和错误信息日志路径
|
||||
accesslog = "/var/log/fastapi_server/gunicorn_access.log"
|
||||
errorlog = "/var/log/fastapi_server/gunicorn_error.log"
|
||||
accesslog = '/var/log/fastapi_server/gunicorn_access.log'
|
||||
errorlog = '/var/log/fastapi_server/gunicorn_error.log'
|
||||
|
||||
# 设置这个值为true 才会把打印信息记录到错误日志里
|
||||
capture_output = True
|
||||
|
||||
# 设置日志记录水平
|
||||
loglevel = "debug"
|
||||
loglevel = 'debug'
|
||||
|
||||
# python程序
|
||||
pythonpath = "/usr/local/lib/python3.10/site-packages"
|
||||
pythonpath = '/usr/local/lib/python3.10/site-packages'
|
||||
|
||||
# 启动 gunicorn -c gunicorn.conf.py main:app
|
||||
|
||||
Reference in New Issue
Block a user