Laravel PHP vs. Laravel Rust: 189 Full-Stack Trials
Overview
A 27-run Octane and FrankenPHP update to our 189-trial benchmark of tuned Laravel PHP and Laravel Rust.
On a route that validates and prices 512 order lines, Laravel Rust used 91% less app CPU than tuned PHP-FPM. Octane used 25% less than FPM. Dashboard p99 stayed near 200 ms while all three waited for the same promotion service.
We wouldn’t rewrite a working Laravel app on these results. If a route is burning CPU, measure it on Octane before porting it. If the time is going into a query or a remote call, start there.
Checked 5 December 2026.
Jump to the original 189-trial benchmark.
5 December update: Octane made PHP faster
At 4,000 quotes a second, median run p99 was 5.92 ms on FPM, 3.31 ms on Octane and 1.66 ms on Rust. Rust used 0.57 app cores to Octane’s 4.85. On mixed catalog and checkout traffic, Octane cut PHP app CPU by about a third. All 27 runs passed.
| App memory after traffic drained | PHP-FPM | Octane / FrankenPHP | Laravel Rust |
|---|---|---|---|
| Quote | 201 MiB | 332 MiB | 67 MiB |
| Catalog and checkout | 112 MiB | 216 MiB | 44 MiB |
| Dashboard | 157 MiB | 284 MiB | 71 MiB |
Octane’s median was higher than FPM’s on all three workloads. These snapshots include file cache; they don’t establish peak or steady-state memory.
Results and setup for all 27 runs
We reran FPM and the same Rust build alongside Octane 2.26.0 (opens in a new tab) with FrankenPHP 1.14.1 (opens in a new tab) on the original fixtures. Both PHP paths used Laravel 13.45.0, PHP 8.5.13, the same app code, persistent PDO and OPcache with JIT off. nginx sent FPM requests via FastCGI to 32 workers and Octane requests via HTTP to FrankenPHP’s thread-safe build. We picked 16 Octane workers, the smallest pool to pass both pilots, with recycling configured after 5,000 requests.
We calculated average CPU cores by dividing app cgroup CPU time by wall-clock time, including drain. That includes FrankenPHP’s embedded Caddy and excludes external nginx, PostgreSQL and the generator. The memory figures are medians of one cgroup memory.current snapshot per run, taken after drain.
Each run had to return at least 99.9% correct replies, with zero wrong replies, timeouts or transport errors and a p99 at or below 100, 200 or 275 ms for quote, mix and dashboard. The generator missed two of 2,740,500 scheduled sends. Of the correct replies, 179 arrived during drain. We reconciled 49,617 reservations including warm-up and matched call counts at the dashboard origin.
Each cell gives p99 in ms / app CPU cores / app memory in MiB after drain. The blocks are listed in time order. We ran three paired blocks per workload, rotating each path through each position once. Each run had ten seconds of warm-up and 60 seconds of scheduled traffic before drain. All offered requests returned correctly apart from the two missed sends marked below.
We ran one path at a time on the native linux/amd64 Docker guest, with no published ports or external benchmark traffic. App containers reused CPUs 0–7 with 4 GiB. nginx used CPUs 8–11, PostgreSQL used 12–17 with 12 GiB, and the generator used 18–23.
| Block | Workload and offered requests per path | nginx + FPM | nginx + Octane | nginx + Rust |
|---|---|---|---|---|
| 1 | Mix, 60,000 | 3.640 / 1.371 / 203.9 (1 missed) | 3.094 / 0.938 / 215.9 (1 missed) | 2.080 / 0.120 / 94.6 |
| 2 | Dashboard, 4,500 | 206.884 / 0.271 / 110.0 | 207.058 / 0.247 / 219.9 | 202.675 / 0.034 / 39.3 |
| 3 | Mix, 60,000 | 3.639 / 1.381 / 112.2 | 2.887 / 0.939 / 221.4 | 2.085 / 0.118 / 44.1 |
| 4 | Mix, 60,000 | 3.737 / 1.395 / 98.5 | 2.923 / 0.943 / 213.1 | 2.127 / 0.122 / 36.1 |
| 5 | Quote, 240,000 | 5.920 / 6.433 / 139.7 | 3.308 / 4.883 / 267.7 | 1.655 / 0.572 / 62.6 |
| 6 | Dashboard, 4,500 | 208.814 / 0.280 / 156.7 | 206.645 / 0.246 / 283.5 | 202.675 / 0.033 / 70.6 |
| 7 | Quote, 240,000 | 6.485 / 6.457 / 200.7 | 3.285 / 4.835 / 332.4 | 1.631 / 0.567 / 66.9 |
| 8 | Quote, 240,000 | 5.855 / 6.454 / 247.1 | 3.344 / 4.849 / 379.4 | 1.659 / 0.560 / 69.2 |
| 9 | Dashboard, 4,500 | 207.333 / 0.273 / 253.9 | 207.757 / 0.244 / 385.2 | 202.770 / 0.035 / 71.3 |
We offered 4,000 quotes, 1,000 mixed requests and 75 dashboard requests per second. The mix was 90% catalog reads and 10% checkouts. It had to meet its p99 limit for reads and writes separately and pass the order ledger check. The dashboard had to match origin counts. The quote pilot offered 48,000 requests, and the dashboard pilot 900, to each worker configuration. All six pilot runs returned every response correctly. Quote p99 at 16, 24 and 32 workers was 3.378, 3.398 and 3.354 ms; dashboard p99 was 205.084, 205.023 and 205.204 ms.
On the dashboard, median run p99 was 207.333 ms for FPM, 207.058 ms for Octane and 202.675 ms for Rust. Octane used less quote CPU than FPM in each paired block (nominal two-sided exact sign test, p = 0.25). Warm processes and database caches could carry over between runs. The run log spans 07:18 to 07:53 UTC.
Follow-up archive SHA-256: 0435678ee9bd4ab51714b41098d9ea77bf49a17fb8d26f16c9681c16061cd9dc.
Worker models and what the benchmark can tell us
FPM workers stay up and OPcache keeps compiled PHP bytecode available. Laravel still boots the application for each request. Octane keeps it initialized between requests (opens in a new tab), as the compiled Rust app does. Skipping Laravel’s per-request boot may explain some of Octane’s savings. We also switched to FrankenPHP. The container totals don’t break out boot, parsing or pricing.
Laravel’s Cloud benchmark (opens in a new tab) used Octane and FrankenPHP (opens in a new tab) on MySQL. Its headline compares best failure-free ten-second windows during a ramp. Our fixed-rate tests with synthetic orders don’t establish maximum throughput or show how the stacks would perform under production traffic.
Laravel Rust was a 0.2.0 beta. We checked specific routes and effects. We didn’t compare package availability, debugging and profiling tools, clean or incremental build times, or the cost of maintaining a port.
Maborak designed and ran the tests separately from Laravel Cloud, with AI assistance on the harness and article. The full harness and raw captures are private. We haven’t seen an independent reproduction.
Code excerpts from the original PHP and Rust validation fixture
This is the quantity route from the original study, separate from the 512-line quote. Both apps accepted the numeric string "3" as the integer 3, rejected quantities outside 1–24 with 422, and returned 404 for a missing purchase.
PHP uses a BenchQuantity form request with the rule ['quantity' => ['required', 'integer', 'min:1', 'max:24']].
Route::post('/quantity/{purchase}', function (BenchPurchaseHeader $purchase, BenchQuantity $input) {
$quantity = (int) $input->validated('quantity');
return ['id' => $purchase->id, 'quantity' => $quantity, 'total' => $purchase->total * $quantity];
})->whereNumber('purchase');
Rust extracts the typed quantity before the handler computes the total.
#[laravel::input]
#[validate(anyone)]
pub struct Quantity {
#[validate(required, min_value(1), max_value(24))]
quantity: i32,
}
pub async fn quantity(purchase: BenchPurchaseHeader, Valid(input): Valid<Quantity>) -> Json<QuantityQuote> {
Json(QuantityQuote {
id: purchase.id,
quantity: input.quantity,
total: purchase.total * input.quantity,
})
}
Original benchmark
The full original article follows. Its scores cover PHP-FPM, Rust behind nginx, and direct Rust. The Octane follow-up was unscored.
All three Laravel deployments passed at 4,000 quotes a second with p99 under the 100 ms limit. On 512-line quotes, the PHP app used 6.42 CPU cores. Its median run p99 was 6.16 ms. The two Rust paths used 0.57 and 0.58 cores, with p99s of 1.68 and 1.57 ms. When the dashboard waited for a 200 ms promotion service, p99 on all three paths was between 203 and 207 ms. We also checked what the apps left behind: database rows, completed jobs, WebSocket deliveries and SMTP receipts.
Checked 5 December 2026.
Three stacks, one Linux guest
| Deployment | Request path |
|---|---|
| nginx + Laravel PHP | nginx 1.31.9 → FastCGI (opens in a new tab) → PHP-FPM 8.5.13 → Laravel PHP 13.45.0 (opens in a new tab). We used 32 static FPM workers, OPcache, FastCGI connection reuse and persistent PostgreSQL connections through PDO. |
| nginx + Laravel Rust | The same nginx → HTTP/1.1 with upstream keep-alive → Laravel Rust 0.2.0 (opens in a new tab). |
| Laravel Rust direct | The Go load generator sent HTTP/1.1 straight to the same Rust build used behind nginx. |
Each app had eight vCPUs and 4 GiB of RAM on render-box’s native linux/amd64 Docker guest for the one-minute trials. PostgreSQL 18.7 (opens in a new tab) had six vCPUs and 12 GiB. nginx and the Go load generator had separate CPU sets. We ran one path at a time on private Docker networks with no published ports. The Rust release build used SQLx 0.9.1.
Test matrix
Unless noted, each path ran three rotated 60-second repeats after a 10-second warm-up, usually at a lower rate. HTTP p99 measures correct responses from scheduled arrival. Replies during drain count. Each repeat needed 99.9% correct among offered requests, zero wrong replies, timeouts or transport errors, and p99 within the limit. Missed sends count against the offered total. We checked outputs and persisted effects before timing.
| # | Workload | Offered load | Pass criteria and exceptions |
|---|---|---|---|
| 1 | 512-line quote | 4,000 requests/s | HTTP p99 ≤ 100 ms. |
| 2 | Catalog page | 1,000 requests/s | HTTP p99 ≤ 100 ms. |
| 3 | Checkout, 90/10 catalog/checkout mix, and hot-SKU checkout | 1,000 requests/s each | HTTP p99 ≤ 200 ms, including the two traffic types in the mix separately. The database ledger had to match acknowledgments, item quantities and stock. |
| 4 | Model binding with input validation; authenticated session read | 1,000 and 300 requests/s respectively | HTTP p99 ≤ 100 ms each. Invalid input and session revocation were preflight checks. |
| 5 | Eager-loaded ORM list, 25 orders | 500 requests/s | HTTP p99 ≤ 100 ms and the same buyers, totals and items. |
| 6 | Parallel dashboard; shared cache hit | 75 and 1,000 requests/s respectively | HTTP p99 ≤ 275 ms and ≤ 100 ms. We reconciled total calls by dashboard component and required zero cache rebuilds. |
| 7 | PostgreSQL queue; durable workflow | 50 and 15 submissions/s respectively | At least 99.9% acknowledged within 100 ms and completed within 2 s for the queue or 10 s for the workflow. We reconciled IDs and effects independently. |
| 8 | Reverb WebSocket fan-out | 50 events/s to 64 subscribed sockets | At least 99.9% acknowledged within 100 ms and delivered to all 64 subscribers within 250 ms, with no missing deliveries for acknowledged IDs, duplicates or unexpected deliveries. |
| 9 | Server-rendered views; Inertia JSON | 1,000 and 500 requests/s respectively | HTTP p99 ≤ 100 ms. Inertia’s initial HTML, deferred props and stale asset version were separate protocol checks. |
| 10 | SMTP acceptance | 100,000 messages per path, 10 senders | One fixed-volume run per path, about 441–467 s, with four vCPUs per app. Match every recipient ID at the private SMTP receiver with no missing or duplicate receipts. Timing carries no points. |
| 11 | Slowdown controls | ORM at 500 requests/s, serial dashboard at 75/s, checkout with and without a blocking call at 350/s | Three 60-second repeats per path. Record outputs, SQL calls, origin activity and any errors. These variants carry no points. |
| 12 | Ingress and database tuning | Quotes at 4,000/s; catalog and SQLx mix at 1,000/s | Two 25-second quote runs per FPM profile, two 60-second catalog runs per PDO/PgBouncer combination, and one 60-second SQLx mix per connection policy. |
| 13 | Operational and developer checks | One scripted preflight per applicable framework | Check an applied migration, rollback and no-op rerun, one scheduled effect, a faked GitHub identity, an in-process HTTP assertion, and native Rust trace export. |
Scoring: 50 points for business HTTP, 30 for background and realtime, 20 for rendering and mail. The 189 one-minute trials include nine cache rechecks. We ran three fixed-volume mail checks and 117 unscored pilots separately.
Business HTTP
PHP ran out of source ports
At 1,000 catalog requests per second, PHP opened a fresh PDO connection to PostgreSQL on each request and logged Cannot assign requested address. We counted 28,231 sockets in TIME_WAIT inside the PHP container. Its configured ephemeral port range (opens in a new tab) held 28,232 ports, and PostgreSQL still had connection slots available. Switching the destination to PgBouncer 1.25.2 (opens in a new tab) left PHP opening the same number of client connections.
| PHP catalog setup | Correct responses per 60,000 offered, two runs | p99 of correct responses |
|---|---|---|
| Fresh PDO, direct | 27,676 / 27,916 | 20.37–23.51 ms |
| Fresh PDO, via PgBouncer | 28,092 / 27,837 | 8.90–9.17 ms |
| Persistent PDO, direct | 60,000 / 60,000 | 3.13–3.18 ms |
| Persistent PDO, via PgBouncer | 60,000 / 60,000 | 3.53–3.61 ms |
The catalog diagnostic held 16 FPM workers and FastCGI reuse fixed. Persistent PDO (opens in a new tab) kept 16 established connections. PgBouncer cut PostgreSQL CPU in the fresh-connection runs from about 2.0 to 0.19 cores. PHP still exhausted its source ports. The SQLx mix passed once direct and once through PgBouncer in transaction mode with prepared-statement tracking (opens in a new tab). Both scored apps connected directly.
Individual connection trials
Each trial offered 60,000 requests. Counts are correct / wrong / timeout / missed; transport errors were zero.
| Setup | Trial 1 counts; p99 | Trial 2 counts; p99 |
|---|---|---|
| Fresh PDO, direct | 27,676 / 31,886 / 394 / 44; 20.368 ms | 27,916 / 31,527 / 412 / 145; 23.505 ms |
| Fresh PDO, PgBouncer | 28,092 / 31,908 / 0 / 0; 8.895 ms | 27,837 / 32,163 / 0 / 0; 9.173 ms |
| Persistent PDO, direct | 60,000 / 0 / 0 / 0; 3.181 ms | 60,000 / 0 / 0 / 0; 3.131 ms |
| Persistent PDO, PgBouncer | 60,000 / 0 / 0 / 0; 3.525 ms | 60,000 / 0 / 0 / 0; 3.609 ms |
| SQLx mix, direct | 60,000 / 0 / 0 / 0; 2.213 ms | |
| SQLx mix, PgBouncer | 60,000 / 0 / 0 / 0; 2.143 ms |
Socket and log check from the separate catalog diagnostic
From the lab’s Docker shell, :1538 selects PostgreSQL port 5432. Use :1920 for PgBouncer port 6432. State 06 is TIME_WAIT.
docker exec lr-bench-php cat /proc/sys/net/ipv4/ip_local_port_range
docker exec lr-bench-php cat /proc/net/tcp /proc/net/tcp6 |
awk '$3 ~ /:1538$/ && $4 == "06" {n++} END {print n+0}'
32768 60999
28231
SQLSTATE[08006]: connection to server failed: Cannot assign requested address
FastCGI reuse worked with 32 FPM workers
We tested 16, 32 and 48 static FPM workers (opens in a new tab) with and without FastCGI connection reuse (opens in a new tab). OPcache stayed enabled. The first chooser allowed 0.1% failures and picked 16 workers with reuse. That profile timed out 12 and 95 requests in two 100,000-request runs. Its highest sampled FPM listen queues were 38 and 68. After inspecting calibration, we required complete, correct responses before running the store trials. At 32 workers with reuse both runs passed with p99 of 5.89–5.94 ms. Median app-plus-nginx CPU fell from 7.68 to 6.81 cores compared with reuse off at 32.
Individual ingress trials
Each trial offered 100,000 quotes. Each cell shows p99 in ms / combined PHP and nginx CPU cores / peak FPM listen queue. Only the exceptions shown missed their offered total.
| Workers | FastCGI reuse | Trial 1 | Trial 2 |
|---|---|---|---|
| 16 | Off | 5.068 / 7.604 / 1 | 4.868 / 7.596 / 2 |
| 16 | On | 5.906 / 6.769 / 38 (12 timeouts) | 5.238 / 6.104 / 68 (95 timeouts) |
| 32 | Off | 6.088 / 7.658 / 2 | 6.219 / 7.711 / 2 |
| 32 | On | 5.886 / 6.810 / 1 | 5.943 / 6.808 / 2 |
| 48 | Off | 7.154 / 7.711 / 1 | 8.067 / 7.747 / 2 |
| 48 | On | 6.370 / 6.839 / 0 | 5.887 / 6.824 / 12 (16 missed sends) |
The tuned store met the offered rates
| Workload | nginx + PHP p99 | nginx + Rust p99 | Rust direct p99 | What mattered in this fixture |
|---|---|---|---|---|
| Quote | 6.16 ms | 1.68 ms | 1.57 ms | Each app validates and totals 512 lines. The Go client measures from the scheduled arrival, including scheduling and network overhead. |
| Catalog | 3.16 ms | 1.69 ms | 1.61 ms | Both apps call the same PostgreSQL function for a 50-product page. |
| Checkout | 3.95 ms | 2.26 ms | 2.21 ms | The same SQL function reserves two SKUs. Every tenth request replays the prior key and payload. |
| Mixed traffic | 3.63 ms | 2.11 ms | 1.93 ms | Nine catalog requests per checkout. Catalog and checkout each passed. |
| Hot SKU | 4.05 ms | 2.37 ms | 2.32 ms | Every order reserves the same first SKU. Both apps take the same row lock. |
| Binding and validation | 3.38 ms | 1.62 ms | 1.51 ms | PHP FormRequest and Rust Valid<T> accepted the same valid fixtures, including a numeric string. Missing models returned 404; invalid quantities returned 422. |
| Authenticated session | 5.13 ms | 2.15 ms | 2.06 ms | Reads used PostgreSQL-backed sessions. Login, logout and rejection without a CSRF token ran separately. |
| Shared cache hit, fresh key | 3.04 ms | 1.57 ms | 1.45 ms | Both frameworks used PostgreSQL for cache values and locks. All nine rechecks had zero origin calls. |
Across 45 store trials, 4,319,989 of 4,320,000 offered requests returned correctly, including 65 during drain. The client missed 11 arrivals. We reconciled 1,041,865 reservations across 27 write ledgers, including warm-up. The Go scheduler batches arrivals at millisecond boundaries. Its quote p99 was about 1 ms, which matters when comparing the two Rust paths.
Individual store, routing, session and cache trials
Values are p99 in ms in rotated-block order. Every offered request returned correctly except the missed sends shown. The original cache rebuild still returned the correct response.
| Workload | Offered per trial | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|---|
| Quote | 240,000 | 6.167 / 6.158 / 6.097 | 1.746 / 1.681 / 1.678 | 1.534 (2 missed) / 1.565 / 1.568 (4 missed) |
| Catalog | 60,000 | 3.183 / 3.164 / 3.164 | 1.660 / 1.717 / 1.690 | 1.600 (1 missed) / 1.643 / 1.612 |
| Checkout | 60,000 | 3.945 / 3.965 / 3.918 | 2.314 / 2.259 / 2.255 | 2.218 / 2.209 (2 missed) / 2.212 |
| Mixed traffic | 60,000 | 3.606 (1 missed) / 3.629 / 3.694 | 2.202 / 2.111 / 2.111 | 1.925 / 1.908 / 2.169 |
| Hot SKU | 60,000 | 4.022 / 4.130 / 4.050 | 2.373 / 2.385 / 2.372 | 2.353 / 2.309 / 2.322 (1 missed) |
| Binding and validation | 60,000 | 3.311 (1 missed) / 3.385 / 3.377 | 1.606 / 1.619 / 1.619 (1 missed) | 1.514 (1 missed) / 1.514 / 1.513 |
| Session | 18,000 | 5.126 / 5.128 / 5.077 | 2.155 / 2.146 / 2.150 | 2.069 / 2.052 / 2.056 |
| Cache, original | 60,000 | 3.084 / 3.083 / 3.068 | 1.549 / 1.552 / 1.535 | 1.478 / 1.450 (1 rebuild) / 1.437 |
| Cache, fresh key | 60,000 | 3.031 / 3.053 / 3.038 | 1.580 / 1.571 / 1.538 | 1.445 / 1.471 (1 missed) / 1.450 |
| Quote app CPU cores | 6.413 / 6.429 / 6.421 | 0.567 / 0.569 / 0.573 | 0.577 / 0.581 / 0.590 | |
| Mixed read→write p99 | 54,000→6,000 | 3.196→3.976 / 3.200→4.096 / 3.214→4.091 | 1.769→2.573 / 1.713→2.418 / 1.753→2.424 | 1.663→2.241 / 1.607→2.225 / 1.648→2.551 |
PHP returned 180,000 of 180,000 correct hot-SKU replies after tuning. The earlier campaign returned 84,068 correct, 59,280 wrong and 36,652 expired before send. The p99 of correct replies moved from 311.26 to 4.05 ms. We enabled persistent PDO and FastCGI reuse together for the tuned runs. The crossed catalog probe isolates PDO persistence on that setup.
Sam Rose’s Laravel Cloud benchmark (opens in a new tab) reported 1,774 requests/s for Rust and 97 for PHP in the best failure-free 10-second windows of a read-only MySQL ramp. Both Rust paths had lower quote p99 in all three paired blocks (two-sided exact sign test, p = 0.25 for each comparison with PHP). Our fixed loads did not establish maximum throughput.
Where the applications slowed down
The same order list took three SQL statements or 51
At 500 requests a second, PHP’s p99 went from 5.52 ms to 37.16 ms when we changed how it fetched relations for the same order list. With nginx and Rust, it went from 2.08 ms to 7.65 ms. The JSON stayed the same: 25 orders, each with a buyer, a total and four item SKUs. Each path returned 90,000 of 90,000 correct replies in both variants.
| How we fetched the list | SQL statements per list | nginx + PHP p99 | nginx + Rust p99 | Rust direct p99 |
|---|---|---|---|---|
| Eager load, selected columns | 3 | 5.33 ms | 1.99 ms | 1.93 ms |
| Eager load, wide rows | 3 | 5.52 ms | 2.08 ms | 2.00 ms |
| Load both relations for each order, wide rows | 51 | 37.16 ms | 7.65 ms | 7.27 ms |
Eloquent lazy-loads a relationship on first access (opens in a new tab). Rust needed an explicit load call (opens in a new tab). Eager loading made one query each for orders, buyers and items. Fetching both relations inside the loop made 50 queries after the order query. We counted them with pg_stat_statements (opens in a new tab).
The wide variants fetched a 2 KiB notes field per order that the JSON never used. Dropping it removed 50 KiB per page, with a smaller p99 change. If your list slows as it grows, count statements first, then inspect the columns they select.
Individual ORM trials
Each trial returned 30,000 of 30,000 replies correctly. Values are p99 in ms.
| Variant | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|
| Eager, projected | 5.244 / 5.340 / 5.328 | 2.010 / 1.989 / 1.976 | 1.931 / 1.931 / 1.950 |
| Eager, wide | 5.432 / 5.518 / 5.545 | 2.060 / 2.083 / 2.096 | 2.003 / 1.995 / 1.984 |
| Per-order, wide | 37.159 / 37.414 / 37.092 | 7.617 / 7.673 / 7.654 | 7.268 / 7.337 / 7.077 |
Dependency waits and cache misses changed the result
| Control | nginx + PHP p99 | nginx + Rust p99 | Rust direct p99 |
|---|---|---|---|
| Dashboard, serial calls | 308.64 ms | 304.46 ms | 304.33 ms |
| Dashboard, concurrent calls | 206.68 ms | 202.77 ms | 202.62 ms |
| Checkout, no shipping call | 4.17 ms | 2.37 ms | 2.25 ms |
| Checkout, synchronous 75 ms shipping call | 82.93 ms | 78.43 ms | 78.23 ms |
The dashboard called services with delays of 25, 75 and 200 ms. With PHP’s HTTP pool (opens in a new tab) and Rust’s task::try_join! (opens in a new tab), the origin saw all three calls in flight at once. The serial runs issued one call at a time. When we stalled promotion in the preflight, each path returned 502 after its 350 ms upstream deadline. Only the two faster calls completed.
At 350 checkouts/s, PHP timed out on 8 of 63,000 attempts with the shipping call on the critical path. The ledger matched four committed order keys to a timeout with no successful acknowledgment. Both Rust paths returned 63,000 correct replies each. PHP averaged about one app CPU core in the blocking trials.
When we released 24 requests against a cold shipping cache, each path made 24 origin calls. With a cache lock (opens in a new tab) and a cache recheck by waiting readers, all 24 got the right answer and the origin saw one call. The first all-hit series reused a key and recorded one direct Rust rebuild during warm-up or timing. We changed the protocol afterward and gave every recheck a fresh key. None rebuilt, and direct Rust missed one scheduled send.
Individual dashboard and checkout control trials
Values are p99 in ms. The parallel dashboard earns points; the serial dashboard and the two checkout variants are diagnostic. All replies were correct apart from the timeouts shown.
| Workload | Offered per trial | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|---|
| Parallel dashboard | 4,500 | 206.502 / 206.956 / 206.684 | 202.761 / 202.769 / 202.800 | 202.616 / 202.656 / 202.556 |
| Serial dashboard | 4,500 | 308.599 / 308.636 / 308.701 | 304.486 / 304.404 / 304.464 | 304.331 / 304.344 / 304.235 |
| Checkout control | 21,000 | 4.175 / 4.171 / 4.125 | 2.367 / 2.348 / 2.378 | 2.245 / 2.238 / 2.257 |
| Checkout with blocking call | 21,000 | 82.600 (1 timeout) / 83.047 (7 timeouts) / 82.932 | 78.451 / 78.386 / 78.433 | 78.181 / 78.255 / 78.231 |
Background and realtime
Jobs took about a second to finish at the tail
| Workload | nginx + PHP p99 ack / finish | nginx + Rust p99 ack / finish | Rust direct p99 ack / finish |
|---|---|---|---|
| PostgreSQL queue, 9,000 jobs per path | 5.60 / 997.34 ms | 3.95 / 993.32 ms | 3.66 / 995.58 ms |
| Durable workflow, 2,700 runs per path | 10.84 ms / 7.04 s | 7.05 ms / 6.45 s | 6.38 ms / 6.46 s |
| Reverb, 9,000 publishes per path | 5.53 / 5.30 ms | 3.99 / 4.25 ms | 3.81 / 3.97 ms |
Each value is the median of three run p99s from scheduled arrival. Acknowledgment and WebSocket delivery use the load generator’s monotonic clock. Effect times compare PostgreSQL’s insertion timestamp with the loader’s wall clock on the same guest. The insertion clock precedes commit. One queue worker (opens in a new tab) per deployment polled PostgreSQL every second when idle. All 27,000 jobs met both deadlines. A separate forced-failure check verified retry and one recorded effect per job.
The five-second sleep used Laravel Rust’s native workflows (opens in a new tab). PHP used an application state machine with a PostgreSQL row and delayed jobs. All 8,100 timed workflows met the acknowledgment and final-effect deadlines. In preflight we sent SIGTERM after the first checkpoint, restarted the worker during the sleep and verified one prepare, one finish and terminal state. Failure after an external effect and before its checkpoint still calls for an idempotency key.
We used PHP Reverb 1.14.0 (opens in a new tab) and Rust’s optional Reverb integration (opens in a new tab) in single-process mode. The verifier matched 1,728,000 event-and-subscriber pairs with no missing or duplicate deliveries. The public channel on the private bridge exercised fan-out. Private-channel authorization and reconnects were outside the test. A subscriber can get a frame before the publisher gets its HTTP reply.
Individual queue, workflow and WebSocket trials
Values are acknowledgment → recorded effect or last subscriber, in p99 ms. Every offered ID met both deadlines in each trial.
| Workload | Offered per trial | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|---|
| Queue | 3,000 | 5.581→995.247 / 5.634→999.270 / 5.599→997.343 | 3.835→991.394 / 3.964→993.319 / 3.954→996.891 | 3.723→995.689 / 3.664→993.130 / 3.653→995.579 |
| Workflow | 900 | 10.835→7035.293 / 10.858→7022.052 / 10.587→7039.867 | 6.836→6458.154 / 7.064→6449.845 / 7.053→6439.563 | 6.861→6456.959 / 6.228→6455.070 / 6.380→6453.043 |
| WebSocket | 3,000 | 5.590→5.406 / 5.506→5.299 / 5.527→5.228 | 4.031→4.256 / 3.936→4.177 / 3.986→4.252 | 3.678→3.917 / 3.806→3.969 / 3.882→4.052 |
Rendering, mail and developer checks
| Workload | nginx + PHP | nginx + Rust | Rust direct | What we verified |
|---|---|---|---|---|
| Server-rendered view, HTTP p99 | 2.49 ms | 1.43 ms | 1.32 ms | Blade and MiniJinja rendered the same 25 prices and escaped Tea & <Lime>. |
| Inertia JSON, HTTP p99 | 2.92 ms | 1.49 ms | 1.35 ms | Initial HTML carried the expected page data. A partial reload returned the deferred lines. A stale asset version returned 409. |
| SMTP, unique receipts / sender elapsed | 100,000 / 466.68 s | 100,000 / 441.03 s | 100,000 / 440.78 s | The receiver matched every recipient ID from ten senders per path. |
PHP used the Inertia Laravel adapter 3.8.0 (opens in a new tab). Rust used its built-in Inertia integration (opens in a new tab). We timed the JSON response after checking the first HTML and deferred props over private HTTP. These samples leave out browser rendering and the Node SSR sidecar.
Laravel PHP used Symfony’s SMTP transport (opens in a new tab). Rust registered a custom transport (opens in a new tab) using lettre 0.11.19 (opens in a new tab). Both opened a fresh SMTP connection per message. The go-smtp 0.24.0 (opens in a new tab) sink checked the recipient, subject and nonempty body. Each sender waited for its reply before starting the next message. The four-vCPU trials ran once each in fixed order. The times describe those runs.
Individual rendering trials and SMTP receipt reconciliation
Rendering values are p99 in ms. SMTP shows unique receipts per 100,000 offered, with zero missing, duplicate or unexpected receipts and no disagreement with HTTP acknowledgments.
| Workload | Offered per trial | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|---|
| View | 60,000 | 2.484 / 2.486 / 2.503 | 1.428 / 1.437 / 1.411 | 1.321 (1 missed) / 1.324 / 1.347 |
| Inertia | 30,000 | 2.924 / 2.920 / 2.931 | 1.487 / 1.510 / 1.488 | 1.353 / 1.358 / 1.353 |
| SMTP | 100,000 | 100,000 | 100,000 | 100,000 |
Release checks outside the timed matrix
Laravel Rust’s beta announcement (opens in a new tab) lists these capabilities. We checked them separately.
| Capability | What passed in the lab | Scope |
|---|---|---|
| Migrations and scheduling | Both CLIs rolled back a failed PostgreSQL migration, applied it once on retry, skipped the applied migration on rerun and wrote one scheduled effect. | Rust migrations (opens in a new tab), PHP migrations (opens in a new tab). |
| OAuth and test helpers | Both test runners passed an in-process HTTP assertion and returned the same faked GitHub provider and user ID. | PHP used Socialite 5.33.0 (opens in a new tab). Rust used social::fake() (opens in a new tab). The fakes skip real token exchange. |
| Trace export | A private OTLP collector received the Rust dashboard span with the supplied parent and three outgoing HTTP child spans. | Laravel Rust tracing (opens in a new tab) with the optional exporter enabled for the probe. We left export off for timing. |
Sources
- Laravel: Taylor Otwell’s beta announcement (opens in a new tab) and Sam Rose’s Cloud benchmark (opens in a new tab), 1 December 2026. Benchmark updated 3 December.
- Framework pins: Laravel PHP 13.45.0 (opens in a new tab) and Laravel Rust 0.2.0 at
9d3d535(opens in a new tab). - Ingress: nginx upstream keep-alive (opens in a new tab) and the PHP manual’s FPM pool configuration (opens in a new tab) and persistent connections (opens in a new tab).
- Database: Linux IP sysctls (opens in a new tab), PostgreSQL 18.7 (opens in a new tab) and PgBouncer settings (opens in a new tab).
- Adapters: Reverb 1.14.0 (opens in a new tab), Inertia Laravel 3.8.0 (opens in a new tab), Socialite 5.33.0 (opens in a new tab), lettre 0.11.19 (opens in a new tab) and go-smtp 0.24.0 (opens in a new tab).
Which Laravel stack would we choose today?
We’d pick Laravel Rust for a new service shaped like our quote workload. It used about 91% less app CPU than tuned PHP at the same rate. Across three paired trials on private HTTP, direct Rust’s median quote p99 was 0.116 ms lower than Rust behind nginx. Scheduler p99 was about 1 ms. We’d keep nginx where it handles TLS or routing.
We’d keep Laravel PHP for an existing app that meets its deadlines and relies on PHP packages. Laravel Rust 0.2.0 is a beta. Its native workflows are worth trying if we’re already maintaining our own state machine.
What we would measure before moving production traffic
| Next measurement | How we’d run it | What it would decide |
|---|---|---|
| Capacity and cost | Step up a mixed workload at several CPU and memory budgets. Hold each step long enough to see CPU throttling, memory growth and database pressure. Report the highest load that still passes and CPU-hours and GiB-hours per million correct operations. | Whether Rust’s CPU savings mean fewer app replicas and lower total cost, including PostgreSQL and nginx. |
| Direct HTTP versus nginx at the edge | Repeat the same request mix through equivalent TLS and client protocols. Include connection churn, long-lived connections and restarts during traffic. Count handshake errors and requests interrupted by a rollout. | Whether bypassing nginx still matters with the edge features the service needs. |
| Recovery under load | Slow the database and private origins. Stop workers around effect and checkpoint boundaries and roll a WebSocket server while clients reconnect. Reconcile orders, jobs and deliveries, and time backlog clearance. | Whether retries and restarts preserve effects and whether service recovers by the deadline. |
| Features at production scale | Time Inertia SSR in a browser, test authorized channels and multi-node Reverb, and repeat the queue/cache runs with the production drivers. Measure mail acceptance, bounces and delivery separately with the production transport. | Whether the protocol and adapter checks carry over to the deployment we’d actually run. |
| Migration and maintenance | Port one route and identify which PHP packages we’d need to replace. Rehearse an upgrade and rollback. Record engineering time, replacement code, failing contract tests and rollback time. | Whether the savings justify replacing working PHP code and taking on a beta framework. |
Same pass points, different speeds
The quote earned five points if every repeat passed correctness checks and met the 100 ms p99 limit. PHP’s median run p99 was 6.158 ms; direct Rust’s was 1.565 ms. Both earned five. The eight PHP timeouts came from a separate, unscored blocking-checkout test.
| Pass points | nginx + PHP | nginx + Rust | Rust direct |
|---|---|---|---|
| Original matrix | 100 / 100 | 100 / 100 | 95 / 100 |
| Fresh-key recheck | 100 / 100 | 100 / 100 | 100 / 100 |
Direct Rust lost five points for one cache rebuild. On the same guest, nominal 95% Wilson intervals for 3/3, 2/3 and 1/1 passes are 44–100%, 21–94% and 21–100%.