Home > PHP Framework > Swoole > body text

Can swoole be clustered?

Release: 2019-12-23 14:12:59
Original
3108 people have browsed it

Can swoole be clustered?

swoole can be clustered.

ClusterCluster

Server nodes can be divided into 3 roles

AccessNode

The entry node can also be called the GateWay gateway. External users directly connect to the AccessNode through TCP, and the AccessNode maintains a long connection with the client and performs data interaction.

Web service cluster, Nginx is AccessNode (GateWay), the browser connects to Nginx through the external network, and Nginx parses and processes the request. If it is a static file request, the file content is sent directly to the client. If it is a dynamic php request, Nginx forwards it to the back-end PHP-fpm or other language application server for processing.

WebIM, WebIM generally uses Http long polling (Comet) or WebSocket as AccessNode, and the browser is directly connected to swoole_websocket_server to realize real-time interaction of messages.

AccessNode must be fully asynchronous to ensure that the entire system can handle a large amount of concurrency. AccessNode needs to monitor the external network,

ServiceNode

service node, and all business logic is completed in ServiceNode. Large-scale Web websites are also subdivided into the Web layer and the logic layer. The Web is only responsible for front-end display, and all real business logic is placed on the back-end logic layer Server.

Recommended learning: swoole video tutorial

The above is the detailed content of Can swoole be clustered?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template