Home > Article > PHP Framework > Is php workerman asynchronous?
workerman official introduction: Workerman is an open source high-performance asynchronous PHP socket instant messaging framework. It supports high concurrency and ultra-high stability, and is widely used in the development of mobile apps, mobile communications, WeChat applets, mobile game servers, online games, etc. (Recommended learning: workerman tutorial)
Supports TCP long connections, supports Websocket, HTTP and other protocols, and supports custom protocols. It has many high-performance components such as asynchronous Mysql, asynchronous Redis, asynchronous Http, MQTT IoT client, asynchronous message queue, etc.
In fact, Workerman is similar to a PHP version of nginx, and the core is also multi-process Epoll non-blocking IO. Each Workerman process can maintain tens of thousands of concurrent connections. Because it resides in memory, it does not rely on containers such as Apache, nginx, and php-fpm, and has ultra-high performance.
High performance
Based on the high-performance Epoll event network library, a single machine can support millions of concurrent connections, and the long-term connection throughput is as high as 36W/S. Objects such as PHP databases can reside in memory, reducing parsing, compilation and network overhead.
Since the PHP file is read and parsed from the disk once, it will be resident in the memory. The next time it is used, the opcode in the memory will be used directly, which greatly reduces the disk IO and request initialization, creation of execution environment, etc. in PHP. There are many time-consuming processes such as lexical parsing, syntax parsing, compiling opcode, request closing, etc.
And it does not rely on containers such as nginx and apache. It reduces the network overhead of nginx and other containers communicating with PHP. The most important thing is that resources can be maintained permanently without having to initialize database connections every time, so use workererman to develop applications. Program, performance is very high.
High availability
has been confirmed by many companies, including e-commerce companies with a daily turnover of over 100 million, for server backend development, and Well-known online game companies use it for the development of game backends.
Simple development
The interface is simple, and there are already many mature network applications. As long as you know PHP, you can quickly develop based on these applications. Own Socket application service.
The above is the detailed content of Is php workerman asynchronous?. For more information, please follow other related articles on the PHP Chinese website!