
04
Why Pod-to-Service Traffic Is Slower Than Pod-to-Pod Traffic
Pod-to-service traffic can be surprisingly slower than pod-to-pod calls here’s why and how to fix it.
In a bustling fintech start-up in Austin, a latency spike in a microservice that handled real‑time stock quotes sent the on‑call team scrambling. The service was calling another component through its Kubernetes Service, yet a direct pod‑to‑pod curl test returned results in half the time. The mystery deepened when the same request, routed through the Service’s Cluster IP, took 120 ms instead of 55 ms. The root cause wasn’t a buggy application; it was the networking path itself. Such disparities are more common than many admit, and they reveal hidden costs in the way Kubernetes abstracts traffic.
A Closer Look at Pod-to-Service Traffic
Pod‑to‑service traffic refers to any request that a pod sends to a Kubernetes Service object rather than addressing another pod directly by its IP. The Service acts as an abstraction layer, providing a stable DNS name and load‑balancing across a set of endpoints. When a pod resolves my‑service.default.svc.cluster.local, the request is intercepted by the kube‑proxy (or an equivalent data‑plane) and then forwarded to one of the service’s backing pods.
At first glance this seems harmless after all, the Service offers resilience and decouples callers from the exact location of pods. However, each extra hop introduces processing overhead, additional network hops, and potential policy enforcement that can add measurable latency. In clusters that run high‑frequency, low‑latency workloads (e.g., financial tick data, online gaming, or real‑time analytics), the difference between a 55 ms round‑trip and a 120 ms round‑trip can translate into lost revenue or degraded user experience.
- Network Hop Count
- Pod-to-Pod: 1 hop (direct overlay)
- Pod-to-Service: 2 hops (overlay + kube-proxy)
- IP Tables Processing
- Pod-to-Pod: None
- Pod-to-Service: Yes (DNAT/SNAT)
- Load-Balancing Decision
- Pod-to-Pod: Client chooses the endpoint
- Pod-to-Service: kube-proxy chooses the endpoint for each request
- Policy Enforcement
- Pod-to-Pod: Network Policy may apply
- Pod-to-Service: Additional Network Policy + Service Policy checks may apply
Leading Pod-to-Service Optimization Solutions
1. Use IPVS Mode for kube‑proxy
IPVS (IP Virtual Server) replaces the iptables chain with a high‑performance kernel load balancer. It reduces rule count and speeds up connection handling.
When a cluster switches from iptables to IPVS, the average pod‑to‑service latency can drop by 30‑40 % in large deployments. The kernel module keeps a hash table of service endpoints, allowing O(1) lookups instead of traversing long iptables chains.
What You Gain:
- Faster packet forwarding with minimal CPU overhead.
- Scalable handling of thousands of services without rule bloat.
- Better connection persistence for long‑lived streams.
2. Deploy Service Mesh Sidecars (e.g., Istio)
A service mesh injects a lightweight proxy (Envoy) alongside each pod. While this adds a process, the proxy can perform intelligent routing, caching, and TLS termination locally.
By moving load‑balancing decisions to the sidecar, the mesh eliminates the need for kube‑proxy hops for intra‑namespace traffic. The result is often lower tail latency and richer observability.
What You Gain:
- Fine‑grained traffic shaping without kernel modifications.
- Built‑in retries, circuit breaking, and metrics.
- End‑to‑end encryption with minimal application changes.
3. Enable Direct Pod IP Access via Headless Services
Headless services (Cluster IP set to "None") expose the actual pod IPs through DNS. Callers can resolve the service name to a list of pod IPs and pick one directly.
This bypasses kube‑proxy entirely for intra‑cluster calls, turning a pod‑to‑service request into a pod‑to‑pod request while still preserving service discovery semantics.
What You Gain:
- Zero extra hop; true direct communication.
- Reduced NAT overhead and faster connection setup.
- Compatibility with existing Service APIs.
4. Adopt Cilium with eBPF‑Based Load Balancing
Cilium replaces traditional iptables with eBPF programs that run in the kernel. These programs can perform load balancing at the socket level, avoiding the iptables traversal entirely.
Clusters that migrated to Cilium reported up to 50 % latency reduction for pod‑to‑service traffic, especially under high concurrency where iptables chains become a bottleneck.
What You Gain:
- High‑performance packet processing without kernel module changes.
- Dynamic policy enforcement with minimal impact.
- Observability hooks directly in the data path.
5. Fine‑Tune Service Topology & Endpoint Slices
Kubernetes 1.21 introduced Service Topology, allowing services to prefer endpoints in the same node, zone, or region. Combined with Endpoint Slices, the scheduler can keep the endpoint list small and locality‑aware.
When pods call a service that prefers same‑node endpoints, the network path often collapses to a single virtual Ethernet pair, shaving off microseconds of latency.
What You Gain:
- Improved locality reduces cross‑node hops.
- Smaller Endpoint Slice payloads speed up DNS lookups.
- Better utilization of node‑local caches.
Why People Are Paying Attention
✔ Latency‑Sensitive Applications
Financial trading platforms, online gaming, and AI inference services require sub‑100 ms round‑trips. Even a modest increase can cause missed opportunities or poor user experience.
✔ Cost of Cloud Bandwidth
Extra hops consume more bandwidth and can increase egress charges in managed clusters. Reducing unnecessary traffic translates directly to lower bills.
✔ Resource Saturation
When iptables rules grow into the thousands, CPU cycles are spent on rule matching rather than application work, leading to higher pod CPU usage.
✔ Observability Gaps
Service‑level metrics often mask the underlying pod‑to‑pod latency. Understanding the difference helps teams pinpoint bottlenecks.
✔ Security Policies
Network Policies applied at the Service level add extra checks that can slow traffic, prompting architects to reconsider the placement of policies.
✔ Evolution of Kubernetes Networking
New data planes like Cilium and eBPF are reshaping expectations around performance, making the old iptables model look outdated.
What to Expect Next
- Widespread adoption of eBPF‑based networking plugins across major cloud providers.
As vendors integrate eBPF natively, the default kube‑proxy will likely become optional, offering out‑of‑the‑box low‑latency paths. - Standardization of Service Topology APIs.
Future releases will make locality hints mandatory for high‑throughput services, reducing cross‑zone traffic by default. - Automated latency‑aware Service routing.
Control planes will begin to monitor per‑request latency and dynamically adjust endpoint selection without human intervention. - De‑precation of iptables‑only mode in favour of IPVS or eBPF.
Clusters still on iptables will receive warnings, and upgrade guides will emphasize performance gains. - More granular Network Policy enforcement points.
Policy engines will move closer to the socket layer, allowing decisions to be made before any packet leaves the pod, trimming overhead.
- IPVS kube-proxy
- Average Latency Reduction: 30%
- Implementation Complexity: Low
- Service Mesh (Istio)
- Average Latency Reduction: 20%
- Implementation Complexity: Medium
- Cilium eBPF
- Average Latency Reduction: 50%
- Implementation Complexity: Medium-High
- Headless Service Direct IP
- Average Latency Reduction: 10–15%
- Implementation Complexity: Low
The Big Picture
Pod‑to‑service traffic carries hidden costs that become apparent under latency‑critical workloads. By understanding the extra hops, NAT processing, and policy checks, teams can choose the right tooling whether IPVS, eBPF, or headless services to bring performance back in line with expectations. The shift toward smarter, kernel‑level networking promises a future where the abstraction of Services no longer compromises speed.
Contact
Missing something?
Feel free to request missing tools or give some feedback using our contact form.
Contact Us