perf(metrics): cache request series handles - #856
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Root cause
The supplied AISIX flame graph attributes material request-path CPU to
metrics::Key::eq,generate_key_hash, label construction, sorting, and drops. The request completion path emitted the proxy and LLM counter/histogram pairs separately, rebuilding the same large dynamic label tuple for each series.The production chat and messages paths always emit the proxy and LLM request series together with the same duration, so the new paired recorder performs one collision-safe cache lookup and reuses the registered handles.
GetBusbar A/B
Measured with the upstream GetBusbar/benchmarking runner at commit
3715e6c952b3a25f99dfb6a7bf9ac7436a79cdf8, OpenAI-only, on the same ARM64 8-vCPU VM. Gateway cores were pinned to 0-3, load generator to 4-5, and mock upstream to 6-7. The adaptive sweep used 6-second rungs. Base was AISIX6202977; optimized production code was44fb078(the later commits only add tests and restore standalone recorder semantics; production handlers still use the paired cached path).Five additional interleaved c=64, 10-second loadgen trials:
Interpretation and limitations
These short samples overlap materially and the base set contains a low outlier. The table is therefore reported as a directional local observation, not as a statistically significant percentage improvement or a merge criterion. The broader repeatable performance investigation remains tracked by api7/AISIX-Cloud#1199.
The optimized GetBusbar load tail was classified
plateaued=falseat +1.63 MiB/min. Its 60-second post-load recovery was flat at 100.895 MiB, but that window is not sufficient to claim a long-term steady-state RSS plateau. The only bounded-memory claim made by this PR is structural: the additional handle cache cannot retain more than 1,024 label sets, which is covered by a regression test.Correctness coverage
Validation
cargo fmt --all -- --checkcargo test -p aisix-obs(152 passed, 5 real-cloud tests ignored)cargo test -p aisix-proxy(763 passed)cargo test -p aisix-server(87 passed)cargo clippy -p aisix-obs -p aisix-proxy -p aisix-server --all-targets -- -D warningsPart of api7/AISIX-Cloud#1199.