Laravel is already famous for its expressive syntax and developer‑friendly tooling, but you can squeeze far more performance out of the framework by running it under Laravel Octane. Octane boots your application once, keeps it resident in memory, and then uses a high‑performance server like Swoole, RoadRunner, or (new in late 2023) FrankenPHP to handle every subsequent request at lightning speed.
A traditional Laravel request goes through a full bootstrap on every hit. Octane skips that entire cycle, which means:
5×–20× lower response times on simple routes. In a July 2025 benchmark of Laravel 12, FrankenPHP handled nearly 5× more requests per second than PHP‑FPM and still outpaced RoadRunner or the Swoole variants.
Dramatically higher throughput under concurrent load because workers are already warm.
Built‑in primitives (concurrent tasks, in‑memory cache, ticks) that remove the need for many “micro‑optimization” packages.
If you build APIs, real‑time dashboards, or queue‑heavy back ends, the gains are immediate and measurable.
When you start Octane, it:
Boots a pool of PHP workers equal to the CPU core count (or a custom --workers
value).
Sends each HTTP request directly to an idle worker.
Keeps the bootstrapped service container, routes, and configuration in RAM for the entire worker lifespan.
Optionally spins up separate task workers (Swoole only) so long‑running jobs don’t block the main request workers.
Because the framework stays alive between requests, cold‑start overhead disappears and your CPU can focus on actual business logic.
Engine | Strengths | Trade‑offs |
---|---|---|
FrankenPHP | Fastest raw throughput, single static binary, first‑class TLS & Early Hints support | Younger ecosystem |
OpenSwoole / Swoole | Mature async features, Octane‑only goodies (ticks, Octane cache, tables) | Requires PECL extension and careful memory hygiene |
RoadRunner | Written in Go, rich feature set (queues, workflows), excellent stability | Slightly less raw speed than FrankenPHP or OpenSwoole in 2025 tests |
Pick the server that matches your operational comfort: if you want raw speed with zero extensions, FrankenPHP is compelling; if you need async sockets or in‑memory tables, OpenSwoole shines; for enterprise‑grade process management, RoadRunner is battle‑tested.
composer require laravel/octane --dev
php artisan octane:install # Choose your preferred server when prompted
php artisan octane:start --server=frankenphp --workers=auto
Octane ships a config/octane.php
file where you can switch servers later or fine‑tune worker counts.
Setting | Purpose | Example |
---|---|---|
| Number of request workers |
|
| Separate pool for async tasks (Swoole) |
|
| Auto‑recycle workers to avoid memory leaks |
|
Keeping a sane --max-requests
is the simplest defence against slow, creeping leaks.
Test (100 concurrency, 30 s) | PHP‑FPM | RoadRunner | OpenSwoole | FrankenPHP |
---|---|---|---|---|
| 18 k RPS | 45 k RPS | 52 k RPS | 81 k RPS |
| 15 k RPS | 39 k RPS | 45 k RPS | 70 k RPS |
These numbers are from Stephen Roque’s July 2025 face‑off on identical hardware. Even heavyweight endpoints that perform external HTTP calls saw a 2×–4× lift.
use Laravel\Octane\Facades\Octane;
use Illuminate\Support\Facades\Http;
$result = Octane::concurrently([
fn () => Http::get('https://api.github.com/repos/laravel/octane')->json(),
fn () => Http::get('https://api.github.com/repos/laravel/framework')->json(),
]);
Both requests run in parallel, trimming external I/O latency.
Need a super‑fast, ephemeral cache?
Cache::store('octane')->put('framework', 'Laravel', 30);
Powered by Swoole tables, it can push ≈ 2 M ops/sec but resets if the server restarts.
Octane::tick('clear-temp', fn () => Storage::disk('temp')->deleteOldFiles())
->seconds(30);
Great for lightweight polling or housekeeping without firing a full Cron job.
Avoid static state and improper singletons. Data persists for the life of the worker, so accidental sharing can leak private information.
Watch memory. Use octane:status
, a low --max-requests
, and Laravel Pulse or Grafana to catch leaks early.
Check package compatibility. Some libraries assume a fresh boot per request. Test thoroughly and use Octane’s “flush” callbacks where needed.
Offload heavy jobs. Long‑running image conversions or reports still belong in queues or dedicated workers, not in an Octane request.
Tiny brochure sites that rarely exceed a few RPS. The complexity isn’t worth the marginal gain.
CPU‑bound bulk data exports where the work happens in queues or CLI anyway.
Environments where you can’t install extensions or custom binaries (shared hosting, some PaaS tiers).
Stick with classic PHP‑FPM in those cases.
Laravel Octane turns PHP’s traditional request‑per‑process model on its head. By keeping your app hot in memory and leveraging modern servers such as FrankenPHP, you unlock performance previously reserved for Go or Node stacks. The key is to respect the new rules of a persistent runtime: guard against shared state, recycle workers, and profile memory. Do that, and you’ll enjoy API responses that feel instant, happier users, and infrastructure that can handle Black Friday traffic without breaking a sweat.
Ready to give your app afterburners? Install Octane today, run your first benchmark, and watch the numbers speak for themselves.