You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于FastAPI+Gunicorn+Uvicorn的微服务,每个应配置多少Worker?

FastAPI微服务Worker数量分配疑问

我不确定每个基于FastAPI的微服务应声明多少个Worker。我了解到Worker数量的计算公式为:

number_of_workers = number_of_cores x num_of_threads_per_core + 1

如果我有4个基于FastAPI的服务,且服务器为4核8线程,是否需要按服务分配Worker?例如:

number_of_workers = 4 x 8 + 1
number_of_workers = 33

fastapi_service_1 - 9 workers
fastapi_service_2 - 8 workers
fastapi_service_3 - 8 workers
fastapi_service_4 - 8 workers

内容的提问来源于stack exchange,提问作者Ignac96

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 21:40:22