LiteLLM代理 - Locust负载测试
Locust负载测试 LiteLLM代理
- 在您的代理配置文件
config.yaml中添加fake-openai-endpoint,并启动您的LiteLLM代理 LiteLLM提供了一个免费的托管fake-openai-endpoint,您可以针对其进行负载测试
model_list:
- model_name: fake-openai-endpoint
litellm_params:
model: openai/fake
api_key: fake-key
api_base: https://exampleopenaiendpoint-production.up.railway.app/
pip install locust在您的本地机器上创建一个名为
locustfile.py的文件。从LiteLLM负载测试文件中复制内容,该文件位于此处启动Locust 在步骤2中的
locustfile.py所在目录下运行locustlocust终端输出
[2024-03-15 07:19:58,893] 启动Web接口于 http://0.0.0.0:8089
[2024-03-15 07:19:58,898] 启动Locust 2.24.0在Locust上运行负载测试
访问Locust UI于 http://0.0.0.0:8089
设置用户数=100,用户增长数=10,主机=LiteLLM代理的基本URL
预期结果
预期看到以下
/health/readiness的响应时间 中位数 → /health/readiness 是150ms平均值 → /health/readiness 是
219ms