SlideShare a Scribd company logo
Speed up web API with
Laravel and Swoole using
Docker
Marek Tenus
CTO
marek@highsolutions.pl
Swoole
Swoole
https://www.swoole.co.uk
Swoole
Coroutine asynchronous
programming framework for PHP
Swoole
Coroutine?
It allows you to write asynchronous code without
using callbacks, i.e. sequentially.
Swoole
The coroutine in other languages?
● Kotlin
● Python
● JavaScript (ECMAScript 6)
Swoole
Introduction
● written in C language
● built-in async, multiple threads I/O modules
● possibility to write high-performance, scalable,
concurrent TCP, UDP, UNIX Socket, HTTP,
WebSocket
Swoole
Swoole is like Node.js
Swoole + Docker - Installation
Install Docker (we use Laradock)
https://highsolutions.org/our-blog/entry/laravel-via-docker-platf
orm-a-how-to-guide
Swoole + Docker - Installation
Swoole + Docker - Installation
Swoole + Docker - Installation
Swoole + Docker - Installation
Swoole + Laravel - Installation
composer require swooletw/laravel-swoole
https://github.com/swooletw/laravel-swoole
Swoole + Laravel - Installation
Swoole + Laravel - Installation
Swoole + Laravel - Installation
Swoole + Laravel - Benchmark
Swoole + Laravel - Benchmark
Swoole + Laravel - Benchmark
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/ok (http://api-no-swoole.test/api/ok)
Swoole + Laravel - Benchmark
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/ok (http://api-no-swoole.test/api/ok)
Swoole + Laravel - Speed up
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/ok (http://api-no-swoole.test/api/ok)
Swoole + Laravel - Benchmark
Swoole + Laravel - Speed up
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/collection (http://api-no-swoole.test/api/collection)
Swoole + Laravel - Benchmark
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/collection (http://api-no-swoole.test/api/collection)
Swoole + Laravel - Benchmark
wrk -t12 -c400 -d30s --latency http://api-swoole.test/api/collection (http://api-no-swoole.test/api/collection)
Swoole + Laravel - Benchmark
Laravel + Swoole
5-6x faster
Swoole + Laravel - Benchmarks
https://github.com/swooletw/laravel-swoole
http://grigorov.website/blog/performance-comparison-php-vs-node-js
https://www.w3c-lab.com/php-7-1-swoole-v1-9-5-vs-node-js-benchmark-t
est-php7-swoole-beats-node-js/
Swoole + Laravel - Benchmarks
126. nodejs
238. lumen-swoole
261. laravel-swoole
311. lumen
321. laravel
345. symfony
https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=fortune
Marek Tenus
marek@highsolutions.pl

More Related Content

PDF
Cypress-vs-Playwright: Let the Code Speak
PDF
Laravel 101
PDF
Clean Architecture em PHP
PDF
Basics of Selenium IDE,Core, Remote Control
PDF
The Integration of Laravel with Swoole
PPT
PPTX
Selenide review and how to start using it in legacy Selenium tests
Cypress-vs-Playwright: Let the Code Speak
Laravel 101
Clean Architecture em PHP
Basics of Selenium IDE,Core, Remote Control
The Integration of Laravel with Swoole
Selenide review and how to start using it in legacy Selenium tests

What's hot (20)

PPTX
How to implement a simple dalvik virtual machine
PDF
왕초보를 위한 도커 사용법
PPTX
Automating with Ansible
PPTX
Coroutines in Kotlin
PPT
PPTX
Appium overview
PDF
Kotlin vs Java | A Comparative Analysis | IDEA USHER
PPTX
Kubernetes Probes (Liveness, Readyness, Startup) Introduction
PDF
Ansible 101
PDF
From Generator to Fiber the Road to Coroutine in PHP
PDF
Introduction to kotlin coroutines
PDF
ES2015 / ES6: Basics of modern Javascript
PPTX
Mobile Automation with Appium
PPTX
Automation Testing With Appium
PDF
Rust: Unlocking Systems Programming
PDF
e2e testing with cypress
PDF
Hacking Jenkins
PPTX
Cucumber BDD
PPT
Rust Programming Language
How to implement a simple dalvik virtual machine
왕초보를 위한 도커 사용법
Automating with Ansible
Coroutines in Kotlin
Appium overview
Kotlin vs Java | A Comparative Analysis | IDEA USHER
Kubernetes Probes (Liveness, Readyness, Startup) Introduction
Ansible 101
From Generator to Fiber the Road to Coroutine in PHP
Introduction to kotlin coroutines
ES2015 / ES6: Basics of modern Javascript
Mobile Automation with Appium
Automation Testing With Appium
Rust: Unlocking Systems Programming
e2e testing with cypress
Hacking Jenkins
Cucumber BDD
Rust Programming Language
Ad

Similar to Speed up web API with Laravel and Swoole using Docker (20)

PDF
PHPIDOL#80: Kubernetes 101 for PHP Developer. Yusuf Hadiwinata - VP Operation...
PPTX
SWOFT a PHP Microservice Framework - 2020
PDF
WordPress London Developer Operations For Beginners
PPTX
Groovy demo
PPTX
Groovydemo 160721051742
PDF
[Szjug] Docker. Does it matter for java developer?
PDF
Docker for Artisans
PDF
Docker All The Things - ASP.NET 4.x and Windows Server Containers
PDF
Docker fundamentals
PPTX
Flutter for web
PPTX
Docker - Der Wal in der Kiste
PDF
Wso2 product release webinar introducing jaggery
PDF
Travis-CI - Continuos integration in the cloud for PHP
PDF
Docker introduction
PDF
Developing and Deploying PHP with Docker
PDF
Introduction to Docker - Vellore Institute of Technology
PPTX
Go Revel Gooo...
PDF
Improve your Java Environment with Docker
PDF
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
PPTX
Docker for .NET Developers
PHPIDOL#80: Kubernetes 101 for PHP Developer. Yusuf Hadiwinata - VP Operation...
SWOFT a PHP Microservice Framework - 2020
WordPress London Developer Operations For Beginners
Groovy demo
Groovydemo 160721051742
[Szjug] Docker. Does it matter for java developer?
Docker for Artisans
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker fundamentals
Flutter for web
Docker - Der Wal in der Kiste
Wso2 product release webinar introducing jaggery
Travis-CI - Continuos integration in the cloud for PHP
Docker introduction
Developing and Deploying PHP with Docker
Introduction to Docker - Vellore Institute of Technology
Go Revel Gooo...
Improve your Java Environment with Docker
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Docker for .NET Developers
Ad

More from Laravel Poland MeetUp (20)

PDF
WebRTC+Websockety - Jak stworzyłem aplikację do kamerek internetowych w Larav...
PDF
xD bug - Jak debugować PHP-owe aplikacje (Xdebug)
PDF
Kilka slajdów o castowaniu atrybutów w Eloquent
PDF
Licencje otwartego oprogramowania
PDF
Jak przyspieszyłem aplikację produkcyjną o ponad 40%
PDF
Jak przemycić Shape Up do Scruma?
PDF
Cykl życia zapytania HTTP (pod maską)
PDF
Enumy w Laravelu - dlaczego warto stosować?
PDF
Laravelowe paczki do uwierzytelniania
PDF
Przegląd najciekawszych wtyczek do Laravela
PDF
Walidacja w Laravelu
PDF
(prawie) Wszystko o Tinkerze
PDF
Laravel Dusk - prosty przepis na testy E2E
PDF
Laravel Octane - czy na pewno taki szybki?
PDF
Laravel Jobs i PHP8
PDF
Wszystko o Laravel Livewire
PDF
Laravel/PHP - zderzenie z PDFami
PDF
Action-based Laravel
PDF
Automatyzacja utrzymania jakości w środowisku PHP
PDF
Wstęp do Gitlab CI/CD w aplikacjach napisanych w Laravel
WebRTC+Websockety - Jak stworzyłem aplikację do kamerek internetowych w Larav...
xD bug - Jak debugować PHP-owe aplikacje (Xdebug)
Kilka slajdów o castowaniu atrybutów w Eloquent
Licencje otwartego oprogramowania
Jak przyspieszyłem aplikację produkcyjną o ponad 40%
Jak przemycić Shape Up do Scruma?
Cykl życia zapytania HTTP (pod maską)
Enumy w Laravelu - dlaczego warto stosować?
Laravelowe paczki do uwierzytelniania
Przegląd najciekawszych wtyczek do Laravela
Walidacja w Laravelu
(prawie) Wszystko o Tinkerze
Laravel Dusk - prosty przepis na testy E2E
Laravel Octane - czy na pewno taki szybki?
Laravel Jobs i PHP8
Wszystko o Laravel Livewire
Laravel/PHP - zderzenie z PDFami
Action-based Laravel
Automatyzacja utrzymania jakości w środowisku PHP
Wstęp do Gitlab CI/CD w aplikacjach napisanych w Laravel

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
gpt5_lecture_notes_comprehensive_20250812015547.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation

Speed up web API with Laravel and Swoole using Docker