Mastering Swoole PHP: Build High Performance Concurrent System with Async and Coroutines
Book information
Description
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 contentsIntroductionBackground- Stateless PHP-FPM- Performance problem- Concurrency problem- PHP CLIGeneral 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 LimitingThe 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 coroutinesConnect with protocols- TCP/UDP Protocol- HTTP Protocol- Websocket Protocol- HTTP2 Protocol and GRPC- Custom protocolSwoole runtime and internal- Swoole PHP extension- Variable and states- Event loop and asynchronous I/O- Swoole PHP Coroutine- Multiple execution modesHands on Swoole PHP- Swoole Server- Swoole Server Workers- Swoole Process- Swoole Clients- Swoole Table- Swoole Timer- Swoole Coroutine and ChannelUse 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 reportingHosting and deployment- Docker and Kubernetes- Running on the AWS EC2 or bare metal
Similar books
EXCEL 2023 CRASH COURSE: Master Excel 2023 With This Complete Crash Course In 7 Days
2022 · EPUB
The arraignment and tryall with a declaration of the Ranters also, several sentences proceedings at the sessions in the Old-Baily, and Councel of War: their protestations and the hanging of one up by the thumbs; with divers penalties to be inflicted upon others. The dancing and revelling of Dr. Buckeridge and his wife, and other gent. dancing all in white, in Berkshire, and their Christmas carol. A dispute between a Ranter in Bridewel, and one that came to see him; with his creed and pater noster: and the names of the false gods they worship. As also, a list of many of the Ranters, from whence they are derived: and of many hundreds of them in England
2019 · EPUB
The discoverer; vvherein is set forth (to undeceive the nation) the reall plots and stratagems of Lievt. Col. John Lilburn, Mr. William Walwyn, Mr. Thomas Prince, Mr. Richard Overton, and that partie ... Namely, under the pretence and colour of libertie ... a most dangerous and destructive designe is carried on to deprive the nation of their religion, rights, liberties, proprieties, lawes, government, &c. and to bring a totall and universall ruine upon the land. And so much is here clearely proved. The first part
2019 · EPUB
An act to impower Sir John Molesworth: Baronet, and Joseph Moyle, Esquire, Two of the surviving Trustees, in an Indenture, dated the Twenty-Fifth Day of December One thousand Seven hundred and Forty-Three, to raise the several Sums in the said Indenture mentioned, or such of them as are still unsatisfied, and pay the same, as well as the rest of the personal Estate of Hugh Gregor, deceased, to such Person as Jane Gregor, an Infant, shall marry during her Infancy, with the Consent of the surviving Trustees, and of her Guardians
EPUB
Case Histories
2008 · EPUB
Pandora's Seed: The Unforeseen Cost of Civilization
2010 · EPUB
Obama's Wars
2010 · EPUB
Trickle Up Poverty: Stopping Obama's Attack on Our Borders, Economy, and Security
2010 · EPUB