<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4" -->

---
title: Your Kubernetes Service is the wrong backend for LLMs
description: A plain Kubernetes Service balances connections, not prompt cost, so LLM chat traffic with shared prefixes lands on replicas without that cached context and...
canonical: https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Your Kubernetes Service is the wrong backend for LLMs | daily.dev
og:description: A plain Kubernetes Service balances connections, not prompt cost, so LLM chat traffic with shared prefixes lands on replicas without that cached context and...
og:url: https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4
og:image: https://api.daily.dev/og/posts/Lu57PtLg4.png
og:image:alt: Your Kubernetes Service is the wrong backend for LLMs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Your Kubernetes Service is the wrong backend for LLMs

**[Trends](https://daily.dev/sources/trends)** · 3 min read · 16 upvotes · 2 comments

## Summary

A plain Kubernetes Service balances connections, not prompt cost, so LLM chat traffic with shared prefixes lands on replicas without that cached context and the GPU recomputes it. In a lab test, a plain Service and an Istio gateway both hit a 0.50 prefix-cache rate and about 1700ms p99 time-to-first-token. A Gateway API InferencePool with an Endpoint Picker reached 0.80 and 1136ms. On EKS running vLLM, hit rate rose from 0.717 to 0.849. SGLang v0.4's cache-aware router lifted throughput about 1.9x. The picker adds a failure point: FailClose returns HTTP 500s, while FailOpen silently falls back to round-robin.

## Content

The loudest point in the inference-on-Kubernetes conversation right now: a plain Service is a bad way to route LLM traffic, and your GPUs are paying for it. Round-robin and least-request balancing treat every request as equal. They aren't. A chat turn with a shared prefix is far cheaper on the replica that already holds its KV cache.

## The numbers people are citing

One lab test sent traffic through a plain Service or an Istio gateway with LEAST_REQUEST. Prefix-cache hit rate came out at 0.50, with p99 time-to-first-token around 1700ms. Swapping the backend for a Gateway API InferencePool with an Endpoint Picker (EPP) raised the hit rate to 0.80 and dropped p99 TTFT to 1136ms. On real EKS hardware running vLLM, the hit rate went from 0.717 to 0.849.

The EPP scores pods by queue depth, KV cache usage and prefix locality. A busier replica with a warm prefix can beat an idle one that has to reprocess the whole prompt.

The same idea shows up elsewhere. SGLang v0.4's router kept an approximate cache view and lifted cache hits from 20% to 75% on a shared-prefix benchmark. Throughput rose from 82,665 to 158,596 tokens per second, about 1.9x. NVIDIA Dynamo combines reusable cache state with projected workload.

An Akamai-commissioned survey of 200 AI practitioners adds the pain. 64% need end-to-end responses in 250ms or less. Cast AI puts average GPU utilization across clusters at 5%. 51% of teams keep using the same model even while it degrades. One customer that moved to an inference-aware gateway saw prefix-cache hits double from 35% to 70%, with TTFT down by more than 35%.

## The catch: your picker is now critical path

The sharpest warning is about the EPP itself. With failureMode set to FailClose, killing the picker made every request return HTTP 500. With FailOpen, routing quietly reverted to round-robin and there were no visible errors. Your dashboards stay green while your cache hit rate and latency slide back to where you started. Pick your failure mode deliberately.

## A working reference build

A hands-on walkthrough shows the full setup. A single OpenAI-compatible gateway built on Agentgateway routes to self-hosted models. A pre-routing policy copies the request's `model` field into an `x-model` header, and each InferencePool gets its own EPP. The demo serves Qwen2.5-3B on two T4 GPUs and SmolLM2-1.7B on one. If a local pool returns 503 or 429, it's evicted for 15 seconds and traffic falls back to OpenRouter. The cluster costs about $0.85 per hour on GCP.

## The recommended playbook

The Akamai speakers boil it down to five steps: start from a conformant cluster, cut startup time, autoscale on queue depth and KV cache, add an inference-aware gateway, and set SLOs on time to first token.

## Community discussion

Top comments from developers on daily.dev.

**@pdfopsdev** · 0 upvotes

> fwiw the FailOpen default is the scarier choice imo, you lose the whole cache benefit exactly when the picker is under load and nothing pages anyone about it. FailClose at least fails loud.

**@maolrate** · 0 upvotes

> Worth measuring prefix diversity before investing in EPP. The 0.50 to 0.80 jump depends on requests carrying poorly shared prefixes. If most of your traffic comes from one agent harness with the same big system prompt, plain round-robin already lands on a warm replica and you will measure almost nothing. Cheapest test: an hour of logging vLLM's per-request num_cached_tokens from the response usage plus a hash of the first ~1k tokens, grouped by replica. Small hash set means the fleet is one cache, not N.
>
> Two things I'd add to the runbook. Scale-down is cache destruction, so evict replicas...

## Similar posts on daily.dev

- [Intelligent inference scheduling with llm-d on Red Hat AI](https://daily.dev/posts/intelligent-inference-scheduling-with-llm-d-on-red-hat-ai-q8lqp3mss) · Red Hat Developer · 0 upvotes · 0 comments
- [GKE Inference Gateway prefix caching accelerates AI inference](https://daily.dev/posts/gke-inference-gateway-prefix-caching-accelerates-ai-inference-qyjrx3igz) · Google Cloud · 1 upvotes · 0 comments
- [The Inference Tax: How Prefix-Aware Routing Eliminates the Hidden Cost of LLMs at Scale](https://daily.dev/posts/the-inference-tax-how-prefix-aware-routing-eliminates-the-hidden-cost-of-llms-at-scale-eej7jbkjc) · DigitalOcean · 0 upvotes · 0 comments
- [How llm-d routes model inference traffic on Amazon EKS](https://daily.dev/posts/how-llm-d-routes-model-inference-traffic-on-amazon-eks-tlb0xiou0) · Red Hat Developer · 0 upvotes · 0 comments

---

Tags: [#kubernetes](https://daily.dev/tags/kubernetes), [#ai-inference](https://daily.dev/tags/ai-inference), [#vllm](https://daily.dev/tags/vllm), [#istio](https://daily.dev/tags/istio)

[View this post on daily.dev](https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Your Kubernetes Service is the wrong backend for LLMs","url":"https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4"},"datePublished":"2026-11-27T22:24:52.082Z","dateModified":"2026-12-04T19:07:20.205Z","description":"A plain Kubernetes Service balances connections, not prompt cost, so LLM chat traffic with shared prefixes lands on replicas without that cached context and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0ef93e8136a95ddaf64838f62d0ad369?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0ef93e8136a95ddaf64838f62d0ad369?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Trends","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Trends","logo":"https://media.daily.dev/image/upload/s--ZfSp3asX--/f_auto,q_auto/v1780996004/logos/trends?_a=BAMAMiWQ0","url":"https://daily.dev/sources/trends"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":16},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"kubernetes,ai-inference,vllm,istio","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Trends","item":"https://daily.dev/sources/trends"},{"@type":"ListItem","position":3,"name":"Your Kubernetes Service is the wrong backend for LLMs"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/your-kubernetes-service-is-the-wrong-backend-for-llms-lu57ptlg4","comment":[{"@type":"Comment","text":"fwiw the FailOpen default is the scarier choice imo, you lose the whole cache benefit exactly when the picker is under load and nothing pages anyone about it. FailClose at least fails loud.","datePublished":"2026-11-28T18:01:18.890Z","url":"https://daily.dev/posts/Lu57PtLg4#c-JQQvyszNj","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"}},{"@type":"Comment","text":"Worth measuring prefix diversity before investing in EPP. The 0.50 to 0.80 jump depends on requests carrying poorly shared prefixes. If most of your traffic comes from one agent harness with the same big system prompt, plain round-robin already lands on a warm replica and you will measure almost nothing. Cheapest test: an hour of logging vLLM’s per-request num_cached_tokens from the response usage plus a hash of the first ~1k tokens, grouped by replica. Small hash set means the fleet is one cache, not N.\nTwo things I’d add to the runbook. Scale-down is cache destruction, so evict replicas whose prefix set is mostly cold and drain before delete, otherwise every HPA event resets the number you are trying to optimize. And a 429/503 retry at the gateway duplicates prefill work that had already partially landed; with FailOpen you can get silent round-robin plus a retry storm, which shows up as a latency regression rather than a routing failure.","datePublished":"2026-12-05T03:52:18.892Z","url":"https://daily.dev/posts/Lu57PtLg4#c-YaHiCBTWi","author":{"@type":"Person","name":"허순연","url":"https://daily.dev/maolrate","image":"https://lh3.googleusercontent.com/a/ACg8ocKqzVcw8fr6wVR5_vM1l3arosjR6u0Z0itQbU2y_0C-SjfKmH4=s96-c"}}]}
```

