全局指令

连接限制

MaxRequestWorkers

  • 用途:限制并发连接数
  • 语法:MaxRequestWorkers number
  • 语境:主服务器

该指令用于限制并发的连接请求,所有超过该限制的请求都会加入队列,直到接近 ListenBacklog 所限制的队列上限。一旦有子进程空闲下来,立即会处理该连接。

对于非线程服务器来说,比如 prefork 服务器,该指令会演变成可用于处理请求的子进程的最大数量,默认为 256 个,要想提升,同时还需要提升 ServerLimit 的数量,即可配置的进程数量上限。

For threaded and hybrid servers (e.g. event or worker) MaxRequestWorkers restricts the total number of threads that will be available to serve clients. For hybrid MPMs the default value is 16 (ServerLimit) multiplied by the value of 25 (ThreadsPerChild). Therefore, to increase MaxRequestWorkers to a value that requires more than 16 processes, you must also raise ServerLimit.

对于线程和混合服务器,如 event 或 worker 服务器,该指令用于限制用于服务客户端的线程总数量,

MaxRequestWorkers was called MaxClients before version 2.3.13. The old name is still supported.