[Go 编程语言] 分享一个 Go 池:把“在飞并发”暴露给 KEDA,做 IO 型扩缩容
最近把自用的 Go goroutine 池整理成了 v2.1.3:agilePool。 起因是 IO 等待型服务:下游从 5ms 变 500ms,CPU 反而降到 10–16%,CPU HPA 不扩;队列深度又会在“队列空、任务还在跑”时误缩容。池自己按 Little's Law 算了个 workers_demand,在 capacity clamp 之前暴露;KEDA metrics-api 直接 sum/budget,不需要 Prometheus adapter 或 sidecar。 120s、500ms 风暴实测(单节点 kind,60 req/s): demand:风暴 SLO 80.7%,p99 18.5s CPU HPA:2.7%,p99 132s 队列深度:59.3%,p99 22s 固定 6 副本:100%,但副本秒多 50% 不是银弹:单节点/合成负载,连接重平衡、preStop/drain、下游限流都还得自己做。仓库:https://github.com/Yiming1997/agilePool
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.