• Complain

Bruce Dou - Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines

Here you can read online Bruce Dou - Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2020, publisher: Transfon, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines
  • Author:
  • Publisher:
    Transfon
  • Genre:
  • Year:
    2020
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Build your high performance large scale concurrent system in a more flexible and efficient way than ever before with this first & only Swoole book, with PHP 8 ready.
Introduction
Introducing a new execution model of PHP applications, how Open Swoole works and the pitfalls of new developers coming into the Open Swoole world. This book is also about the general concepts behind building a high concurrency and high-performance web system and how these concepts are implemented in Open Swoole and how advanced PHP works. This book provides just enough Linux OS kernel knowledges with code samples helping you understand how async I/O, concurrency and coroutine works. When start learning or using a new framework, people always carry some assumption coming from the previous experience. Some of these experiences are helpful to understand the new system, but some of these experiences may lead to the misunderstanding of the new system. This book introduces the pitfalls to avoid if you are an experienced PHP developer. This book is for the developers who have already know the basics about how a web system works such as PHP web application or application in the other programming languages such as Node.js, Golang or Java. After reading this book, you should be able to build a high concurrent Swoole PHP system with confidence.
Table of contents
  • Introduction
  • Background
  • - Stateless PHP-FPM
  • - Performance problem
  • - Concurrency problem
  • - PHP CLI
  • General concepts
  • - Executor and execution containers
  • - Lifecycle
  • - Decoupling and layers
  • - Queue, Buffer, Buffering and Batching
  • - Pipe and Channel
  • - Context, stack and context switch
  • - Singleplex vs multiplexing
  • - Asynchronous
  • - State, stateless, stateful and pooling
  • - File descriptor, I/O stream
  • - Exceptions
  • - Protocol
  • - Concurrency and I/O model
  • - Event driven and callbacks
  • - Facts, costs and limitation
  • - Rate limiting & Concurrency Limiting
  • The practical world on Linux OS
  • - User mode and kernel mode
  • - Memory management
  • - Process, Thread and Coroutine
  • - Socket and Networking I/O
  • - Blocking IO and Non-blocking IO
  • - Callbacks, await async vs coroutines
  • Connect with protocols
  • - TCP/UDP Protocol
  • - HTTP Protocol
  • - Websocket Protocol
  • - HTTP2 Protocol and GRPC
  • - Custom protocol
  • Swoole runtime and internal
  • - Swoole PHP extension
  • - Variable and states
  • - Event loop and asynchronous I/O
  • - Swoole PHP Coroutine
  • - Multiple execution modes
  • Hands on Swoole PHP
  • - Swoole Server
  • - Swoole Server Workers
  • - Swoole Process
  • - Swoole Clients
  • - Swoole Table
  • - Swoole Timer
  • - Swoole Coroutine and Channel
  • Use cases and patterns
  • - HTTP services
  • - Data processing
  • - HTTP and PHP-FPM proxy
  • - Sidecar process
  • - TCP service
  • - WebSocket Server
  • - Task Scheduler
  • - Producer and Consumer
  • - M:N concurrency mapping
  • - Connection polling
  • - Web spider and scraper
  • - PUBSUB system
  • - Server-sent events (SSE)
  • - Integrate with Linux process
  • - Service Governance: RPC and gRPC
  • - Rate limiting
  • - Design custom TCP protocols - Monitoring and reporting
  • Hosting and deployment
  • - Docker and Kubernetes
  • - Running on the AWS EC2 or bare metal

Bruce Dou: author's other books


Who wrote Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines? Find out the surname, the name of the author of the book and a list of all author's works by series.

Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Mastering Swoole PHP
Build high performance concurrent system with async and coroutines
First Edition
Copyright 2020 Transfon Ltd, All rights reserved
Great Britain, 26th November 2020
Mastering Swoole PHP
Build high performance concurrent system with async and coroutines
Copyright 2020 Transfon Ltd ( )
First Edition, published 26 th November 2020
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the Copyright holder.
ISBN 978-1-8381344-0-2
Published by Transfon Ltd
Book Website: https://swoolebook.com
For inquiries on distribution, translations, or bulk sales, please contact the author directly at .
The information in this book is distributed on an As Is basis, without warranty. While every precaution has been taken in the preparation of this work, the Author shall not have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it.
Table of Contents
Experts Reviews
"Swoole is a strategic development in the evolution of PHP, bringing high performance async-IO based apps to the mainstream of the platform. This book is everything you need to unlock that power of your new async-PHP apps!"
Zeev Suraski
Co-founder of Zend, Co-architect of PHP
"Swoole is a tremendous technology and a game changer for PHP developers. I started to play with it in 2017 and I created the first runtime for Expressive framework. The results have been incredible, huge performance improvement without using a web server, amazing! If you want to design asynchronous applications in PHP the book of Bruce Dou is a must."
Enrico Zimuel
Principal Software Engineer at Elastic
Authors Note
The problems like performance, concurrency, availability, reliability, and scalability of the internet infrastructure have never been easy to resolve. But the software and web infrastructure is mission critical for all of the businesses and organizations as all the us are on the ware of digital transformation in the history.
The idea of writing a book about the concepts and methodology what I have learnt of building and managing large scale web system, transforming internet system and infrastructure for the other internet companies at Transfon Ltd and my previous companies has been in my mind for a long time. Recently, I have realized describe these concepts with Swoole framework would be a good fit.
During the past ten or so years, internet users and devices are exploding. It brought a lot more challenges for software development companies and internet companies. The growing tread is not stopping as of today because of the market developer and growth of Internet of Things, more and more machines are connected to the internet. The concurrent model works 10 years ago may not work when building todays and tomorrows systems. In the nutshell, we do have to understand how concurrent system works and the common methods to tackle the potential issues and make our system running at high performance.
Todays web system is going to be more complex than using just one programming language. There are more and more new general programming languages such as Node.js, Golang are created during the past several years designed for building real time and concurrent systems from the beginning. PHP as the language born for the web is still used by the major internet systems, PHP is still the easiest programing language to get started for new developers.
It used to be a case that PHP lacks the support of async I/O and difficult to build high concurrent real time systems before Swoole is open sourced back to the year of 2012. But today Swoole PHP has been widely used by companies all over the world, it is proven to be a mature solution of building high performance and high concurrent systems. More importantly, you can still enjoy the simple and easy PHP syntax and the large PHP ecosystem.
Most PHP developers are excited when they have seen Swoole the first time, it is mind blowing fast, then realized we can also build superfast and real time applications with PHP language. Once they have get started to implement Swoole in a real world application, they realized that it is not that simple, there is a steep learning curve. Some of the previous experiences of building PHP applications are not correct when use Swoole. So this book is written to help you understand the theories and ideas, concepts behind Swoole.
Swoole is not a static framework and under active development and improvement during the past several years and also will not stop. We are learning from the good practices from the other frameworks and languages. There are more and more important concepts are borrowed from the other programing languages like coroutines from Golang, and preemptive scheduling from Erlang. Swoole is a dynamic knowledge framework and learning framework. The knowledges about the Swoole features and API may be outdated soon, but the general concepts will never be expired. You can also use these general concepts to learn a new framework, a new language quicker and also be confident when building a new system.
Bruce Dou
Managing Director of Transfon Ltd
England, United Kingdom
24.10.2020
Part I: Introduction
What is this book about?
The book introduces a new execution model of PHP applications, how Swoole PHP works and the pitfalls of new developers coming into the Swoole PHP world.
This book is also about the general concepts behind building a high concurrency and high-performance, reliable web system which you can use to solve common problems and how these concepts are implemented in Swoole PHP. These concepts are evergreen and suitable for all the other programming languages and frameworks. We will try to show and describe these concepts with simple PHP codes. When we keep these concepts in mind, we can avoid some common mistakes when designing or build a new system.
This book provides just enough under layer Linux OS knowledge to understand How the Swoole PHP web system works on the Linux OS.
When starting to learn or use a new framework, people always carry some assumptions coming from the previous experience. Some of these experiences are helpful to understand the new system, but some of these experiences may lead to the misunderstanding of the new system. This book introduces the pitfalls to avoid if you are an experienced PHP developer.
This book is for the developers who have already know the basics about how a web system works such as PHP web application or application in the other programming languages such as Node.js, Golang or Java.
After reading this book, you should be able to build a concurrent and high-performance Swoole PHP system with confidence.
What is Swoole PHP?
Swoole PHP is an extension for PHP core like the other PHP extensions such as Opcache, bringing in the ready to use modules and functions: server patterns, native coroutine, coroutine scheduler, multiplexing and async I/O, states management, process management, high performance in memory K-V storage etc.
Swoole enables developers to create and manage a TCP, HTTP, WebSocket server programmatically with PHP syntax many PHP developers have already known.
Unlike PHP-FPM only supports stateless models, with Swoole you can cache and manage states within the server to increase the performance. It provides a new execution model of PHP applications.
Your Swoole PHP application is not just a one-time CLI script executed by CRON or managed by process managers like PHP-FPM. More like Node.js or Golang, Java applications, you can create and manage multiple coroutines within one process. The application is running as a daemon process like the other languages. The process can process multiple requests or execute multiple tasks concurrently. You can also cache or manage states which can be shared across multiple independent tasks or requests.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines»

Look at similar books to Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines»

Discussion, reviews of the book Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.