Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.

15 St Margarets, NY 10033
(+381) 11 123 4567



Laravel Octane | Laravel News

Taylor Otwell gave Laracon Online 2021 attendees a first glimpse of Laravel Octane—a unified first-party package for running highly performant Laravel utilizing environments like Swoole and RoadRunner.

Octane delivered roughly 6,000+ requests per second in some “hello world” examples under a load of ~50 concurrent requests using four concurrent threads during the demo.

Here’s an example of the command used during the demo as a rough benchmark example:

wrk -t4 -c50 http://localhost:8000/hello-world

How Does it Work?

Octane’s entry point is an Artisan console command(octane:start) that will run either Swoole or RoadRunner. You can specify which technology to use and how many threads to run based on your environment’s CPU threads:

artisan octane:start --workers=8 --server=roadrunner

Swoole and RoadRunner utilize coroutines that enable PHP to run more efficiently by forking several worker processes based on CPU core numbers. Using Swoole/RoadRunner allows better app startup efficiency, coupled with PHP OPcache to minimize overhead by storing byte code in shared memory.

PHP workers remain active between requests (you can cycle them after “x” requests via artisan flag) and are ready to receive new requests. Eliminating framework startup time has a significant impact on performance for applications with heavy HTTP workloads.

What is the Purpose?

Typical applications don’t demand outlandish requests-per-second we see in these early demos of Octane. However, the need for high availability PHP applications is common, and Laravel is in a unique position to guarantee that framework-level code works seamlessly with tools like Swoole and Octane.

First-party support from Laravel for these technologies will be a considerable breakthrough in modern approaches to scaling PHP applications. The entire PHP ecosystem will benefit from these efforts.

What is Next?

As Taylor mentioned, expect an Octane release soon (possibly weeks)! Laravel News will be sure to announce the initial release that will likely be a pre-release beta version of Octane.

In the meantime, I’d encourage you to get familiar with Roadrunner and Swoole PHP.

We are looking forward to more Octane news soon!

Credit: Source link

Previous Next
Test Caption
Test Description goes like this