---
title: "Laravel Octane: supercharge your Laravel applications"
url: "https://aaronfrancis.com/videos/laravel-octane-supercharge-your-laravel-applications"
path: "/videos/laravel-octane-supercharge-your-laravel-applications"
type: video
author: Aaron Francis
published: 2024-04-26
topic: "Laravel & PHP"
keywords: [laravel octane, php application performance, shared memory, request handling, load testing, boot times, laravel, php performance, vapor]
youtube_url: "https://www.youtube.com/watch?v=YGBvdAWt0W8"
site_index: "/llms.txt"
keyword_index: "/llms/keywords.txt"
---

# Laravel Octane: supercharge your Laravel applications

## Chapters

- Intro
- How PHP Works
- Laravel Octane
- Benefits of Octane
- Shared Memory and Request Handling
- Installing Laravel Octane
- Comparing Boot Times
- Load Testing Octane
- Conclusion

## Transcript

**Aaron Francis:** Welcome to the What is Laravel series. My name is Aaron Francis. In this series of many, many videos, I'm gonna be covering the entire Laravel ecosystem. Today, we're gonna be talking about Laravel Octane. Octane is a first-party installable composer package from the Laravel team that supercharges your application and makes it a lot faster.

**Aaron Francis:** But before I explain how it makes it faster, I need to tell you a little bit about how PHP works in general. Typically, typically, you'll have Nginx sitting in front of a pool of PHP FPM workers. When a request comes in that is not a request for a static asset, Nginx hands that request off to PHP FPM.

**Aaron Francis:** PHP FPM then boots up your entire application, handles the request, and then tears down your entire application. There are two things you need to know about this model. The first is every PHP FPM process can handle one request at a time. Usually, you have a pool of many processes, but they're each handling one request at a time.

**Aaron Francis:** That's gonna be important. The second is this is a shared nothing approach. So every time a request is handled, the entire universe has to be built from scratch, your request is handled, and then the entire universe has to be destroyed. So every request that comes in, you're booting your application from nothing. That's how it's always been.

**Aaron Francis:** That's how PHP has always worked until Laravel Octane. Let's talk about Laravel Octane. Octane was first announced at Laracon Online in twenty twenty-one, and the first version was tagged in May of twenty twenty-one. It is a composer package that you install into your application. It is maintained by the Laravel team, and it is fundamentally different than using PHP FPM.

**Aaron Francis:** When you install Octane, which we'll do here in a second, when you install Octane, it asks you which driver you want to use. The choice of driver, you have four choices. You have Swoole, OpenSwoole, FrankenPHP, and Roadrunner. Those are the four drivers that you can choose with Octane. Each different driver has its own pros and cons.

**Aaron Francis:** I'll leave that as an exercise for the viewer, which is you, because that's a little bit too much detail for this video. But here's the deal. When you install Octane, you pick your driver, and then instead of Nginx handing off requests to PHP FPM, Nginx hands off the requests to Octane. So what is the benefit here? Two benefits, right? So remember, with PHP FPM, each worker or each process can handle a single request, and it's shared nothing.

**Aaron Francis:** With Octane, a worker or a process can handle multiple requests, maybe, and it's shared something. So let's start with shared something. In Octane, Laravel is going to boot the application framework included, and then keep that in memory and serve requests to an application that has already been booted.

**Aaron Francis:** So you get back all of that boot time. You're not, you're not creating the universe from scratch anymore. The universe has been created, and now it's just receiving requests. Now, the second benefit relates to that one request per worker thing that PHP FPM has, right? So with PHP FPM, it's one request per worker. With Octane, depending on the driver that you choose, you can process multiple requests at the same time with a single worker.

**Aaron Francis:** The way that that works is if you have a long blocking IO operation in one request, it'll hop to the next one, start working on that, and then come back to the original request. So you're gonna get much higher throughput if you're using Octane. Some of those details are driver-specific, but the general idea stands. Now, I've got a standard Laravel application here that I just created from scratch. The only thing I've done is replace the default route with a Hello World.

**Aaron Francis:** So if we hit that in the browser at octane.test, you see there is our Hello World. Easy enough so far. Let's go ahead and install Laravel Octane. You just say composer require laravel/octane. It's gonna do its thing. We'll clear that out, and then we wanna run one command, which is octane install. And this is going to ask us for which driver we want to use.

**Aaron Francis:** I'm just gonna pick Swoole here. That's it. We're good to go. Now, you can still hit this in the browser, but this is not running through Octane, so we need to start the Octane server. So we'll say php artisan octane start. And now this server is running at this address. So if we run it over here, you'll see we're getting the same Hello World, but you see that the requests are streaming in here.

**Aaron Francis:** So now we're running this on both places. This is running locally through Herd, which is Nginx to PHP FPM, and this is running through Octane. All right, we're gonna put both of these systems under load, the Octane and the non-Octane, and we're gonna see which one fails first. I think it's gonna be the non-Octane version, but this is not a benchmark. This is just a comparison.

**Aaron Francis:** There are a bunch of commands you can run to make Laravel production-ready. I haven't run any of those because I'm not benchmarking. I'm just comparing. That being said, let's take a look in the browser first before we run these tests. So if we load octane.test, which is the non-Octane version, and we look at the timeline down here, you see that forty-two milliseconds is spent booting Laravel the framework, right?

**Aaron Francis:** So if we refresh this a couple times, you'll see it bounce around, but it's between eighteen and forty milliseconds spent booting. If we check the Octane version, if we check the Octane version over here, you'll see that the booting has dropped down to five, three, seven. So this is what I'm talking about when I say it boots the application once and keeps it in memory.

**Aaron Francis:** So we've already gained back between twenty and thirty to forty milliseconds already. Now, let's run a few fake little load tests here. I'm gonna use the work command, and we're gonna run four threads with a hundred and fifty connections for five seconds against the Octane version, and we're gonna see how well this does.

**Aaron Francis:** So after five seconds, we should see... All right, we got- 245 requests per second. Now, if we run that again, if we run that again against octane.test, I think what we're going to see is a bunch of failures. So we see a huge amount of requests per second, but that's because most of them just failed.

**Aaron Francis:** So you can already tell, even on this tiny little application, that Octane is boosting the performance. Now, this is just the tip of what Octane has to offer. Depending on which driver you choose, you can have stuff like concurrent tasks. You can use it as a cache driver and get up to 2 million operations a second as a cache driver, which is pretty insane.

**Aaron Francis:** And so I think the question is going to be, why would you not use Octane? And the answer is you might not need it. If you're operating just fine without Octane right now, you don't need it. When you install and start using Octane, you do have to think about your application a little bit differently. You have to be more careful with static variables because it is going to boot your application and keep it in memory, so you could introduce a memory leak if you're not careful.

**Aaron Francis:** So if you're installing this in a legacy application, you're gonna have to kind of do a lot of work to go back and make sure that you're able to use your application in this new Octane paradigm. If you're running your application on Laravel Forge, Octane is super easy to configure over there. Regardless of where you're running your application, you do wanna restart all of those Octane workers at the end of your deploy script so that your new application does get loaded into memory.

**Aaron Francis:** Octane has a few commands that you can run to do that. If you're running your application on Laravel Vapor, there's actually an Octane integration there as well, which I helped discover. I didn't write it, but I did help discover the idea of it. But it doesn't use any of these drivers. It uses, um, an architectural quirk of how AWS Lambda works, but it still keeps your application booted and in memory.

**Aaron Francis:** That's it for Octane, a free and open source library maintained by the Laravel team that boosts your application performance. Stay tuned to this channel. I'm gonna be covering everything there is to know about the Laravel ecosystem and much more. Until that time, see ya.

---

## Related on aaronfrancis.com

- [Make faster outbound requests with Laravel (10x faster, actually)](/videos/make-faster-outbound-requests-with-laravel-10x-faster-actually) *(Video · 2024-04-30 · shared: laravel octane, laravel, php performance)*
- [Static site generators & personal websites](/podcast/static-site-generators-personal-websites-knj6zl) *(Podcast · 2023-12-14 · shared: laravel, vapor)*
- [Riding Sidecar with Aaron Francis](/podcast/riding-sidecar-with-aaron-francis-68srka) *(Podcast · 2021-08-21 · shared: laravel, vapor)*
- [About](/about) *(Page · 2026-11-25 · shared: laravel)*
- [Now](/now) *(Page · 2026-11-25 · shared: laravel)*

## Relevant Resources from Aaron Francis

- **[Solo](https://soloterm.com)** (overview on site: [/software](/software)): All-in-one agentic development platform and terminal workspace built by Aaron Francis for orchestrating processes and AI coding agents.

## Search aaronfrancis.com (2-Hop Static Keyword Index)

Pick the alphabetical shard matching any topic to find exact pages across all articles, newsletters, videos, talks, and podcast transcripts (every shard is < 40 KB):
[A-B](/llms/keywords/a-b.txt) · [C](/llms/keywords/c.txt) · [D-E](/llms/keywords/d-e.txt) · [F-G](/llms/keywords/f-g.txt) · [H-J](/llms/keywords/h-j.txt) · [K-L](/llms/keywords/k-l.txt) · [M-N](/llms/keywords/m-n.txt) · [O-P](/llms/keywords/o-p.txt) · [Q-R](/llms/keywords/q-r.txt) · [S](/llms/keywords/s.txt) · [T-Z](/llms/keywords/t-z.txt) · [Directory](/llms/keywords.txt) · [Site Map](/llms.txt)

Shards for this page's topics: `laravel octane` ([K-L](/llms/keywords/k-l.txt)), `php application performance` ([O-P](/llms/keywords/o-p.txt)), `shared memory` ([S](/llms/keywords/s.txt)), `request handling` ([Q-R](/llms/keywords/q-r.txt)).

## About Aaron Francis (Current Context)

Aaron Francis is VP of Marketing and Community at [Laravel](https://laravel.com), founder of [Try Hard Studios](https://tryhardstudios.com), creator of [Solo](https://soloterm.com), co-host of [Mostly Technical](/podcast), and author of [Mastering Postgres](/courses), [High Performance SQLite](/courses), [MySQL for Developers](/courses), and [Screencasting.com](/courses). Full bio: [/about](/about) · Current focus: [/now](/now).
