Topic

Performance Engineering

All digests tagged Performance Engineering

KV Cache-Aware Routing and P/D Disaggregation on Kubernetes — Yuchen Fama & Ashish Kamra, Red Hat thumbnail

· 21:48

KV Cache-Aware Routing and P/D Disaggregation on Kubernetes — Yuchen Fama & Ashish Kamra, Red Hat

This talk details advanced strategies for optimizing LLM inference in complex agentic workloads, moving beyond the limitations of steady-state public benchmarks. The focus is on two critical levers: KV Cache-Aware Routing and Prefill/Decode (P/D) Disaggregation. Implementing these techniques—using frameworks like LLMD—significantly improves latency and throughput by managing volatile cache usage and separating compute-bound prefill from memory-bandwidth-hungry decode phases, particularly in the middle concurrency band.

Key takeaways

  1. Agentic Workloads vs. Benchmarks 5:29

    Real-world agentic workloads exhibit chaotic multi-turn interactions (up to 3,000 turns) with high cache hit rates (>90%) and massive input/output ratios (often >100:1), which standard public benchmarks fail to capture [0:00], [3:29].

  2. KV Cache Routing Optimization 10:28

    Implementing KV cache-aware routing (via Endpoint Picker) is a cost-effective optimization, as the token cost difference between cached and uncached tokens can be as high as 10x [5:12]. This helps solve Time to First Token (TTFT) issues.

  3. P/D Disaggregation Benefits 15:28

    Separating prefill and decode into independent, scalable pods prevents 'phase interference'—where a long prefill stalls token generation (decode)—leading to drastically reduced P99 Inter Token Latency (ITL) from ~900ms down to ~100ms [9:28], [10:46].

  4. Prerequisites for PD 17:26

    Effective P/D disaggregation requires an advanced, high-speed network fabric like RDMA or RoCE to facilitate the transfer of KV caches between prefill and decode workers [10:46]. If such a fabric is unavailable, aggregated serving may be preferable.

Watch on YouTube Full article

AI Agents for Performance: Ship Faster, Pay Less — Rajat Shah, Netflix thumbnail

· 33:39

AI Agents for Performance: Ship Faster, Pay Less — Rajat Shah, Netflix

This talk outlines how Netflix leveraged AI agents to automate performance engineering, addressing the bottleneck of manually identifying and fixing inefficient code patterns in production services. The process involves feeding profiling data (call stacks, CPU usage) into an LLM agent, which identifies suboptimal algorithms (e.g., quadratic-time patterns). The agent then proposes a fix, validates it against a canary deployment using real production traffic, and can even scale the fix across multiple services by identifying common anti-patterns in a centralized catalog. This shifts performance optimization from a reactive, manual effort to a proactive, automated part of the SDLC.

Key takeaways

  1. The Performance Bottleneck 4:00

    Traditional performance engineering is highly manual and time-consuming (taking minutes just to identify hot paths), making it difficult to scale across large codebases. This bottleneck increases as coding agents write code faster, potentially introducing inefficiencies.

  2. AI Agent Workflow for Optimization 12:17

    An LLM agent can automate the entire loop: reading profiling data (call stack/CPU time), identifying anti-patterns (like O(N²) loops), locating the code path in the Git repo, proposing a fix, and validating it via canary deployment.

  3. Scaling Fixes with Pattern Catalogs 21:20

    Instead of fixing one instance, agents can search across multiple services using a centralized 'Pattern/Anti-pattern Catalog' (stored in a Git repo) to find and propose fixes for the same bad pattern repeatedly implemented elsewhere.

  4. Shifting Left: Proactive Performance 26:40

    The goal is to move performance improvement left in the SDLC. The catalog can be used proactively—at code review or even during code authoring—to suggest optimal patterns before suboptimal code reaches production.

Watch on YouTube Full article

May Walter - From Blind Spots to Merged PRs: Runtime Intelligence for Continuous Agentic Performance thumbnail

· 31:16

May Walter - From Blind Spots to Merged PRs: Runtime Intelligence for Continuous Agentic Performance

The talk details implementing a runtime intelligence layer for coding agents to enable continuous performance optimization in mature codebases. The approach moves beyond reactive bug fixing by running sensors in production to capture deep forensic context (e.g., function execution frequency, failure modes). This allows agents to proactively surface high-ROI fixes—such as N+1 queries or missing database indexes—scored by complexity and impact, enabling tech leads to prioritize improvements before sprint planning.

Key takeaways

  1. Automating the Investigation Phase 17:52

    Instead of waiting for performance degradation to become a crisis (a 'leaky bucket' problem), the goal is to automate the investigation phase. This allows teams to identify potential optimizations and their estimated impact/cost without dedicating unpredictable engineering time.

  2. Prioritizing Impact over Task Completion 25:30

    The focus shifts from merely generating pull requests (PRs) to identifying the highest impact, lowest risk changes. The system must provide human-readable context that justifies attention, preventing 'PR fatigue' from agents.

  3. Defining Business Context 22:00

    Effective agentic workflows require more than just code analysis; they need business context. The system must map production activity (endpoints, event consumers) to function-level context to understand the true impact of a potential fix.

Watch on YouTube Full article