关于大模型调用预热问题 #4227
Replies: 2 comments
先定性:
|
| 优先级 | 动作 | 成本 | 对 burst 型效果 |
|---|---|---|---|
| 立刻 | Nginx limit_req(delay= 平滑)+ 错峰 cron |
零代码 / 配置 | 直接削峰 |
| 短期 | LLM 调用全局 Semaphore + 退避加 jitter |
小改代码 | 治本 |
| 可选 | limit_burst_rate 单独分类、更长 base / 更少次数 |
小改代码 | 减少惊群 |
| 不建议 | 单纯加 retry_max_attempts / 加大 cap |
改代码 | 多半更糟 |
一句话总结:burst 限流的解法是"削峰填谷 + 控并发",不是"更努力地重试"。 想法 2 是对的;想法 1 单独用会让 8:30 的突刺更严重,除非顺带把退避改成带 jitter、并把次数压低而不是调高。
|
I just created a new feature request #4290 for this issue. |
Uh oh!
There was an error while loading. Please reload this page.
Error code: 429 - {'error': {'message': 'Request rate increased too quickly. To ensure system stability, please adjust your client logic to scale requests more smoothly over time.', 'type': 'limit_burst_rate', 'param': None, 'code': 'limit_burst_rate'}, 'id': '111111', 'request_id': '11111'}
每天早上8.30开始上班,系统高峰期,请求大模型提示上涨速率太快,导致失败,虽然有重试,但是短时间重试还会有加剧异常分享
当前考虑的想法有2种
1.LLMErrorHandlingMiddleware策略调整,重试次数增加,延迟时间和最大时间增加
2.业务上做一些请求流控
还有什么其他现成的好办法解决这问题吗?
All reactions