search
HomePHP FrameworkWorkermanIs worker efficient?

Is worker efficient?

Dec 12, 2019 am 09:32 AM
workerman

workerman itself is a PHP multi-process server framework with modules for PHP process management and socket communication, so it can run independently without relying on containers such as php-fpm, nginx or apache.

Is worker efficient?

Pure PHP development

workerman is completely developed using PHP. Applications developed using workerman do not rely on php-fpm, apache, nginx containers can run independently. This makes it very convenient for PHP developers to develop, deploy, and debug applications. (Recommended learning: workerman tutorial)

Support PHP multi-process

In order to give full play to the performance of the server's multi-CPU, workerman supports multi-process multi-process by default Task. Workerman starts a main process and multiple sub-processes to provide external services. The main process is responsible for monitoring the exit signals of the sub-processes and generating new sub-processes to handle services. This not only improves the performance of the application, but also makes Workerman more stable.

Support TCP, UDP

workerman supports TCP and UDP two transport layer protocols. You only need to change one field of the configuration to change the transport layer protocol and business code. No changes are required.

Support high concurrency

workerman supports Libevent event polling library (Libevent extension needs to be installed). Using Libevent has excellent performance in high concurrency. If Libevent is not installed, Use PHP's built-in Select related system calls.

Support various application layer protocols

The interface supports various application layer protocols, including custom protocols. The protocols supported by Workerman by default include HTTP, WebSocket, and the simple Text protocol. At the same time, Workerman provides a common protocol interface, and developers can easily develop their own protocols based on this interface.

Support long connections

Many times it is necessary for PHP applications to maintain long connections with clients, such as chat rooms, games, etc., but traditional PHP containers (apache, nginx, php-fpm) it is difficult to do this.

Use workererman to easily use PHP long connections. A single PHP process can support thousands or even tens of thousands of concurrent connections, and multiple processes can support hundreds of thousands or even millions of concurrent connections.

Built-in monitoring

Workerman has an internal monitoring and statistics module, which can count some of Workerman's own data, such as the number of process exits and exit status, and the memory occupied by each process. The size and listening IP port, the startup time of each process, the service name of the process running, the number of requests processed by each process, the number of connections, the number of failed packet transmissions, etc. This information can be viewed locally by running php start.php status locally.

Support heartbeat detection

Gateway/Worker development model supports server-side heartbeat detection, which can regularly send application layer heartbeats to the client and detect client extremes in a timely manner Offline situations (power outage, sudden network failure, etc.).

The above is the detailed content of Is worker efficient?. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.