Accelerating Transparent Ingress Proxy with eBPF and Envoy
In the previous lab we learned what role different features—such as eBPF TC programs, SO_ORIGINAL_DST, and SO_MARK—play in transparently redirecting traffic to Envoy between the client and the server application.
That said, putting a middleman like Envoy into the network path inevitably hurts the performance.
So the real question, then, is how much of this performance tax we can realistically eliminate—if any.
In this lab, we focus on optimizing transparent redirection on the receiving pod using eBPF socket acceleration. We show how eBPF can significantly speed up communication between the Envoy proxy and the application, mitigating much of the performance overhead introduced by the proxy.
The Bottleneck
A side effect of introducing a transparent proxy like Envoy is that packets traverse the kernel networking stack twice, as well as connections being terminated, processed, and forwarded by the proxy.

Let's say you don't take my word for it - here are the benchmark results performed using iperf3 and sockperf comparing the setup with and without Envoy in-between.
![[object Object]](/content/files/tutorials/ebpf-envoy-ingress-acceleration-ad8d4111/__static__/merged-benchmark-envoy.png?v=1781277517402)
💡 Although the benchmark was run in a controlled environment, the absolute numbers are less meaningful because they depend on the specific setup; what really matters is the relative difference between the results.
So almost 20% lower network throughput and more than 2x larger network latency!
A lot of room for improvement and one way to optimize this setup is using eBPF socket acceleration.
Materials by an Independent Author
A separate content pack is required to access this material
Writes about
Frequently covers

eBPF and WASM - Better Together
Learn how Inspektor Gadget pairs eBPF with WASM to process kernel events—and walk through the same idea yourself by implementing a minimal example.

Transparent Ingress Proxy with eBPF and Envoy
This lab shows how to use eBPF to transparently redirect inbound traffic through an Envoy proxy on the server side, without modifying the application or client. You’ll learn how eBPF can intercept and restore connections so the service remains unaware of the proxy in the network path.

Transparent Egress Proxy with eBPF and Envoy
This lab teaches you how to use eBPF to transparently intercept and redirect a client's outgoing traffic to an Envoy proxy without requiring any changes to the application code. You will build a system that recovers original connection metadata via socket-level hooks and uses SO_MARK to prevent infinite routing loops, replacing traditional, complex iptables rules with a high-performance eBPF alternative.

Building an eBPF/XDP NAT-Based (Weighted) Round Robin Load Balancer from Scratch
In this lab, you’ll build a NAT-based eBPF/XDP load balancer from scratch and implement both round-robin and weighted round-robin backend selection. Along the way, you’ll learn how to manage state in eBPF maps and distribute traffic across backends based on simple and capacity-aware scheduling strategies.
