Skip to main content
High-Performance L4/L7 Network Proxy

MERIDIAN

Memory safety by construction, not convention.

A Rust-based reverse proxy informed by Envoy, HAProxy, and Nginx. Sub-nanosecond operations, zero-copy buffers, async filter chains. Where the compiler guarantees what code review cannot.

0.38ns

Circuit Check

2.5 GB/s

Parse Throughput

0.73ns

LB Pick

97

Tests

100%

RFC Claims Pass

Explore
Why Another Proxy?

The Compiler Guarantees What Code Review Cannot

Every major proxy has had memory safety CVEs. Envoy, HAProxy, Nginx. Meridian is a ground-up reimplementation in Rust where entire vulnerability classes are eliminated at compile time.

Vulnerability Classes Eliminated

  • Eliminated

    Buffer Overflows

    Rust's ownership prevents buffer access beyond bounds

  • Eliminated

    Use-After-Free

    Borrow checker ensures references outlive their data

  • Eliminated

    Double-Free

    Single ownership model prevents duplicate deallocation

  • Eliminated

    Data Races

    Send + Sync traits prevent concurrent mutable access

  • Memory Safety by Construction

    Not mitigated. Not caught by sanitizers. Eliminated at compile time.

    0 unsafe

    in app code

  • Sub-Nanosecond Operations

    Config reads, circuit checks, and load balancer picks under 1ns.

    0.38ns

    CB check

  • Async Filter Chain

    Filters are async fn, not callbacks. No manual state machines.

    19ns

    5-filter chain

  • Zero-Copy HTTP Parsing

    2+ GB/s throughput using httparse with zero allocation in hot path.

    2.5 GB/s

    parse throughput

“Can you build a proxy that matches the performance of C++ proxies while providing memory safety guarantees that C++ structurally cannot?”
The benchmarks say yes.

FEATURE OVERVIEW

Production-ready features for platform engineers, SREs, and cloud-native infrastructure teams

ProtocolSecurityCoreRoutingResiliencePerformanceObservability
  • HTTP/1.1 proxy with keep-alive
  • HTTP/2 downstream (h2 crate)
  • TLS termination (rustls)
  • Async filter chain
  • Round-robin load balancing
  • Circuit breaker (RAII guards)
  • Connection pooling
  • Active health checking (TCP/HTTP)
  • Chunked transfer encoding
  • Admin API (/stats, /clusters)
  • Path normalization & security
  • Prometheus metrics endpoint
  • Fuzz-hardened parsers
  • Per-IP rate limiting
  • Slowloris defense
  • Least-request (P2C) LB
  • Maglev consistent hashing
  • Request smuggling prevention

18

Features Done

97

Tests Passing

7

Fuzz Targets

13

RFCs

Interactive Proxy Visualization

Performance Timeline

REQUEST TIMELINE

220 nanoseconds from arrival to upstream connection

T+0ns

Request Arrives

TCP accept loop receives connection

T+7.07ns

Buffer Acquired

Slab allocator provides hot buffer from pool

Vec::pop
T+193ns

Headers Parsed

httparse decodes HTTP/1.1 request at 2.5 GB/s

486B typical
T+212ns

Filter Chain

5-filter async pipeline processes request

~1ns/vtable
T+215ns

Route Matched

Config lookup via arc-swap shared reference

O(1) best
T+216ns

Endpoint Selected

Round-robin pick from cluster endpoints

counter + mod
T+216.4ns

Circuit Check

Single atomic load confirms circuit closed

0.38ns
T+220ns

Upstream Connect

Tokio timeout-wrapped connection to backend

RAII guard
~220ns

Request forwarded to upstream

Total overhead: < 250ns per request

Design Decisions

DESIGN DECISIONS

These are settled. The result of extensive benchmarking and architectural analysis.

  • #1

    Tokio Multi-Threaded Runtime

    Not io_uring, not a custom event loop. Battle-tested async runtime.

    Work-stealing scheduler, mature ecosystem, proven at scale.

  • #2

    arc-swap for Config

    Lock-free reads, O(1) swap for hot reload.

    0.68ns config reads. No mutex contention on the hot path.

  • #3

    httparse for HTTP/1.1

    Zero-copy, proven, fuzz-hardened.

    2.5 GB/s parsing throughput. No allocation in hot path.

  • #4

    rustls for TLS

    Pure Rust, no C FFI, Cure53 audited.

    Eliminates entire class of C library vulnerabilities.

  • #5

    RAII Guards for Limits

    Circuit breaker and connection limits with automatic cleanup.

    Resource release guaranteed on drop. No manual cleanup needed.

  • #6

    Vec-based Filter Metadata

    Linear scan beats HashMap for <8 entries.

    1.6ns lookup vs 11.9ns with HashMap. Benchmarked decision.

Generic error responses — never leak cluster names, endpoints, or CB state to clients

Benchmark Results

BENCHMARK VERDICT

26 hard-target claims tested • 26 pass • All targets achieved

Pass Rate by RFC

RFC-0004Buffers
5/50%
RFC-0005Filters
4/40%
RFC-0006Codecs
5/50%
RFC-0007Config
2/20%
RFC-0008Load Bal
4/40%
RFC-0009Observability
3/30%
RFC-0010Resilience
3/30%

26/26

Claims Pass

100%

Pass Rate

5/5

Fixes Applied

Optimizations Applied

  • VecDeque overhead

    Fixed: BufChain push/split

    SmallVec

    Applied

  • HashMap in hot path

    Fixed: Counters, histograms

    Indexed array

    Applied

  • Instant::now() VDSO

    Fixed: Token bucket

    Loop timestamp

    Applied

  • SipHash in Maglev

    Fixed: Table build

    ahash

    Applied

  • HeaderMap::remove

    Fixed: H1→H2 translation

    retain() + set

    Applied

Architecture Overview

WORKSPACE STRUCTURE

Modular Rust workspace with 63 passing tests

meridian-core

meridian-core/

44

tests

buffer.rs — BufChain, SlabAllocator, Watermark
codec.rs — Http1Codec, body framing, smuggling prevention
config.rs — ConfigSnapshot, ConfigStore, route_lookup
filter.rs — HttpFilter, DynamicFilterChain, typed metadata
load_balancing.rs — RoundRobin, LeastRequest, MaglevHash
resilience.rs — CircuitBreaker, TokenBucket, RetryPolicy
observability.rs — IndexedStats, Histogram

meridian-proxy

meridian-proxy/

19

tests

main.rs — Tokio runtime, config loading
cluster.rs — ClusterManager + ClusterState
connection.rs — L7 HTTP handler flow
conn_limit.rs — Per-IP ConnectionLimiter
metrics.rs — ProxyMetrics wrapper

meridian-bench

meridian-bench/

7

tests

buffer.rs — Slab, BufChain benchmarks
codec.rs — Parse throughput, header pool
filter.rs — Chain, metadata benchmarks
lb.rs — RR, P2C, Maglev benchmarks
resilience.rs — CB, token bucket benchmarks

Features Implemented

L7 HTTP/1.1 ProxyKeep-AliveAsync Filter ChainTOML ConfigRound-Robin LBCircuit BreakerConnect TimeoutSlowloris DefensePer-IP LimitsPath NormalizationIndexed MetricsStructured Logging

Quick Start Guide

QUICK START

Get Meridian running in under a minute

proxy.toml
[[listeners]]
name = "http"
address = "0.0.0.0:8080"
filter_chain = []
[[clusters]]
name = "backend"
lb_policy = "round_robin"
connect_timeout_ms = 5000
endpoints = [
{ address = "127.0.0.1:9001", weight = 1 },
{ address = "127.0.0.1:9002", weight = 1 },
]
[[routes]]
prefix = "/"
cluster = "backend"

Build & Run

  • $ cargo build --releaseBuild the proxy
  • $ ./target/release/meridian proxy.tomlRun with config

Testing & Benchmarks

  • $ make test97 tests (unit + integration)
  • $ make clippyzero warnings
  • $ make bench7 Criterion benchmark suites
  • $ make fuzz7 libfuzzer targets