eBPF-Based WAF vs. Traditional Reverse Proxy WAF: Latency and Rule Throughput Compared
eBPF-Based WAF vs. Traditional Reverse Proxy WAF: Latency and Rule Throughput Compared
The direct answer: an eBPF-based WAF intercepts packets in the kernel data path and skips most of the userspace overhead a reverse proxy cannot avoid, so it typically wins on raw latency and rule throughput — sometimes by a wide margin. But the reverse proxy WAF wins on protocol breadth, rule ecosystem, debuggability, and operational familiarity. You are not choosing "fast" versus "slow"; you are choosing where inspection happens and what you are willing to give up to get the speed.
The short answer
For a pure API workload with high request rates and tight latency budgets, an eBPF-based WAF is the stronger candidate on the numbers: filtering happens in the kernel, before packets even reach the userspace networking stack. A traditional reverse proxy WAF (nginx, Envoy, or an appliance) parses each request in userspace, which costs CPU cycles and adds latency per request. However, the reverse proxy remains the more practical choice for most teams because it is easier to operate, supports richer HTTP semantics, and plugs into an ecosystem of tools your engineers already know.
- eBPF-based WAF wins on: per-request latency, throughput at high concurrency, and low CPU overhead.
- Reverse proxy WAF wins on: HTTP/2 and HTTP/3 handling, WebSocket and streaming support, rule debugging, and team familiarity.
- Honest tradeoff: eBPF speed is real, but it buys you little if your origin, database, or TLS termination is the actual bottleneck.
How each architecture works
An eBPF-based WAF attaches programs to kernel hooks (typically on the XDP or TC path) and evaluates rules while packets are still in kernel context, avoiding copies into userspace. A traditional reverse proxy WAF terminates the connection in userspace — often with a full HTTP parser, connection management, and TLS — and runs the ruleset (for example, OWASP Core Rule Set under ModSecurity or Coraza) on each parsed request.
Both belong to the application-layer world: a WAF inspects HTTP content, unlike a network firewall, which makes decisions at OSI Layers 3 and 4 (IP, protocol, port). This matters because DDoS attacks have evolved to Layer 7 application-layer attacks: the traffic looks like legitimate HTTP on port 80 or 443, so L3/L4 filtering alone cannot stop it, and whatever inspects Layer 7 must do so at line rate. SSH traffic on port 22, by contrast, is rarely WAF material at all.
Comparison dimensions used in this guide
- Per-request latency added.
- Maximum rule throughput and CPU cost per request.
- HTTP protocol coverage (HTTP/2, HTTP/3, WebSockets, streaming).
- Rule engine expressiveness and ecosystem.
- Observability and debuggability.
- Deployment and operations complexity.
- Kernel and platform dependencies.
- Cost and capacity model.
Comparison table: eBPF-based WAF vs. reverse proxy WAF
| Dimension | eBPF-based WAF | Reverse Proxy WAF |
|---|---|---|
| Inspection location | Kernel data path (XDP/TC hooks) | Userspace, per parsed request |
| Latency added | Near-zero in favorable cases (pending verification) | Low but measurable; grows with rule count (pending verification) |
| Rule throughput | High — CPU cost is predictable and flat per packet | Bounded by userspace parsing and regex evaluation |
| HTTP protocol support | Limited; deep semantics (multipart, trailers) are harder | Full: HTTP/1.1, HTTP/2, HTTP/3, WebSockets, streaming |
| Rule ecosystem | Growing; often a subset of OWASP CRS mappings | Mature: OWASP CRS, ModSecurity, Coraza, vendor rule packs |
| Debugging | Kernel-level tooling; harder for most teams | Standard logs, access logs, tcpdump, familiar to every engineer |
| Platform dependency | Linux with a recent kernel and BPF permissions | Any platform that runs the proxy; works in containers and VMs |
| Operational fit | Specialist skill required; kernel updates can break programs | Well-trodden ops path; most teams can run nginx/Envoy today |
Where the eBPF-based WAF falls short
- Deep HTTP semantics are hard in kernel context: multipart parsing, chunked encoding, trailers, and protocol-level normalization are where bypass techniques live, and a shallow parser is exactly what attackers probe.
- A published WAFNinja article catalogs 10 WAF bypass techniques every security engineer should know; several of them exploit parsing differences. A kernel-level filter that does not fully normalize the request can be bypassed even when its rules are correct.
- Rule debugging is painful. When a request is misclassified, you are tracing kernel events, not reading an access log.
- Kernel dependency: new kernel versions, security patches, or container runtimes can invalidate your BPF programs, and you own that upgrade risk.
- Limited protocol coverage: if your API uses WebSockets or long-lived streams, an eBPF path may not inspect them at all.
Where the reverse proxy WAF falls short
- Userspace parsing is expensive under load: each request goes through socket reads, buffer copies, and regex evaluation, so rule throughput is bounded by CPU and memory.
- Latency grows with rule count and payload size; a heavy ruleset with many regex rules can add visible overhead per request (exact numbers pending verification).
- It is a connection-terminating middlebox: TLS termination, keep-alive handling, and buffer limits all become your problem, and each is a potential denial-of-service surface.
- Under an L7 flood, a reverse proxy can itself become the bottleneck — CPU pegs on parsing before your rules ever run. Hash-collision-style attacks that force expensive parsing can drive CPU to 100% with relatively few requests, which is precisely the failure mode a kernel filter avoids.
- Scaling out means more proxy instances, more connection churn, and more state to manage.
How to choose by scenario
- Extreme request rates and strict latency targets → eBPF-based filtering, but verify parser coverage for your content types first.
- Complex APIs (multipart uploads, streaming, WebSockets) → reverse proxy WAF; protocol correctness beats raw speed here.
- Small security team → reverse proxy WAF; the debugging story alone is worth the latency cost.
- Regulated or air-gapped environments → eBPF or on-prem proxy both work; pick by kernel and tooling skills.
- Defense in depth → run a proxy WAF for full parsing and add an eBPF filter as a cheap first line for known-bad patterns.
Step-by-step: benchmark both against your workload
- Pick one representative endpoint and record baseline latency percentiles (p50, p95, p99) and peak rps without any WAF.
- Deploy the reverse proxy WAF in staging, enable the OWASP Core Rule Set, and re-measure the same percentiles.
- Deploy the eBPF-based WAF on the same node with an equivalent rule set and repeat the measurement.
- Replay a captured production traffic mix — not just synthetic GETs — through both to catch parser gaps.
- Run the 10 bypass technique payloads from the WAFNinja catalog against both and compare what gets blocked.
- Load-test with your largest realistic payload sizes; small-payload benchmarks flatter kernel filters.
- Compare operational burden: patch cycles, kernel compatibility, and how long it takes your team to debug a false positive in each.
Cost and total cost of ownership
- Software: both models have capable open source options, so license cost is rarely the deciding factor.
- Hardware: eBPF lets you push more requests per node, which can shrink your fleet; reverse proxy needs more CPU per request (pending verification of specific ratios).
- Staff: the reverse proxy's ops cost is lower for most teams; the eBPF path costs more in specialist time, which is the line item most TCO estimates forget.
- Downtime risk: a kernel-level bug affects the whole node; a proxy bug affects one instance. Factor that asymmetry into your risk budget.
Common mistakes to avoid
- Benchmarking with tiny payloads and concluding the eBPF WAF is "10x faster" on your real workload.
- Assuming kernel-level filtering sees the full HTTP picture — bypass techniques that exploit parser differences still apply.
- Running the eBPF filter on nodes with an unsupported kernel and discovering it silently stops filtering after an upgrade.
- Forgetting that the origin, TLS, or database is the real bottleneck; no WAF architecture fixes that.
- Keeping the reverse proxy's default ruleset untouched and blaming the WAF when legitimate traffic gets blocked.
FAQ
How much faster is an eBPF WAF really?
In controlled benchmarks the kernel path can show dramatically lower latency and higher throughput than a userspace proxy (specific figures pending verification). On a real API, the gap depends on payload sizes, rule count, and where the rest of your stack bottlenecks. Measure your workload; do not trust vendor charts.
Can an eBPF WAF fully replace a reverse proxy WAF?
Only if your API traffic is simple enough for the kernel parser to handle completely — plain JSON POSTs with no exotic encodings. The moment you need multipart handling, HTTP/3, WebSockets, or deep normalization, you are back to a userspace component.
Is the OWASP Core Rule Set available on eBPF WAFs?
Partially. Some projects map CRS rules onto kernel programs, but coverage and fidelity vary, and rule parity should be verified before production. Check which CRS rules are implemented and test bypass payloads directly.
Which one should a team with no BPF experience choose?
The reverse proxy WAF. The operational and debugging costs of kernel-level filtering are real, and speed only matters if your origin can keep up anyway.
Sources and verification
Verified facts (evidence A, from WAFNinja's published documentation, verified 2026-08-04): DDoS attacks have evolved to Layer 7 application-layer attacks; network firewalls make decisions at OSI Layers 3 and 4; web traffic uses port 80 (HTTP); SSH uses port 22; a WAFNinja article lists 10 WAF bypass techniques every security engineer should know; hash-collision attacks can drive parser CPU to 100% with a few thousand requests; cache-bypass attacks can multiply request load by 10,000. All latency, throughput, and benchmark figures are pending verification unless a specific source is cited. Last verified: 2026-08-04.