Conversation
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.
概述
优化大账号池下的账号选择、并发状态读取与缓存失效路径,降低选号阶段的 CPU、内存及 Redis 压力,同时保持模型能力、额度、账号等级、优先级、粘性会话和故障转移语义不变。
主要改动
last_used_at更新从健康状态写入中拆分,普通成功请求不再触发路由缓存重建。配置兼容性
性能验证
本地 Apple M4 Pro、10,000 个候选账号微基准:
正常分段路径下,首轮动态并发状态读取从 10,000 个账号缩小至 64 个;极端满载时仍会自动回退完整池,保证可用性。
验证
go test ./... -count=1go test -racego vet ./...pnpm lintpnpm buildgit diff --check未在真实生产 PostgreSQL + Redis 大池中复现原报告的具体首字时间,因此性能数据仅代表本地选号微基准,不将其表述为生产端到端结果。