Home  >  Article  >  PHP Framework  >  How much concurrency does workerman support?

How much concurrency does workerman support?

(*-*)浩
(*-*)浩Original
2019-12-05 11:33:573367browse

How much concurrency does workerman support?

How much concurrency does WorkerMan support?

The concept of concurrency is too vague. Here we use two quantifiable indicators: the number of concurrent connections and concurrent requests. Explain with numbers. (Recommended study: workermantutorial)

The number of concurrent connections refers to how many TCP connections the server maintains at the current time, and it does not matter whether there is data communication on these connections.

For example, a message push server may maintain millions of device connections. Since there is little data communication on the connections, the load on this server may be almost 0. As long as there is enough memory, it can still Connections can continue to be accepted.

The number of concurrent requests is generally measured by QPS (how many requests the server handles per second), but the number of TCP connections on the server at the current moment is not of great concern.

For example, a server has only 10 client connections, and each client connection has 1W requests per second. Then the server needs to be able to support at least 10*1W=10W per second throughput. Quantity (QPS).

Assume that 10W throughput per second is the limit of this server. If each client sends 1 request to the server per second, then this server can support 10W clients.

The number of concurrent connections is limited by the server memory. Generally, a 24G memory workerman server can support approximately 120W concurrent connections.

The number of concurrent requests is limited by the server’s CPU processing capability. A 24-core Workerman server can achieve a throughput of 45W per second (QPS). The actual value varies depending on business complexity and code quality. .

Note

High concurrency scenarios must install the event or libevent extension, please refer to the installation and configuration chapter. In addition, the Linux kernel needs to be optimized, especially the limit on the number of files opened by a process. Please refer to the Appendix Kernel Tuning Chapter.

The above is the detailed content of How much concurrency does workerman support?. 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
Previous article:Is workerman easy to use?Next article:Is workerman easy to use?