No long-term view of inference server performance to compare against current performance
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
Read core/cost/usage/usage.go, core/cost/ledger/row.go, writer.go, and query.go, then trace archive replay in cmd/cortex/archive.go. First decide what durable performance data and baseline the feature should use, and how long-window results should be bucketed. Done means performance history can be compared across time and distinguished by server and model; the issue leaves those design choices open.
由索引模型根据 Issue 内容生成。
描述
Summary
To decide whether to switch inference servers, you need to know whether the one you are on is slower or less reliable than it usually is. That needs two things side by side: how it is doing now, and how it did over the last week or month. Cortex can show the first, roughly (see #1465 for why "roughly"), but not the second. It keeps no long-term record of how a server performed, only of what it cost.
The problem
-
Latency is gone after 6 hours. Response times live only in the in-memory usage ring: 360 one-minute buckets (
usage.NumBuckets,BucketWidth).window=24his refused withwindow 24h0m0s exceeds the 6h0m0s retained. After a restart, the ring refills only from the session archive's last six hours (usageReplayBudget,cmd/cortex/archive.go). -
The durable store records cost, not performance. The cost ledger (
core/cost/ledger) keeps per-minute rows on disk for 31 days, keyed by endpoint, model and agent. Its rows holdusage.Counts: requests, errors and token counts. They hold no latency, because latency is kept besideCountsin the ring bucket (latSum,latSumSq,latN), not inside it. A7dwindow on a live proxy returnslatMeanMs0 for every endpoint. -
Long windows come back as one number, not a trend.
today,7dandmonthare served from the ledger as a single bucket covering the whole window (bucketSeconds: 604800for7d, whateverresolutionis asked for). So even the error rate, which the ledger does keep, cannot be plotted over days. Only those three windows exist:30dis refused, and nothing lies between6handtoday. -
The errors kept on disk cannot be told apart. The ledger stores
Errorsas a count, without the status. A 429 (rate limited: wait, or switch) and a 5xx (server broken: switch) call for different responses, and the ledger merges them. Only the 6-hour ring hasgroup=status. -
The latency we do record measures the wrong thing for this question.
SessionEvent.Durationis total wall time, from the request entering the listener to the response being recorded. It grows with how long the answer is and includes Cortex's own plugin time. A server that has slowed down and an agent that asked for a longer answer look the same. There is no time-to-first-token, and no decode speed (tokens per second) (#951), and only a mean with standard deviation, with no percentiles (#1026). -
History is not tied to a server. Ledger rows are keyed by endpoint (host), not by router server name, and a server's URL can change. The same mapping gap as #1465 applies here, over a longer span.
The raw material does exist: the session archive keeps 30 days of events on disk, each with durationMs, host, status and token counts. But only its last six hours are ever replayed, and nothing aggregates it beyond that.
What the live proxy can and cannot say today
Last 7 days from the ledger (/v1/usage?window=7d&group=endpoint):
| server | requests | errors | latency over the week | trend over days |
|---|---|---|---|---|
ete-int |
9711 | 368 (3.8%) | not stored | not available |
glm |
6183 | 153 (2.5%) | not stored | not available |
Set against the 6-hour view in #1465 (glm at 50% errors over 6 requests), this is exactly the comparison the feature is for. The data needed to make it is either missing (latency) or flattened (one total per week).
Questions for the fix
- What performance data should be durable: latency sum, sum of squares and count per row (cheap; matches the ring), or a histogram, which percentiles (#1026) need?
- Should that data live in the cost ledger, which is already per-minute, keyed by endpoint and model, and kept 31 days, or in a separate store? The ledger currently admits inference traffic only, which is the right scope for this.
- Should long windows be plotted as a series (for example hourly buckets for 7 days, daily for a month) instead of one total?
- What is the baseline: the same server over the last 7 or 30 days, or that server and model at the same hour of day?
- How does this relate to #1400, which proposes alerting from a per-(endpoint, model) baseline? That issue needs the same durable data. This one adds a view where a person makes the comparison themselves. One store should serve both.
- Should a baseline be per server or per (server, model)? A slower model on the same server is not a degraded server.
Pointers
- In-memory ring:
core/cost/usage/usage.go(bucket,foldInto,NumBuckets). - Ledger:
core/cost/ledger/row.go(Row, its key),writer.go(Record's inference-only admission,Errors),query.go(single-bucket answers). - Archive replay:
cmd/cortex/archive.go(replayUsage,usageReplayBudget); archive retention is incore/session/archive(30 days). - Event timing:
pipeline.SessionEvent.Duration. - Related: #1465 (the pane mixes servers), #1400 (performance alerts), #951 (TTFT and response-time metrics), #1026 (percentiles).
Assisted-By: Claude (Anthropic AI) [email protected]
- 主要语言
- Go
- 星标
- 18
- 派生
- 42
- 平均合并
- 12 小时 57 分钟
- 30 天内合并 PR
- 236
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rossoctl/cortex 的其他 Issue
-
UI shows costs for all sessions even when drilled into a session可能已有人在做 @esnible 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
rossoctl/cortex#1116 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
enhancement laptop
维护者通常 1 天内回复
-
Session titled with a paste's own tag, e.g. <pasted_content id="8f8e">可能已有人在做 @esnible 于 1 天前认领。 未关闭bug
难度 4/5 1-2 天 新手友好度 68/100
rossoctl/cortex#1492 · 已指派 1 人 ·
维护者通常 1 天内回复
-
laptop
难度 5/5 一周以上 新手友好度 15/100
维护者通常 1 天内回复
-
enhancement Identity
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
slavakurilyak/awesome-ai-agents#845 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 74/100
JakeChampion/lang#13132 ·
维护者通常 1 天内回复
-
[BUG] deploy.restart_policy without condition drops the restart policy可能已有人在做 @akshat-lakhera 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
docker/compose#14383 · 1 条评论 ·
维护者通常 1 天内回复