Under the hood
Laravel for Rust, serverless on day one: what we measured
We deployed Laravel for Rust as a serverless container on the day it was released. The build times, the build cache, the memory and what the beta held back.
In this post
Laravel released Laravel for Rust on 1 December 2026. An application written with it compiles to one binary that speaks HTTP itself. It is a beta at version 0.x.
We wanted to know the same day whether such a binary fits the way Brewless runs Laravel: a serverless container in the customer's own Scaleway account, behind bunny.net. So we put a trial application through it, to Scaleway in fr-par. This post is what we measured, how the build cache works, and where the beta did not let a package do its job.
Note
Updated on 2 December 2026 with what day two brought: signed jobs, a worker that sleeps, files, mail and one cold start. Where day two changed what we wrote on day one, the text says so.
Can you deploy Laravel for Rust serverless today?
Yes. Since 1 December 2026 Brewless builds a Laravel for Rust application, runs its migrations and puts it live as a serverless container, with brewless init and brewless deploy. The framework is a beta, so our support is a beta too: its APIs may change before 1.0, and we release our crate to follow it.
The crate is brewless-laravel, the Cargo counterpart of the Composer package brewless/laravel. Rust has no package discovery, so its provider is registered by hand in src/app.rs. brewless init recognises the project from the laravel-rust dependency in Cargo.toml and writes this:
brewless.ymlorganisation: acme
application: shop
framework: laravel-rust
release:
- 'migrate --force'
There is no php line, and one is refused. The release command is a subcommand of the application's own binary, because the migrations are compiled into it. The documentation has every step, and the Laravel for Rust page the overview.
What did we measure?
Everything below is from one trial application on 1 December 2026. Your application compiles its own crates and does its own work, so your figures will differ.
| What | Figure | How |
|---|---|---|
| First build, nothing cached | 465 s | The step "Image built and pushed" of the deploy |
| Second build, with the cache | 125 s | The same step |
| The binary | 73 MB | 50 MB stripped |
| The base image under it | 31 MB | Compressed. Debian trixie with certificates. 11 MB since day two, see below |
| Memory at rest | 26 MB | The starter application in Docker on a laptop, on the same image |
| Memory after 200 requests | 53 MB | The same, each request read the database |
| Process start to the first 200 | About 150 ms | On /up, in Docker on the same image |
| A public page from the edge | 46 to 65 ms | From our office, answered by bunny.net |
The base image for PHP is 239 MB compressed, because it carries FrankenPHP, PHP and its extensions. The Rust image carries certificates and three libraries the binary needs: libc, libm and libgcc. On day one it carried the rest of a small Debian too. On day two we took that out: the base image is now 11 MB compressed, with no shell and no package manager, and a scan that found 13 known vulnerabilities without a fix in the Debian image, all in packages the binary never calls, finds 2 in this one. That is the only comparison with PHP we make here. We have no fair measurement of the same application on both.
One figure was missing on day one: how long a container that was scaled to zero takes to answer on Scaleway. The 150 ms is the process alone, and a cold start has more in it than the process. We measured one on day two, further down. The memory figures in the table are from a laptop too. On Scaleway the trial application's own process held about 84 MB in the web container and about 80 MB in the worker container.
The database is Scaleway Serverless SQL, handed over as one DATABASE_URL that ends in ?sslmode=require. TLS worked through the URL, without a change in src/config/database.rs. A database that slept made the first query wait 2.2 seconds.
Why is the second build so much shorter?
Because Cargo's work is kept between builds. A release build of the framework and its dependencies is far heavier than a Composer install, so the build runs as a Serverless Job with 4 vCPU and 8 GB in the customer's own Scaleway project, and may take up to an hour. It runs npm ci and npm run build when there is a package-lock.json, and then cargo build --release --locked.
A serverless job starts with an empty disk. Without a cache every deploy would pay the 465 seconds again. So after a build, what Cargo downloaded and compiled is packed with zstd into one object, 431 MB for the trial application, in the bucket the source is uploaded to. The next build fetches it first.
Three decisions shaped it:
- A link, never a key. The job gets a link to fetch that one object and a link to put it back. It never holds a key to the customer's storage.
- Put back only when it changed. The object is written again only when
Cargo.lockor the compiler changed. The application's own code is compiled again on every commit anyway, and sending 431 MB after every build would cost more time than it saves. - Never a reason to fail. A cache that is missing or cannot be read is thrown away, and the build starts from nothing, as the first one did.
A third build with the cache took 108 seconds, and one that added dependencies 389.
The image that comes out holds the binary, public/, resources/views/ and storage/. The source is not in it.
What did the beta not let a package do?
Two things, and both come from how young the framework is.
The visitor's hostname and address. Behind the edge the container sees its own address as the host and 127.0.0.1 as the peer. For PHP, our package corrects that inside the application. Laravel for Rust 0.1.2 and 0.1.3 decide a request's origin and the visitor's address before any middleware runs, and give a package no hook for it. Pages still work, but generated URLs and redirects point at the container's address.
We solved it one level up. In src/main.rs the application is started through the crate:
brewless_laravel::run(app::configure())
That is the framework's own run, with its console commands and graceful shutdown. On top of it, when a request carries the edge secret, the host bunny.net names in Cdn-Host and the visitor's address are taken over, and the request is routed once with them. Without the valid secret, forwarded headers are not believed. On the trial application on Scaleway, behind bunny.net, generated URLs then used the application's own domain and request.ip() was the visitor's address.
One job from a payload. For PHP, a job on Scaleway Queues calls the worker as it arrives. On day one the crate had no way to run one job from a payload inside the framework, so the worker was called every minute, 1,440 times a day, and the crate ran queue:work --stop-when-empty --max-time=45. That worked in Docker with PostgreSQL and an SQS-compatible queue. A worker that is called every minute never sleeps, so this was the first thing we went back to.
Why is a new application's page not kept by the edge?
Because it sets a cookie. The crate adds s-maxage to a GET or HEAD answer with status 200 that sets no cookie, and bunny.net then answers the next visitor itself. But the pages of a new Laravel for Rust application are in the web group, which starts a session and sets XSRF-TOKEN and the session cookie. With Inertia it adds Vary: X-Inertia as well.
A public page has to be taken out of those middleware on its route:
.without_middleware::<StartSession>()
.without_middleware::<PreventRequestForgery>()
With Inertia, HandleInertiaRequests goes the same way. On the trial application such a page came from bunny.net on the second request, with cdn-cache: HIT, in 46 to 65 ms and without the container being asked.
What happened to the worker on day two?
It went to sleep. Version 0.3 of the crate signs jobs, and with that the queue itself can call the worker, as it does for PHP.
With the crate's sqs feature, every job the application puts on the sqs connection is signed with a key derived from APP_KEY. Scaleway Queues delivers each message to the worker container as it arrives. The crate checks the signature and starts a worker of its own for that one job. Three jobs ran 0.8, 1.5 and 1.4 seconds after they were dispatched. A failing job ended in the failed jobs once, and "Try failed jobs again" in the console put it back. A message that is unsigned, tampered with or older than an hour is dropped, and so is a second delivery of a job that was handled. FIFO queues and jobs too large for a message are not signed.
The schedule runs through a Scaleway cron that calls the worker, in UTC. A task set to every minute left 17 rows between 22:43 and 22:59 UTC, each 0.2 to 0.3 seconds after the minute. Turned down to hourly, it left one row at 23:00 and none at 23:01 or 23:02.
Together that lets the worker sleep. Nothing called it between its last job at 23:25 UTC and the hourly cron at 00:00:03 UTC.
Then the cold start. At 00:13:16 UTC on 2 December we sent one request through bunny.net to the sleeping web container. It was answered after 2.31 seconds, and the container's log shows its start at 00:13:18. The next two requests took 1.47 and 0.12 seconds. That is one measurement, on the trial application with 512 MB and 0.5 vCPU in fr-par, from our office in the Netherlands. We do not read more into it than that.
Files were proven the same night. The framework's s3 disk wrote and read an object, and a temporary URL answered at Scaleway. The framework writes every object private and has no option for it, so bunny.net answered 403 on the files address until the object was made public with brewless_laravel::files::make_public(path). After that it answered 200 with cache-control: public, max-age=86400.
Mail came last, at 00:48 UTC. On day one the crate's smtp mailer was only proven against a local SMTP server. On a fresh environment with its own mail domain, a mail sent through it, signed in over STARTTLS on port 587, was accepted by Scaleway Transactional Email, which returned its message id, and the Mail page of the console showed the message. That one went to a domain without a mailbox. A second one, later that morning, arrived in a real inbox.
The new features have a price in the first build. With the crate's sqs and s3 features, which compile the AWS SDK crates, a first build without a cache took about 19 minutes, from the start of the build to the release command. The build after it, with the cache, took 158 seconds.
What is not there yet?
Mail through Lettermint: it has no package for Rust.
Missing altogether: tinker and a build with more than one binary. Security fixes of the base image under the binary are put under the live release without compiling, but a fix in a crate that was compiled in needs a deploy. The framework has no rollback command for migrations, so migrations only go forward, and brewless rollback puts the previous image back, not the database.
Every plan includes Laravel for Rust at the same price. If you try it, the crate's source is at github.com/brewless/laravel-rust, under the MIT licence.
Frequently asked questions
Can I deploy Laravel for Rust with Brewless today?
Yes, since 1 December 2026. Add the brewless-laravel crate, register its provider, change one line in src/main.rs and run brewless init and brewless deploy. Laravel for Rust is a beta at version 0.x, and the support in Brewless is a beta with it.
How long does a Laravel for Rust build take?
On our trial application the first build took 465 seconds and the second 125 seconds. The difference is the build cache, which keeps what Cargo downloaded and compiled between builds. Your own time depends on the crates your application compiles.
How fast is a cold start of Laravel for Rust on Scaleway?
We measured it once. On 2 December 2026 a request through bunny.net to the sleeping web container of our trial application was answered after 2.31 seconds, and the next two after 1.47 and 0.12 seconds. That is one measurement on one application with 512 MB and 0.5 vCPU, so your own figure will differ.
Does the machine that deploys still need PHP?
Yes. The Brewless command line client is a PHP program and needs PHP 8.3, also for a Rust project. The application and its container need no PHP, and brewless.yml has no php line for this framework.