Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
High Performance with Laravel Octane

You're reading from   High Performance with Laravel Octane Learn to fine-tune and optimize PHP and Laravel apps using Octane and an asynchronous approach

Arrow left icon
Product type Paperback
Published in Jan 2023
Publisher Packt
ISBN-13 9781801819404
Length 204 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roberto Butti Roberto Butti
Author Profile Icon Roberto Butti
Roberto Butti
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Part 1: The Architecture
2. Chapter 1: Understanding the Laravel Web Application Architecture FREE CHAPTER 3. Part 2: The Application Server
4. Chapter 2: Configuring the RoadRunner Application Server 5. Chapter 3: Configuring the Swoole Application Server 6. Part 3: Laravel Octane – a Complete Tour
7. Chapter 4: Building a Laravel Octane Application 8. Chapter 5: Reducing Latency and Managing Data with an Asynchronous Approach 9. Part 4: Speeding Up
10. Chapter 6: Using Queues to Apply the Asynchronous Approach in Your Application 11. Chapter 7: Configuring the Laravel Octane Application for the Production Environment 12. Index 13. Other Books You May Enjoy

Understanding the Laravel Web Application Architecture

This book is for Laravel developers who would like to make or design their Laravel web application in a more scalable way and make it more performant.

This book aims to provide you with knowledge, suggestions, and explanations on how to improve the software architecture of a web application, starting from a typical PHP web application architecture to a more scalable and performant architecture.

It provides a 360-degree overview of what it takes to design and build a performant application with Laravel Octane. We’ll see why Laravel Octane is suitable for designing and building a performant application. The book also covers the different tools used by Laravel Octane, such as Open Swoole and RoadRunner, and lists and describes the various features and differentiating elements. But the most important thing is to enable you to understand why and when to use Open Swoole or RoadRunner.

But before starting, why use Laravel Octane?

Laravel Octane is a tool that allows us to access some functionality and features exposed by the two application servers we just mentioned.

One of the benefits of Laravel Octane is the huge improvement in the response times to HTTP requests by clients such as web browsers. When we develop a Laravel application, we use an important software layer implemented by the framework. This software layer needs time and resources to start. Even if we talk about only a few resources and a short amount of time, this repeated action for each request, especially in a context where there are many requests, can be a problem. Or rather, its optimization could bring enormous benefits.

Laravel Octane, through application servers, does just that: optimizes the process of starting the framework, which typically happens for each individual request. We will see in detail how this is done; essentially, the objects and everything that the framework needs are started and allocated to the start of the application server, and then the instances are made available to the various workers. Workers are the processes that are initiated to serve the requests.

Another reason why it is interesting to evaluate the adoption of Laravel Octane in your Laravel web application is that by using an application server such as Swoole, you can access those features implemented by Swoole.

The functions are, for example, the advanced mechanisms of the cache driver, shared storage for sharing information between the various workers, and the execution of tasks in parallel.

This is a totally new concept to the classic PHP developer who typically does not have an immediate functionality available in the PHP core for the parallelization of processes.

This chapter will introduce you to the Laravel ecosystem and explore what Laravel Octane is.

This chapter aims to introduce you to the application server approach, in which more workers cooperate to manage multiple requests. Understanding the behavior under the hood allows the developer to avoid some mistakes, especially on shared resources (objects and global states) across the worker. This is important because the classical PHP approach is to have one dedicated thread to manage one request.

In this chapter, we will cover the following topics:

  • Exploring the Laravel ecosystem
  • Understanding the request lifecycle
  • Getting to know the application server
You have been reading a chapter from
High Performance with Laravel Octane
Published in: Jan 2023
Publisher: Packt
ISBN-13: 9781801819404
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image