Laravel for Rust vs php-fpm, Octane, FrankenPHP and artisan serve
Measured 2026-12-03 (SAST) on a 4 core mini PC. All five setups ran in one session, each alone in a Docker container capped at 2 CPUs and 1 GB, against the same MySQL 8.4 database (a small kanban app: about 130 tasks, 6 projects, 480 history rows). The PHP side is a real Laravel 13 app with Filament installed, opcache on, artisan optimize run, production mode (PHP 8.5 for php-fpm, 8.4 for the FrankenPHP based setups). The Rust side is the saapp ported to Laravel for Rust 0.1.4 (beta), release build. php-fpm mirrors a typical Laravel Forge production server: nginx, unix socket, pm = static with 8 children, opcache 512 MB, no timestamp checks. Octane runs on FrankenPHP with 4 workers; artisan serve runs with 4 workers. Load from wrk: 2 s warm-up, then 5 s at 1, 32 and 128 connections. Memory is the container working set read from its cgroup every 100 ms. Green cells are the best value in each row. One run, expect about ±10%.
The six endpoints
Identical in both apps: hello returns plain text; json returns a small static object; task loads one row through the ORM; tasks loads 50 rows with a belongs-to relation eager loaded and returns them as JSON; stats runs four count queries; write loads one row and updates it through the ORM (model events fire).
Rust vs php-fpm, reads at 32 connections30× to 220×
Rust vs php-fpm, ORM write5×
Rust vs Octane, reads9× to 74×
Lowest memory under loadRust and php-fpm, about 70 MiB
Throughput at 32 connections
Requests per second
1 connection (one user, sequential)
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 7,981 | 131 | 517 | 121 | 101 | 61× |
| json (static) | 7,773 | 130 | 526 | 120 | 101 | 60× |
| task (1 row) | 2,930 | 84.2 | 292 | 71.7 | 72.8 | 35× |
| tasks (50 rows + projects) | 1,061 | 34.2 | 37.6 | 27.8 | 31.0 | 31× |
| stats (4 counts) | 1,248 | 76.8 | 252 | 68.1 | 68.7 | 16× |
| write (ORM update) | 342 | 65.2 | 156 | 57.2 | 59.2 | 5× |
32 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 26,068 | 119 | 507 | 104 | 115 | 219× |
| json (static) | 25,723 | 132 | 476 | 111 | 134 | 195× |
| task (1 row) | 7,983 | 116 | 310 | 84.0 | 80.1 | 69× |
| tasks (50 rows + projects) | 2,512 | 29.9 | 34.1 | 24.2 | 26.3 | 84× |
| stats (4 counts) | 2,941 | 97.6 | 323 | 75.4 | 90.8 | 30× |
| write (ORM update) | 542 | 103 | 347 | 85.5 | 78.0 | 5× |
128 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 28,955 | 125 | 481 | 106 | 107 | 232× |
| json (static) | 26,545 | 116 | 529 | 101 | 144 | 230× |
| task (1 row) | 4,818 | 108 | 374 | 75.0 | 84.7 | 45× |
| tasks (50 rows + projects) | 2,498 | 26.9 | 32.6 | 25.9 | 27.2 | 93× |
| stats (4 counts) | 2,946 | 84.5 | 311 | 82.0 | 120 | 35× |
| write (ORM update) | 533 | 129 | 317 | 73.7 | 78.2 | 4× |
Latency (ms)
Median at 1 connection
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 0.12 | 7.5 | 1.8 | 7.9 | 9.2 | 65× |
| json (static) | 0.12 | 7.5 | 1.8 | 7.9 | 9.1 | 63× |
| task (1 row) | 0.31 | 11.5 | 3.4 | 13.7 | 12.9 | 38× |
| tasks (50 rows + projects) | 0.87 | 28.7 | 26.2 | 35.6 | 31.8 | 33× |
| stats (4 counts) | 0.72 | 12.6 | 3.7 | 14.3 | 13.6 | 17× |
| write (ORM update) | 2.9 | 15.0 | 6.0 | 17.0 | 15.9 | 5× |
p99 at 1 connection
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 0.31 | 10.5 | 3.8 | 11.0 | 14.4 | 34× |
| json (static) | 0.30 | 10.1 | 3.4 | 10.9 | 16.8 | 34× |
| task (1 row) | 0.76 | 15.3 | 5.9 | 20.4 | 21.4 | 20× |
| tasks (50 rows + projects) | 1.7 | 36.4 | 33.8 | 44.0 | 42.8 | 21× |
| stats (4 counts) | 1.5 | 22.2 | 7.4 | 19.6 | 23.2 | 15× |
| write (ORM update) | 5.3 | 22.1 | 10.9 | 24.4 | 26.2 | 4× |
Median at 32 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 1.1 | 284 | 71.3 | 317 | 291 | 251× |
| json (static) | 1.2 | 242 | 77.4 | 308 | 218 | 208× |
| task (1 row) | 3.9 | 249 | 105 | 402 | 394 | 65× |
| tasks (50 rows + projects) | 12.2 | 1,030 | 938 | 1,310 | 1,120 | 84× |
| stats (4 counts) | 10.1 | 324 | 103 | 427 | 357 | 32× |
| write (ORM update) | 58.5 | 289 | 81.8 | 383 | 407 | 5× |
p99 at 32 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 3.0 | 362 | 100 | 380 | 424 | 123× |
| json (static) | 3.0 | 360 | 99.3 | 374 | 405 | 121× |
| task (1 row) | 7.7 | 450 | 149 | 485 | 504 | 58× |
| tasks (50 rows + projects) | 21.6 | 1,360 | 1,090 | 1,460 | 1,850 | 63× |
| stats (4 counts) | 21.0 | 457 | 152 | 504 | 497 | 22× |
| write (ORM update) | 82.2 | 466 | 149 | 484 | 529 | 6× |
Median at 128 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 4.2 | 1,030 | 283 | 1,150 | 1,200 | 246× |
| json (static) | 4.6 | 1,100 | 260 | 1,220 | 783 | 240× |
| task (1 row) | 26.0 | 929 | 327 | 1,670 | 1,480 | 36× |
| tasks (50 rows + projects) | 49.9 | 1,040 | 833 | 843 | 945 | 21× |
| stats (4 counts) | 41.7 | 1,520 | 426 | 1,420 | 949 | 36× |
| write (ORM update) | 237 | 901 | 387 | 1,700 | 1,500 | 4× |
p99 at 128 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve | Rust vs php-fpm |
|---|
| hello (plain text) | 9.4 | 1,190 | 315 | 1,380 | 1,360 | 126× |
| json (static) | 10.1 | 1,190 | 307 | 1,380 | 1,430 | 118× |
| task (1 row) | 47.4 | 1,590 | 489 | 1,790 | 1,710 | 34× |
| tasks (50 rows + projects) | 65.9 | 1,920 | 1,990 | 2,000 | 1,960 | 29× |
| stats (4 counts) | 80.8 | 1,610 | 512 | 1,800 | 1,810 | 20× |
| write (ORM update) | 280 | 1,110 | 510 | 1,800 | 1,860 | 4× |
Memory
Per server (container working set)
| Server | Idle | After warm-up | Peak under load | 5 s after load | Image |
|---|
| Rust | 32 MiB | 35 MiB | 70 MiB | 62 MiB | 206 MB |
| php-fpm | 50 MiB | 66 MiB | 71 MiB | 67 MiB | 792 MB |
| Octane | 224 MiB | 227 MiB | 225 MiB | 221 MiB | 895 MB |
| FrankenPHP | 53 MiB | 51 MiB | 73 MiB | 69 MiB | 895 MB |
| artisan serve | 98 MiB | 101 MiB | 113 MiB | 108 MiB | 895 MB |
Rust's figure includes its 20 MB binary mapped from disk, which the kernel counts or not depending on recent use (12 MiB idle in yesterday's run, 32 MiB today, same image). Its private memory at idle is 7 MiB. PHP's figure includes the workers and, for php-fpm, nginx. Image sizes are the built containers, not runtime memory.
Peak MiB during each load run, 32 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve |
|---|
| hello (plain text) | 37.0 | 65.0 | 225 | 61.0 | 106 |
| json (static) | 37.0 | 66.0 | 214 | 63.0 | 107 |
| task (1 row) | 44.0 | 67.0 | 215 | 68.0 | 107 |
| tasks (50 rows + projects) | 59.0 | 69.0 | 215 | 68.0 | 109 |
| stats (4 counts) | 60.0 | 69.0 | 217 | 73.0 | 109 |
| write (ORM update) | 55.0 | 68.0 | 215 | 71.0 | 109 |
Peak MiB during each load run, 128 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve |
|---|
| hello (plain text) | 40.0 | 67.0 | 220 | 67.0 | 106 |
| json (static) | 40.0 | 67.0 | 221 | 65.0 | 106 |
| task (1 row) | 58.0 | 69.0 | 224 | 70.0 | 111 |
| tasks (50 rows + projects) | 70.0 | 71.0 | 216 | 73.0 | 109 |
| stats (4 counts) | 66.0 | 70.0 | 221 | 71.0 | 109 |
| write (ORM update) | 66.0 | 69.0 | 222 | 70.0 | 113 |
Efficiency: requests per second per MiB, 32 connections
| Endpoint | Rust | php-fpm | Octane | FrankenPHP | artisan serve |
|---|
| hello (plain text) | 704.5 | 1.8 | 2.3 | 1.7 | 1.1 |
| json (static) | 695.2 | 2.0 | 2.2 | 1.8 | 1.3 |
| task (1 row) | 181.4 | 1.7 | 1.4 | 1.2 | 0.7 |
| tasks (50 rows + projects) | 42.6 | 0.4 | 0.2 | 0.4 | 0.2 |
| stats (4 counts) | 49.0 | 1.4 | 1.5 | 1.0 | 0.8 |
| write (ORM update) | 9.9 | 1.5 | 1.6 | 1.2 | 0.7 |
Reading it
- Boot cost decides PHP's ceiling. php-fpm, FrankenPHP and artisan serve boot Laravel and Filament on every request (about 7.5 to 9 ms of CPU), so even an empty response tops out near 100 to 130 req/s on 2 CPUs. Octane boots once and gets 4 to 5 times further on light endpoints. Rust has no boot step.
- The 50 row list is about 30 ms in every PHP setup, Octane included: model hydration and JSON serialisation, not boot. Only Rust removes it (under 1 ms).
- Writes narrow the gap (Rust 5× php-fpm, 1.6× Octane) because the MySQL commit dominates.
- Memory: php-fpm is the leanest PHP option and roughly level with Rust's container figure, but serves 30 to 220 times fewer requests for it. Octane is the fastest PHP and the hungriest (about 225 MiB for 4 workers).
- Concurrency past 32 buys nothing on 2 CPUs: throughput is flat and latency grows. PHP classic modes reach 1 to 1.7 s medians at 128 connections, Rust stays under 50 ms on reads.
- artisan serve shows wrk socket read errors because the dev server closes every connection after replying; responses were 200.
Caveats: the PHP app boots Filament on every request, so a bare Laravel install would narrow the gap on hello and json. Single run on a machine that was also running other services. Laravel for Rust is a beta; numbers may change between releases.