What is Laravel Octane?

What is Laravel Octane?

Laravel Octane allows you to serve your Laravel application using a powerful Swoole and/or Roadrunner Application Server for PHP. Laravel Octane starts your application in a powerful and optimized manner, retains it in memory for specific areas, cleans up object states, and manages object instances between requests.

 Laravel Octane Original Documentation

  https://github.com/laravel/octane

Normally, the application and all objects are loaded multiple times for each request. With Laravel Octane, the application and object models are shared between requests. This means that the developer only needs to load certain objects once (note that some are loaded once at boot time), and in this case, Laravel Octane helps manage the states of the objects.

What is RoadRunner? 

RoadRunner is a load balancer process manager written for PHP applications.


Steps to Create the Application:


We are installing the Laravel installer

composer global require laravel/installer


We are creating a new Laravel project

laravel new laravel-octane


We enter the directory where our project is located

cd laravel-octane


We are installing our package via Composer

composer require laravel/octane


We are loading our package

php artisan octane:install


We are starting our application
php artisan octane:start --port=8002

Yes, our application is now running on Octane. Octane begins to listen to and cache the general PHP core. It should be noted here that since Octane does not know about your dynamic changes, you can only notify these using the Cache Facade.

Cache::driver('octane')->put('test','test')

We have currently started our application on port 8002. However, what we should know here is that you must log in through the port where Laravel is running directly, not through php-fpm. Otherwise, Octane will not work.


Benchmark



Standard Nginx


Laravel Octane



As can be seen, there is a difference of up to 4 times in between.


Looking for authors and journalists!

Looking for authors and journalists!

If you are a journalist, who has desire to dig deep in topics related to businesses and sectors, we want to work with you!

Recai Atak

PlusClouds Enthusiast
Sales

Product information

#There is no text provided for translation. Please provide the text you would like to be translated into English.
Auto Quill
AutoQuill writes and posts affiliate marketing content for you.

Easiest Money You Will Ever Make

With the AutoQuill tool that PlusClouds has started to offer to its affiliate partners, content creators will be able to sell with a single click. Let us show you how you can get your share of this revolution.