基于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
相关产品推荐
相关产品推荐

