One Laravel API, rebuilt in Go and Rust: 15× to 195× the successful throughput of classic PHP
A real production API was ported line for line to Laravel Go and Laravel Rust and load-tested against classic Laravel and Laravel Octane, with all four on the same Postgres and Redis. Octane narrowed the gap. Full-text search barely moved, because the database was the bottleneck for every runtime.
The app under test
A production Laravel 13 API, anonymised here. It serves market quotes, price charts, an options calculator and a news feed to several static websites. It also has an admin panel and scheduled data ingestion, but only the API slice below was ported.
Like-for-like ports
Each port runs the same SQL, makes the same Redis calls and returns the same JSON, written idiomatically for its framework. A contract script checks that all four return identical status codes, headers and bodies before any load test.
Shared infrastructure
One Postgres database and one Redis serve all four apps. The PHP app owns the schema and the data; the Go and Rust ports never migrate.
Real middleware
Every API request goes through a Redis fixed-window rate limiter (limits raised for the test). Public reads add CORS headers and a SHA-1 ETag. Keyed routes authenticate a site key with two queries.
| Scenario | Endpoint | What it exercises |
|---|---|---|
| status | GET / | Bare framework overhead: no database, a JSON timestamp |
| options | GET /api/v2/calculators/options | Key auth (2 queries), Black-Scholes and Greeks maths, a large JSON response |
| quotes | GET /api/v2/markets/quotes | A Redis snapshot plus market-clock logic for 66 instruments, about 40 KB of JSON |
| chart | GET /api/v2/markets/instruments/{slug}/chart | One indexed database query per request |
| news | GET /api/v2/news?page=N | A count plus a page query and pagination, about 25 KB of JSON |
| search | GET /api/v2/news?q=… | Postgres full-text search, bound by the database |
| events | POST /api/v2/events | Key auth, then an upsert: a database write on every request |
Results
Successful (2xx) responses per second. Longer is better. Endpoints marked ⚠ had failed requests and are left out of the headline.
status
options ⚠
⚠ Left out of the headline. Laravel classic: 76.6% succeeded (1,862 HTTP errors); Laravel Octane: 98.2% succeeded (763 client connection errors). See “Errors in the PHP runs” below.
quotes
chart ⚠
⚠ Left out of the headline. Laravel classic: 93.4% succeeded (446 HTTP errors); Laravel Octane: 97.3% succeeded (625 client connection errors). See “Errors in the PHP runs” below.
news
events
search
Postgres full-text search is the bottleneck here, so every runtime lands within 1.4× of classic PHP. When the database is the limit, a faster language barely helps: add the right index or a search engine first.
Show all numbers, every percentile ▾
Laptop, 50 connections
2026-12-04 · Apple M1 Pro laptop (10 cores, 32 GB); app, Postgres, Redis and load generator on one machine · 50 connections, 20 s per run
| Scenario | Runtime | 2xx/s | sent/s | p50 ms | p95 ms | p99 ms | max ms | 2xx | non-2xx | client errors | cut off at end | RSS MB |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| status | Laravel classic | 528 | 530 | 91 | 133.1 | 162.5 | 258.4 | 10,558 | 0 | 0 | 48 | 171.6 |
| Laravel Octane | 5,467 | 5,470 | 7.2 | 15 | 57.2 | 230.2 | 109,357 | 0 | 0 | 50 | 312.6 | |
| Laravel Go | 81,932 | 81,935 | 0.5 | 1.6 | 2.4 | 10.9 | 1,639,002 | 0 | 0 | 47 | 49.2 | |
| Laravel Rust | 102,816 | 102,818 | 0.5 | 0.6 | 0.7 | 12 | 2,056,716 | 0 | 0 | 45 | 30.5 | |
| options | Laravel classic | 305 | 401 | 126.5 | 155.8 | 175.5 | 225.9 | 6,111 | 1,862 | 0 | 50 | 217.4 |
| Laravel Octane | 2,044 | 2,084 | 18.9 | 41.8 | 145.1 | 462.4 | 40,881 | 0 | 763 | 50 | 272.4 | |
| Laravel Go | 9,377 | 9,379 | 4.8 | 9.9 | 14.4 | 63.9 | 187,592 | 0 | 0 | 47 | 81.1 | |
| Laravel Rust | 20,209 | 20,211 | 2.3 | 3.3 | 4.8 | 42.7 | 404,246 | 0 | 0 | 48 | 39.5 | |
| quotes | Laravel classic | 402 | 405 | 108.4 | 214.2 | 252.4 | 334.2 | 8,051 | 0 | 0 | 48 | 275.5 |
| Laravel Octane | 994 | 997 | 41.2 | 109 | 167.3 | 301.7 | 19,893 | 0 | 0 | 50 | 306.1 | |
| Laravel Go | 5,933 | 5,935 | 6.9 | 19.9 | 28.2 | 72.9 | 118,681 | 0 | 0 | 50 | 104.8 | |
| Laravel Rust | 12,770 | 12,773 | 3.6 | 6.6 | 10.6 | 44.3 | 255,433 | 0 | 0 | 50 | 66.6 | |
| chart | Laravel classic | 313 | 338 | 145.1 | 190.7 | 220.1 | 299 | 6,269 | 446 | 0 | 50 | 242.9 |
| Laravel Octane | 1,125 | 1,158 | 36.3 | 96.6 | 158.1 | 293.3 | 22,495 | 0 | 625 | 50 | 262.1 | |
| Laravel Go | 10,466 | 10,468 | 4.1 | 10.4 | 14.9 | 39.6 | 209,341 | 0 | 0 | 48 | 72.2 | |
| Laravel Rust | 17,836 | 17,838 | 2.7 | 4 | 5.2 | 28.1 | 356,773 | 0 | 0 | 50 | 62.3 | |
| news | Laravel classic | 274 | 276 | 171.8 | 239.8 | 418.8 | 773.7 | 5,481 | 0 | 0 | 50 | 246.9 |
| Laravel Octane | 1,282 | 1,284 | 30 | 106.5 | 183.1 | 378.8 | 25,633 | 0 | 0 | 50 | 268.5 | |
| Laravel Go | 7,582 | 7,584 | 5.9 | 12.7 | 17.4 | 47.6 | 151,651 | 0 | 0 | 50 | 84.4 | |
| Laravel Rust | 11,588 | 11,590 | 4.2 | 5.6 | 7 | 81.4 | 231,788 | 0 | 0 | 48 | 61.8 | |
| events | Laravel classic | 316 | 319 | 143.5 | 240.5 | 273.1 | 367.8 | 6,325 | 0 | 0 | 50 | 201.4 |
| Laravel Octane | 2,245 | 2,247 | 18.7 | 40.8 | 92 | 212.2 | 44,904 | 0 | 0 | 50 | 226.5 | |
| Laravel Go | 9,451 | 9,453 | 4.9 | 9.4 | 12 | 33.1 | 189,030 | 0 | 0 | 50 | 60.7 | |
| Laravel Rust | 9,920 | 9,922 | 4.9 | 6.5 | 7.9 | 18.6 | 198,412 | 0 | 0 | 50 | 52.2 | |
| search | Laravel classic | 77 | 79 | 614.5 | 902.1 | 1049.6 | 1272.7 | 1,536 | 0 | 0 | 50 | 246.7 |
| Laravel Octane | 89 | 92 | 545.6 | 703.6 | 833.2 | 953.9 | 1,781 | 0 | 0 | 50 | 225 | |
| Laravel Go | 99 | 102 | 431.1 | 1039.6 | 1433.4 | 2399.1 | 1,983 | 0 | 0 | 50 | 57.5 | |
| Laravel Rust | 107 | 110 | 459.9 | 519.1 | 562.8 | 630.1 | 2,141 | 0 | 0 | 50 | 47.4 |
PHP re-run of chart and options
2026-12-04 · Same laptop, six minutes later · 50 connections, 20 s per run · Re-ran the two scenarios where PHP returned errors in the main run.
| Scenario | Runtime | 2xx/s | sent/s | p50 ms | p95 ms | p99 ms | max ms | 2xx | non-2xx | client errors | cut off at end | RSS MB |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | Laravel classic | 316 | 328 | 150.2 | 190.1 | 215.9 | 267.7 | 6,329 | 181 | 0 | 50 | 215 |
| Laravel Octane | 2,170 | 2,173 | 18.4 | 37.8 | 143.2 | 270.7 | 43,414 | 0 | 0 | 50 | 235.5 | |
| chart | Laravel classic | 321 | 333 | 148.7 | 180.9 | 200.1 | 260.2 | 6,430 | 192 | 0 | 50 | 220.5 |
| Laravel Octane | 1,231 | 1,233 | 33.8 | 91.3 | 154.7 | 255.2 | 24,622 | 0 | 0 | 50 | 226.1 |
How it was measured
Read these numbers as relative. The app, the database, Redis and the load generator all shared one laptop. A Laravel Cloud run with four identical environments is planned and will be added here.
Laravel, classic
Laravel 13 on FrankenPHP 1.14 (PHP 8.6.0) without workers, so the app boots on every request as it does under PHP-FPM. Config, route and event caches are on, debug is off.
Laravel Octane
The same branch with Octane 2 on FrankenPHP workers (--workers=auto, 10,000 max requests). The app boots once per worker.
Laravel Go
go.laravel.com v0.2.0 on Go 1.27, built with go build and run as a single binary.
Laravel Rust
laravel-rust 0.2.0 on Axum 0.8 and Tokio, Rust 2024 edition, release build with the mimalloc allocator.
Load
oha with 50 open connections. Each scenario and target got a 5-second warm-up, then 20 seconds of measurement, one at a time. Random path parameters prevent caching. Memory is the server's resident set size right after the run. Throughput counts successful (2xx) responses only. When the 20 seconds run out, oha cancels the requests still in flight (at most one per connection); the full table lists them as “cut off at end”, not as failures.
Reproduce it
Each measured run was oha -z 20s -c 50 --no-tui --rand-regex-url -m GET -H "Accept: application/json" --output-format json URL, after an unmeasured 5-second run with the same flags. The app itself is private, so its code is not published, but every number on this page is downloadable: results as JSON · as CSV. scripts/import-bench.py in the repo turns oha output into this page's data.
Machine
Apple M1 Pro laptop with 10 cores and 32 GB of RAM, run on 4 December 2026. Postgres and Redis ran locally, so database-bound scenarios compete with the app for CPU.
What to take from it
The useful lessons, and the parts not to over-read.
Octane is the cheapest win
Keeping Laravel booted gave 2.5× to 10× more throughput with no code rewrite. Try it before porting anything.
Compiled ports win on CPU and JSON
The gap is widest where PHP spends time booting, computing or encoding JSON: status, options, quotes and chart.
The database sets the ceiling
Full-text search ran at about 80 to 110 requests per second on every runtime. When Postgres is the bottleneck, the language barely matters: fix the query and the indexes first.
Memory follows the model
The Go and Rust binaries stayed at 30 to 105 MB while serving thousands of requests per second. PHP sat at 170 to 310 MB.
Errors in the PHP runs
Classic PHP opens new Postgres and Redis connections on every request. On macOS the closed sockets pile up in TIME_WAIT until the machine runs out of ephemeral ports. In the main run PHP answered 23% of options requests and 7% of chart requests with HTTP 500; a re-run six minutes later still failed about 3% of both. Octane's load generator hit the same port limit as client connection errors in the main run, and its re-run was clean. Both endpoints are flagged ⚠ and left out of the headline. A cloud run on separate machines should remove the problem.
Version 0.2 frameworks
Laravel Rust's first beta came out on 1 December 2026 and Laravel Go's on 2 December; both were days old when this ran on v0.2. Their numbers will move as they mature, and so may Laravel's. The freshness script on this site flags new releases so the page can be re-run.