NGINX 0.2 CPU · 20MB
Rinha de Backend 2024/Q1 · Rust execution lane
Blazingly fast.
Eventually compiled.
A compact Rust banking API built for brutal limits: two Actix workers, one NGINX balancer, PostgreSQL stored procedures, and a full k6 evidence trail.
Rust 1.94 Actix-web 4 SQLx 0.8 PostgreSQL 16
Challenge budget
1.5 CPU and 550MB RAM, fully accounted for.
The homepage now leads with the constraint that makes the implementation interesting: every service earns its share of a tiny resource envelope.
CPU share Memory share
API 1 0.4 CPU · 100MB
API 2 0.4 CPU · 100MB
PostgreSQL 0.5 CPU · 330MB
Runtime topology
NGINX feeds two Rust workers. Postgres owns the transaction law.
NGINX :9999 least_conn
webapi1-rust :8080 0.4 CPU · 100MB
webapi2-rust :8080 0.4 CPU · 100MB
PostgreSQL stored procedures InsertTransacao() · GetSaldoClienteById()
Implementation proof
Small surface, hard edges, measurable behavior.
single-file API surface
compile-time query cache
write path tuned for throughput
balances both API workers
Evidence archive
Stress reports stay inspectable.
The archive is treated like audit material: latest run first, every artifact linked, and the CI workflow one step away.