Engineering · Performance · Benchmarks
Laravel Rust vs Phoenix vs Go vs NestJS: the same API, pushed until it broke
Laravel shipped a Rust framework on 1 December. I built the same marketplace API in it, in Phoenix, in Go and in NestJS, gave each the same hardware, and stepped the load up until each one broke.
2 December 2026·7 min read
Code, scripts and raw results: github.com/erickdejury/benchmarks
Laravel Rust landed as a beta on 1 December, claiming near parity with Laravel PHP and an 18x speedup. I run Phoenix, Go and NestJS in production, so I wanted a number I could trust for my own kind of workload: a small marketplace API on Postgres, not a hello-world.
The setup
- One API, four builds. Parts, stores and orders: 100k parts, 200k orders, 1k users. Same endpoints, same JSON, all four passed the same 18-check acceptance test before any load.
- Normal tools, no tricks. Phoenix 1.8 with Ecto and Bandit. NestJS 11 with TypeORM and Express in 4 cluster workers. Go 1.27 with the Gin router on net/http and GORM on pgx. Laravel Rust 0.1.4 with its
#[model]ORM on Axum. - Same box, pinned. 8 vCPU AMD EPYC 9645, 16 GB. App: 4 cores, 8 GB, 20 DB connections. Postgres 17: 2 cores, 3 GB. Load generator (wrk2): 2 cores.
- Stepped load. 500 → 256,000 requests/s, 25 s per step at a fixed rate, until p99 passed 500 ms, errors passed 5%, or the app could not keep up. Postgres restarted per framework, fresh DB connections per scenario.
Throughput
Bars are sorted fastest first. Two numbers per bar. The solid part is what each framework sustains with p99 under 50 ms and zero errors. The faded part is the most it delivered at any latency.
How to read a pair like 3.95k · 6.32k req/s(Phoenix, create order). The rate goes up in fixed steps of 500, 1k, 2k, 4k, 8k and so on, 25 seconds each. At the 4k step Phoenix answered 3,954 req/s with a 10 ms p99 and no errors: that is its sustained figure. At the 8k step it could only deliver 6,316 req/s and p99 jumped to 4.9 seconds: that is its peak, and the test stopped there. The real “still fast” limit sits somewhere between the two steps. Sustained can only land on a step that was run, which is why several apps share the same 498, 1.98k or 3.9k: just under the 500, 2k and 4k steps.
1. Health check (no database)
What we test. Pure framework overhead: HTTP server, routing and a JSON reply. No database, so this is the ceiling for each runtime.
What happened. Go stayed under 21 ms p99 all the way to 190k req/s. Phoenix and Laravel Rust held about 62k req/s before latency climbed; NestJS held 16k. Every app ran out of its own 4 CPU cores.
Result. Go is fastest by 3x. Laravel Rust peaks higher than Phoenix (169k vs 134k req/s). NestJS is a quarter of the others.
2. Part by ID (one indexed query)
What we test. The most common API call: fetch one row from Postgres by primary key and return it as JSON.
What happened. Laravel Rust and Go both stayed fast up to about 31k req/s. Phoenix held 15.8k but still peaked at 37k. NestJS held 3.8k. At the break, the app's CPU and Postgres were both close to full.
Result. Laravel Rust and Go tie. Phoenix is half their sustained rate; NestJS is a tenth.
3. Paged list with join
What we test. A listing page: 20 parts of one brand with their store, joined in one query, using LIMIT/OFFSET paging.
What happened. Postgres's 2 cores filled at 1-2k req/s for everyone, because it scans by primary key instead of the brand index. Phoenix stayed fast at 992 req/s; Go's p99 never dropped under 50 ms (125 ms even at 500 req/s).
Result. Database-bound, not a framework contest. Phoenix best sustained, Laravel Rust best peak (1.8k req/s). The fix is keyset pagination.
4. Create order (transaction + row lock)
What we test. The write path: check the JWT, validate input, then in one transaction lock the part row, decrement stock and insert the order.
What happened. Phoenix, Laravel Rust and Go all stayed fast at about 3.9k req/s and peaked between 5.8k and 6.5k. NestJS held 2k. Postgres CPU and row locks set the limit.
Result. Three-way tie between Phoenix, Laravel Rust and Go. NestJS is half.
5. My orders (JWT + scoped query)
What we test. An authenticated read: check the JWT, then return the user's last 20 orders with part names via a join.
What happened. Laravel Rust and Phoenix stayed fast to about 7.8k req/s. Go and NestJS held 1.9k; Go's p99 jumped to 125 ms at 4k req/s.
Result. Laravel Rust and Phoenix tie, 4x ahead of Go and NestJS. Go's gap is likely its ORM (GORM) join, not tested yet.
6. 20 queries per request
What we test. A chatty endpoint: 20 separate reads per request, the shape of an N+1 query problem. Measures per-query driver and ORM cost.
What happened. Phoenix and Laravel Rust stayed fast at about 2k req/s (40k queries/s). Go delivered 1.9k req/s but its p99 sat at 70-76 ms throughout. NestJS held 500, even though it runs its queries in parallel.
Result. Phoenix and Laravel Rust tie. Go keeps up on volume but misses the 50 ms bar. NestJS is 4x slower.
The real gap is cost
At 64,000 requests/s on the health check, Laravel Rust used 1.8 of its 4 cores, Go 1.2. Phoenix used 3.6 for the same work. Memory is starker.
The bill comes at build time: a clean release build of the Rust app took 8.5 minutes on 2 cores. Phoenix took 49 seconds, Go 62.
What ran out
Nothing ran out of memory; no app passed 1 GB of its 8. On the health check, every framework stopped because its own 4 cores were full. On every other scenario, Postgres's 2 cores filled first. That is the honest headline: once a request does real database work, the framework stops being the bottleneck and your queries and indexes take over.
They fail differently, though. When the database fell behind, Phoenix refused requests that waited too long for a connection (errors, latency stays sane). NestJS, Laravel Rust and Go let them queue (no errors, multi-second latency). Which one you want depends on whether your client retries.
Realtime
One broadcast a second to 1,000, 2,000 and 5,000 WebSocket clients. All four delivered every message, with p99 between 39 and 300 ms. At 5,000 clients the load generator was the limit, so call it a tie.
Three things that surprised me
- Docker caps open files at 1,024. Node and Rust raise that limit themselves. The Erlang VM does not, so Phoenix stopped at about 980 sockets until I set
--ulimit nofile=65536. Every Phoenix container needs it. - Postgres chose a bad plan for the paged list, walking the primary key and filtering by brand instead of using the
(brand, id)index. It capped all three frameworks at roughly the same rate. Keyset pagination fixes it. - The load generator matters. My first run used k6 and measured k6: it topped out near 8k requests/s. wrk2 on the same 2 cores reached 169k.
What I take from it
Laravel Rust is real. A one-day-old beta matched Phoenix on throughput while using half the CPU and a fifth of the memory. The cost is compile time and a young ecosystem: no built-in JWT, and Reverb runs as a separate process. Phoenix stays my default for realtime-heavy work. NestJS with TypeORM is the one I would profile first before scaling out. Go gives the most raw speed for the least memory and a one-minute build, but with an ORM on the hot path it gave that lead back once the database work got real.
Single run per step on one machine: treat gaps under 20% as a tie.
Built and run with Claude Opus 5.5. It wrote the four apps and the load harness, ran every step on the server, and drafted this article.
Code, scripts and every raw result: github.com/erickdejury/benchmarks. It runs on any 8-core machine with Docker.
| Sustained req/s (p99 ≤ 50 ms), higher is better | Phoenix | Laravel Rust | Go | NestJS |
|---|---|---|---|---|
| Health check (no database) | 62,309 req/s | 61,329 req/s | 189,540 req/s | 15,578 req/s |
| Part by ID (one indexed query) | 15,800 req/s | 31,566 req/s | 31,152 req/s | 3,833 req/s |
| Paged list with join | 992 req/s | 498 req/s | none | 498 req/s |
| Create order (transaction + row lock) | 3,954 req/s | 3,896 req/s | 3,896 req/s | 1,979 req/s |
| My orders (JWT + scoped query) | 7,790 req/s | 7,902 req/s | 1,947 req/s | 1,947 req/s |
| 20 queries per request | 1,979 req/s | 1,979 req/s | none | 498 req/s |