mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
Update benchmark_serving.py (#5861)
This commit is contained in:
@@ -491,8 +491,14 @@ async def benchmark(
|
||||
# 多ip按DP均分并发
|
||||
assert max_concurrency, "multi-IP 模式必须指定 max_concurrency"
|
||||
n_ip = len(ip_list)
|
||||
concurrency_per_ip = max_concurrency // n_ip
|
||||
concurrency_remainder = max_concurrency % n_ip
|
||||
if max_concurrency < n_ip:
|
||||
print(
|
||||
f"[WARN] max_concurrency({max_concurrency}) < IP 数({n_ip}),"
|
||||
f"已自动兜底为每个 IP 1 并发,"
|
||||
f"实际总并发将变为 {n_ip}"
|
||||
)
|
||||
concurrency_per_ip = max(1, max_concurrency // n_ip)
|
||||
concurrency_remainder = max(0, max_concurrency - concurrency_per_ip * n_ip)
|
||||
|
||||
# 分配请求
|
||||
req_per_ip = len(input_requests) // n_ip
|
||||
|
||||
Reference in New Issue
Block a user