feat: 限制知识库上传并发 - #58
Open
MoChiUaena wants to merge 1 commit into
Open
MoChiUaena wants to merge 1 commit into
MoChiUaena wants to merge 1 commit into
Conversation
- 每实例默认最多四个同步上传,超限返回繁忙提示,正常或异常退出后释放名额 - 保留请求频率限制和原有上传链路,补充并发、异常释放与配置回归测试 - 最终后端 372 项通过、45 项原有禁用,前端及浏览器各 22 项通过;复验中的 TTS 超时记录保留
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
慢上传会持续占用同步上传链路,现有的请求频率限制和单页面上传队列无法限制服务端同时处理的上传数量。
在知识库上传 Service 入口增加单实例并发限制,默认 4 个,可通过
APP_KNOWLEDGE_BASE_UPLOAD_MAX_CONCURRENT调整。超限时沿用 HTTP 200 + Result,返回 8001 和“知识库上传繁忙,请稍后重试”;正常返回、异常或中断退出后释放名额。原有频率限制、去重、文件保存失败补偿和向量化投递流程保持不变。这是 #52 中提到的后端保护后续工作,前端批量上传已在 #56 完成。限制不覆盖进入 Service 前的 multipart 接收,也不合并多个应用副本的额度。
验证:
复验中,未修改的 TTS 握手测试曾出现一次 2 秒超时。该用例单独重跑、未修改基准的完整测试以及最终补丁的完整测试均通过,但偶发原因尚未完全确定,未调整超时或删改断言。
本地 Windows 测试使用了只调整 classpath 路径的临时脚本,未放入补丁。浏览器使用现有模拟 API;真实 S3/PostgreSQL 负载压测和需要付费模型调用的 RAG 测评未运行。