How to deal with high concurrency Swoole

There need to learn to communicate our friends, please join swoole exchange group together, there is a problem with the exchange, progress together! Provided that you are learning technology. Thanks for reading!

Click here to join the group

How to deal with high concurrency swoole

①Reactor model introduced 

IO multiplexing using asynchronous non-blocking program model classic Reactor, Reactor name suggests is the meaning of the reactor, which itself does not process any data transceiver. Just can monitor a socket (can also be a conduit, eventfd, signal) handles events change.

Reactor just one event generator, the actual operation of the socket handle, such as connect / accept, send / recv, close the callback is completed.

②swoole architecture

swoole Reactor + multi-threaded multi-process Worker.

When a request arrives, swoole is treated:

 

 Because the epoll based reactor, each reactor can handle numerous connection requests. So, swoole to easily handle the high concurrency.

Guess you like

Origin www.cnblogs.com/heyue0117/p/12001934.html