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
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?”
FEATURE OVERVIEW
Production-ready features for platform engineers, SREs, and cloud-native infrastructure teams
- HTTP/1.1 proxy with keep-aliveProtocol
- HTTP/2 downstream (h2 crate)Protocol
- TLS termination (rustls)Security
- Async filter chainCore
- Round-robin load balancingRouting
- Circuit breaker (RAII guards)Resilience
- Connection poolingPerformance
- Active health checking (TCP/HTTP)Resilience
- Chunked transfer encodingProtocol
- Admin API (/stats, /clusters)Observability
- Path normalization & securitySecurity
- Prometheus metrics endpointObservability
- Fuzz-hardened parsersSecurity
- Per-IP rate limitingSecurity
- Slowloris defenseSecurity
- Least-request (P2C) LBRouting
- Maglev consistent hashingRouting
- Request smuggling preventionSecurity
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
Request Arrives
TCP accept loop receives connection
Buffer Acquired
Slab allocator provides hot buffer from pool
Headers Parsed
httparse decodes HTTP/1.1 request at 2.5 GB/s
Filter Chain
5-filter async pipeline processes request
Route Matched
Config lookup via arc-swap shared reference
Endpoint Selected
Round-robin pick from cluster endpoints
Circuit Check
Single atomic load confirms circuit closed
Upstream Connect
Tokio timeout-wrapped connection to backend
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.
Benchmark Results
BENCHMARK VERDICT
26 hard-target claims tested • 26 pass • All targets achieved
Pass Rate by RFC
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
meridian-proxy
meridian-proxy/
19
tests
meridian-bench
meridian-bench/
7
tests
Features Implemented
Quick Start Guide
QUICK START
Get Meridian running in under a minute
[[listeners]]name = "http"address = "0.0.0.0:8080"filter_chain = [] [[clusters]]name = "backend"lb_policy = "round_robin"connect_timeout_ms = 5000endpoints = [ { 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