Laravel Rust benchmarks

Every public benchmark of Laravel Rust we could find: Laravel's own, and 7 independent tests on other machines. Each number sits next to the setup that produced it.

Updated · 9 sources

18×Laravel's own test, on Laravel Cloud

5–15×7 independent tests, on their own machines

How much faster than PHP?

Laravel Rust's throughput divided by the PHP setup's, in each test. The gap depends on the app, the database and the machine far more than on the language. Open a row for the setup behind it.

  1. Laravel (Sam Rose)officialvs Octane on FrankenPHP18.3×
    Laravel Rust
    1,774 req/s
    Laravel PHP
    97 req/s, Octane on FrankenPHP, 4 workers
    Machine
    Laravel Cloud, 1 vCPU and 4 GiB per app, MySQL 8.4
    Workload
    A read-only chirps API, k6 ramp from 1 to 2,000 requests a second over 20 minutes

    Laravel ran it on its own product. The score is the best 10-second window with no failed request.

  2. ihxnnxsvs Octane on FrankenPHP14.5×
    Laravel Rust
    1,991 req/s
    Laravel PHP
    137 req/s, Octane on FrankenPHP, the original Eloquent code
    Machine
    Docker on a Ryzen 7 8845HS laptop, 1 vCPU per app
    Workload
    Laravel's own apps and k6 script

    With a JIT, toBase() and a SQL join, the same PHP app reached 1,061 req/s: Rust was then 1.9× ahead.

  3. Hafizvs Octane on FrankenPHPat least 11.9×
    Laravel Rust
    1,991 req/s
    Laravel PHP
    167 req/s, Octane on FrankenPHP, 4 workers
    Machine
    Hetzner, 1 dedicated vCPU and 4 GiB, MySQL on its own server
    Workload
    Laravel's own apps and k6 script, unchanged

    Rust hit the 2,000 req/s ceiling of the script, so its real limit is higher. On a €7 VPS the gap was 11.2×.

  4. Rapira teamvendorvs Octane on FrankenPHPat least 10.3×
    Laravel Rust
    1,944 req/s
    Laravel PHP
    189 req/s, Octane on FrankenPHP, 4 workers
    Machine
    Podman on a Ryzen 9 9950X3D, 1 CPU per container
    Workload
    Laravel's workload, with a 3-minute ramp to 2,000 requests a second

    Rapira sells a PHP runtime and benchmarked it in the same post. Rust hit the 2,000 ceiling here too.

  5. mochavinvs Octane on FrankenPHP7.4×
    Laravel Rust
    5,696 req/s
    Laravel PHP
    771 req/s, Octane on FrankenPHP, Laravel 12
    Machine
    Azure D4as v6, 4 vCPU, PostgreSQL 16
    Workload
    Mixed HTTP and database routes under k6

    The PHP figure is a reference line in the README, without its date or full row.

  6. Punyapal Shahvs PHP-FPM with OPcache6.4×
    Laravel Rust
    869 req/s
    Laravel PHP
    135 req/s, PHP-FPM with OPcache
    Machine
    WSL2 on an Intel i7-12700H laptop, SQLite in WAL mode
    Workload
    A CRUD app with 10 concurrent clients

    SQLite takes one writer at a time, which caps how far any framework can pull ahead.

  7. emmpaulvs Octane on FrankenPHP5.2×
    Laravel Rust
    15,541 req/s
    Laravel PHP
    2,965 req/s, Octane on FrankenPHP, 20 workers
    Machine
    One Apple M3 Pro, PostgreSQL 19, k6 on the same machine
    Workload
    A mini Twitter API, read scenario, up to 500 virtual users

    App, database and load tool shared one laptop, so these compare the apps, not their capacity.

  8. rebinvs Octane on FrankenPHP5.1×
    Laravel Rust
    29,936 req/s
    Laravel PHP
    5,837 req/s, Octane on FrankenPHP
    Machine
    One Apple M5 Pro, MySQL 8.4, oha on the same machine
    Workload
    GET 20 products from a 10,000-row table, 50 connections

    On a tiny JSON route the gap was 6.1×; on an insert it was 1.9×, or 2.7× with a bigger database pool.

Laravel's own benchmark

Sam Rose at Laravel built the same small chirps API in six frameworks and ran each on one 1 vCPU, 4 GiB Laravel Cloud instance with its own MySQL database. k6 ramped from 1 to 2,000 requests a second over 20 minutes. None of the six reached 2,000.

Measure to show
Peak requests a second with no failed requestLonger is better
Stackreq/s
Laravel Rust1,774 req/s
Rocket1,623 req/s
Beego1,596 req/s
Rails253 req/s
Django183 req/s
Laravel PHP97 req/s

Laravel Rust served the most, 9% more than Rocket, a plain Rust framework. Most of its lead over PHP comes from Rust itself.

Median response time in the peak windowShorter is better
Stackms
Laravel Rust65 ms
Rocket110 ms
Beego275 ms
Rails121 ms
Django689 ms
Laravel PHP1,995 ms

Laravel PHP was already saturated at its peak, so requests waited about two seconds in the queue. Rust answered in 65 ms at 18 times the traffic.

Slowest 1% of responses in the peak windowShorter is better
Stackms
Laravel Rust137 ms
Rocket213 ms
Beego940 ms
Rails283 ms
Django987 ms
Laravel PHP2,707 ms

Rust's slowest 1% stayed under 140 ms at 1,774 requests a second. Beego, a Go framework, kept up on throughput but not on its tail.

CPU used at a steady 50 requests a secondShorter is better
Stack%
Laravel Rust4.2%
Rocket4.4%
Beego5.2%
Rails20.5%
Django28.1%
Laravel PHP52.4%

For the same 50 requests a second, Laravel PHP used about 12 times the CPU of Laravel Rust. This is the number that decides how many servers you pay for.

Median response time at a steady 50 requests a secondShorter is better
Stackms
Laravel Rust62 ms
Rocket60 ms
Beego58 ms
Rails69 ms
Django60 ms
Laravel PHP78 ms

At light traffic every framework answered in 58 to 78 ms. Your users would not feel the difference; your server bill would.

Highest memory use during the rampShorter is better
StackMB
Laravel Rust179 MB
Rocket146 MB
Beego159 MB
Rails252 MB
Django147 MB
Laravel PHP481 MB

Laravel PHP, with four Octane workers, peaked at 481 MB. Rust peaked at 179 MB while serving 18 times the requests.

Median time to the first response after scaling from zeroShorter is better
Stackms
Laravel Rust154 ms
Rocket156 ms
Beego154 ms
Rails259 ms
Django350 ms
Laravel PHP712 ms

After scaling to zero, a Rust app answered its first request in a median 154 ms, against 712 ms for PHP.

Median cold build on Laravel CloudShorter is better
StackTime
Laravel Rust3m 1s
Rocket2m 10s
Beego1m 6s
Rails53 s
Django37 s
Laravel PHP27 s

The price: a cold Laravel Rust build on Cloud took a median 3 minutes, against 27 seconds for PHP.

Source: Laravel Rust: 18× the throughput of Laravel PHP, and the apps and k6 script. Latency is in milliseconds. Laravel PHP ran on Octane with FrankenPHP and four workers.

Laravel Rust vs Laravel Go

Laravel hasn't published a Go benchmark. emmpaul built the same two APIs in Laravel PHP, Laravel Go and Laravel Rust and ran them on one Apple M3 Pro with PostgreSQL. Rust and Go land close on throughput; Rust's slowest responses and CPU use are clearly lower.

Scenario to show

Timeline and profile reads on a mini Twitter API

Requests a secondLonger is better
Stackreq/s
Rust15,541 req/s
Go13,893 req/s
PHP2,965 req/s
Median responseShorter is better
Stackms
Rust11 ms
Go9.8 ms
PHP61.1 ms
Slowest 1%Shorter is better
Stackms
Rust45.7 ms
Go85 ms
PHP217 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust301%
Go493%
PHP778%
Peak memoryShorter is better
StackMB
Rust110 MB
Go126 MB
PHP204 MB

90% reads, 8% new posts, 2% follows

Requests a secondLonger is better
Stackreq/s
Rust12,090 req/s
Go11,352 req/s
PHP2,992 req/s
Median responseShorter is better
Stackms
Rust13.7 ms
Go11.2 ms
PHP61.1 ms
Slowest 1%Shorter is better
Stackms
Rust60.1 ms
Go112 ms
PHP226 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust258%
Go424%
PHP757%
Peak memoryShorter is better
StackMB
Rust107 MB
Go115 MB
PHP204 MB

Product lists and pages on a mini shop

Requests a secondLonger is better
Stackreq/s
Rust15,091 req/s
Go15,464 req/s
PHP3,419 req/s
Median responseShorter is better
Stackms
Rust7.5 ms
Go5.8 ms
PHP52.5 ms
Slowest 1%Shorter is better
Stackms
Rust75.9 ms
Go107 ms
PHP189 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust259%
Go461%
PHP815%
Peak memoryShorter is better
StackMB
Rust128 MB
Go144 MB
PHP251 MB

POST an order: a transaction across several tables

Requests a secondLonger is better
Stackreq/s
Rust3,271 req/s
Go3,037 req/s
PHP1,121 req/s
Median responseShorter is better
Stackms
Rust56.3 ms
Go52.7 ms
PHP169 ms
Slowest 1%Shorter is better
Stackms
Rust208 ms
Go313 ms
PHP684 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust213%
Go313%
PHP505%
Peak memoryShorter is better
StackMB
Rust123 MB
Go133 MB
PHP220 MB

Orders that fight over the same 10 products, so rows lock

Requests a secondLonger is better
Stackreq/s
Rust1,413 req/s
Go1,337 req/s
PHP676 req/s
Median responseShorter is better
Stackms
Rust121 ms
Go120 ms
PHP279 ms
Slowest 1%Shorter is better
Stackms
Rust521 ms
Go696 ms
PHP832 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust54.2%
Go103%
PHP195%
Peak memoryShorter is better
StackMB
Rust108 MB
Go105 MB
PHP200 MB

A route that returns a tiny JSON body and never touches the database

Requests a secondLonger is better
Stackreq/s
Rust98,026 req/s
Go88,032 req/s
PHP12,200 req/s
Median responseShorter is better
Stackms
Rust1.3 ms
Go1.2 ms
PHP13.3 ms
Slowest 1%Shorter is better
Stackms
Rust8.2 ms
Go12.6 ms
PHP67.3 ms
CPU, mean, % of one coreShorter is better
Stack%
Rust359%
Go443%
PHP985%
Peak memoryShorter is better
StackMB
Rust44.4 MB
Go89 MB
PHP250 MB

Source: laravel-php-vs-rust-vs-go: the same API in Laravel PHP, Laravel Go and Laravel Rust. Laravel Go 0.1.0, Laravel Rust 0.1.4, Laravel PHP 13 on Octane with 20 workers. App, database and k6 shared one machine, so read these as a comparison, not as capacity. CPU is a percentage of one core, so 300% is three cores.

Two more tests with all three

Requests a second, mixed routes on a 4 vCPU Azure VM with PostgreSQLLonger is better
Stackreq/s
Laravel Rust5,696 req/s
Laravel Go5,433 req/s
Laravel PHP771 req/sOctane, Laravel 12
Requests a second, a CRUD app on SQLite with 10 clientsLonger is better
Stackreq/s
Laravel Rust869 req/s
Laravel Go633 req/s
Laravel PHP135 req/sPHP-FPM

Sources: mochavin on a 4 vCPU Azure VM, and Punyapal Shah on a laptop with SQLite(our guide to it).

The independent reruns

Four people reran Laravel Rust against PHP on their own hardware and published every number. Pick one to see what it found.

Rerun to show

Laravel Rust vs Laravel PHP: I repeated the official benchmark on Hetzner ↗

Hafiz ·

Ran Laravel's apps and k6 script byte for byte on rented Hetzner servers, and added PHP-FPM. Rust served 11 to 13 times what Octane did on every server, and it was the only stack that never dropped a request on a 1 GB box.

Chart to show
Peak requests a second, 1 dedicated vCPULonger is better
Stackreq/s
Laravel Rust≥ 1,991 req/shit the load cap
Octane167 req/s
PHP-FPM92.5 req/s
Peak requests a second, €7 VPS with 2 shared vCPULonger is better
Stackreq/s
Laravel Rust1,013 req/s
Octane90.3 req/s
PHP-FPM61.9 req/s
Failed requests at a steady 50 a second, 1 vCPU and 961 MiBShorter is better
Stack%
Laravel Rust0
Octane66.7%
PHP-FPM97.6%
The app's own memory at 50 requests a second, without file cacheShorter is better
StackMiB
Laravel Rust6.7 MiB
Octane88.9 MiB
PHP-FPM27.9 MiB

Setup

  • Hetzner, Helsinki. App limited to 1 dedicated vCPU and 4 GiB, MySQL 8.4 on its own server, k6 on a third.
  • Also a €7 VPS with 2 shared vCPU, then the same VPS booted with 1 vCPU and 961 MiB.
  • Laravel Rust 0.1.0; FrankenPHP 1.13.6 with PHP 8.5; nginx with PHP-FPM 8.5, OPcache on.

Keep in mind

  • Plain HTTP on a private network, so latencies are not comparable with Laravel Cloud, which adds TLS and an edge.
  • On the 1 GB box the kernel ran out of memory three times during PHP runs and killed MySQL each time. It never happened during a Rust run.
  • One region, one day, one small API.

The end of an era? I benchmarked Laravel Rust against PHP ↗

rebin ·

Built his own small API twice and ran PHP two ways. Rust was 5 to 6 times Octane on reads but under 2 times on inserts, and its slowest 1% on reads was worse than both PHP setups.

Chart to show
Requests a second, GET 20 productsLonger is better
Stackreq/s
Laravel Rust29,936 req/s
Octane5,837 req/s
PHP-FPM4,423 req/s
Requests a second, POST one validated rowLonger is better
Stackreq/s
Rust, pool of 10021,610 req/s
Rust, pool of 1015,142 req/s
Octane7,918 req/s
PHP-FPM5,412 req/s
Slowest 1% of responses, GET 20 productsShorter is better
Stackms
Rust, pool of 10030 ms
Rust, pool of 1023 ms
PHP-FPM20 ms
Octane12 ms
Peak memory under loadShorter is better
StackMB
Laravel Rust82 MB
Octane264 MB
PHP-FPM804 MB

Setup

  • One Apple M5 Pro with 48 GB, MySQL 8.4, no Docker. The load tool, oha, ran on the same machine.
  • Laravel PHP on PHP 8.6, run on PHP-FPM with nginx and on Octane with FrankenPHP. Laravel Rust 0.1.3.
  • 50 connections, 10 seconds of warm-up, then the median of three 30-second runs.

Keep in mind

  • A laptop is not a production server, and the load tool shared it with the apps.
  • The throughput and memory figures come from the labels on his charts.
  • He could not explain why Rust's tail was slower; a bigger database pool did not fix it.

laravel-symfony-benchmarking: Laravel PHP, Laravel Rust and Symfony on the original workload ↗

ihxnnxs ·

Reran Laravel's workload in Docker and added Symfony. Tuned PHP closed most of the gap: Symfony on Swoole matched Rust at the 2,000 req/s cap, and a JIT with toBase() took Laravel PHP from 137 to 1,061.

Chart to show
Peak requests a second in the rampLonger is better
Stackreq/s
Laravel Rust1,991 req/sat the cap
Symfony, FrankenPHP1,991 req/sat the cap
Symfony, Swoole1,990 req/sat the cap
Laravel PHP, tuned1,061 req/s
Laravel PHP137 req/s
Slowest 1% of responses in the peak windowShorter is better
Stackms
Symfony, Swoole8.1 ms
Laravel Rust10 ms
Symfony, FrankenPHP32.6 ms
Laravel PHP, tuned1,499 ms
Laravel PHP4,413 ms
Peak memory in the rampShorter is better
StackMiB
Symfony, Swoole72.7 MiB
Laravel Rust85.9 MiB
Symfony, FrankenPHP100 MiB
Laravel PHP314 MiB
Laravel PHP, tuned538 MiB

Setup

  • Docker on an AMD Ryzen 7 8845HS. Each app and each MySQL 8.4 got 1 vCPU and 4 GiB; k6 got 2 vCPU.
  • Laravel's own apps, data and 20-minute ramp to 2,000 requests a second.
  • Laravel PHP 13 on Octane with FrankenPHP; Symfony 8.2 on Swoole 6.2 and on FrankenPHP 1.14.

Keep in mind

  • Local runs, which the author says are not comparable with Laravel Cloud over HTTPS.
  • Symfony was tuned across several runtime settings; the Laravel PHP app mostly was not.
  • The tuned Laravel PHP run still dropped 285,733 requests over the full ramp.

Laravel Rust vs PHP: is PHP the bottleneck? ↗

Rapira team · vendor test

Raised the ceiling to 5,000 requests a second to find where each stack breaks. Symfony on Swoole peaked highest; Laravel Rust peaked lower but was the only fast stack with no failures and a low tail at its peak.

Chart to show
Peak requests a second in the ramp to 5,000Longer is better
Stackreq/s
Symfony, Swoole3,430 req/s
Symfony, Rapira2,913 req/s
Laravel Rust, no Caddy2,638 req/s
Laravel Rust, Caddy2,083 req/s
Slowest 1% of responses at each stack's peakShorter is better
Stackms
Laravel Rust, no Caddy12.1 ms
Laravel Rust, Caddy14.2 ms
Symfony, Rapira494 ms
Symfony, Swoole2,009 ms
Peak requests a second in the ramp to 2,000, Laravel appsLonger is better
Stackreq/s
Laravel Rust, Caddy1,944 req/sat the cap
Laravel PHP, Rapira191 req/s
Laravel PHP, Octane189 req/s

Setup

  • Podman on an AMD Ryzen 9 9950X3D, 1 CPU and 4 GB per container, MySQL 8.4 in its own container.
  • Laravel's workload with 3-minute ramps to 2,000 and to 5,000 requests a second.
  • Laravel Rust with Caddy in front, as Laravel ships it, and without Caddy, gzip done in the app.

Keep in mind

  • Rapira sells the PHP runtime it tested, and its builds were a development branch.
  • 3-minute ramps instead of 20, and MySQL on the same host, much closer than a managed database.
  • Its own conclusion: on this API, the PHP language was not the bottleneck; the Laravel app was.

What it costs: build times

PHP has no compile step, so a deploy is a composer install. Rust compiles the whole app first. Every test that timed it agrees on the cost; how big it is depends on the machine.

Time to build the app, as each source measured itShorter is better
StackTime
Laravel RustHafiz, release build on a €7 VPS10m 57s
Laravel RustHafiz, release build on 4 dedicated vCPU3m 2s
Laravel RustLaravel, median cold build on Laravel Cloud3m 1s
Laravel RustPunyapal, cold compile on an i7 laptop2m 15s
Laravel Rustrebin, clean build on an M5 Pro52 s
Laravel PHPLaravel, median cold build on Laravel Cloud27 s
Laravel RustLaravel, cold local build on an M4 Pro19.4 s
Laravel GoPunyapal, cold compile on an i7 laptop19 s
Laravel RustLaravel, rebuild after a change on an M4 Pro1.1 s

A rebuild after a small change is the number you feel while coding: about a second on Laravel's M4 Pro. On a cheap VPS, build somewhere else and ship the binary.

How many servers would that be?

A sense of scale from Laravel's numbers: one 1 vCPU server served 1,774 requests a second in Laravel Rust and 97 in Laravel PHP. Drag to your busiest minute.

1,000

That is about 86 million requests a day.

Laravel Rust1 server

Laravel PHP11 servers

Each dot is one 1 vCPU, 4 GiB server running at its best failure-free rate, with no headroom. Your app is not Laravel's chirps API, so treat this as a sense of scale, not a capacity plan.

What every test agrees on

  1. Rust serves far more requests than any PHP setup tested. Between 5 and 18 times Octane, depending on the app, the database and the machine.
  2. At light traffic, you won't feel it. At 50 requests a second, medians were within 20 ms of each other. The gain shows up in CPU and memory.
  3. Rust needs a fraction of the CPU and memory, which is what lets it run on smaller, cheaper servers and survive a 1 GB box that PHP crashed.
  4. The slowest responses aren't always better. In rebin's and Punyapal's tests, Rust's slowest 1% was slower than PHP's.
  5. Tuned PHP closes much of the gap. Symfony on Swoole kept up with Rust in two tests, and a JIT with toBase() took Laravel PHP from 137 to 1,061 requests a second.
  6. Builds are the price: minutes where PHP takes seconds.
How we chose and read these numbers

We include a test only when its author published the numbers and the setup, and ran Laravel Rust against at least one other stack. Every figure is copied as the source wrote it; we have run none of these ourselves.

Each ratio divides Laravel Rust's throughput by the PHP setup's in the same test. Don't compare numbers across tests: one ran on a laptop with SQLite, another on cloud servers with MySQL. Where a source flagged a number, or sold one of the products it tested, we say so next to it.

Laravel Rust is at version 0.1, so expect all of these to move.

Sources