server.maxConnections


当连接数达到 server.maxConnections 阈值时:

¥When the number of connections reaches the server.maxConnections threshold:

  1. 如果进程未在集群模式下运行,Node.js 将关闭连接。

    ¥If the process is not running in cluster mode, Node.js will close the connection.

  2. 如果进程在集群模式下运行,Node.js 将默认将连接路由到另一个工作进程。要关闭连接,请将 [server.dropMaxConnection][server.dropMaxConnection] 设置为 true

    ¥If the process is running in cluster mode, Node.js will, by default, route the connection to another worker process. To close the connection instead, set [server.dropMaxConnection][] to true.

一旦将套接字发送给具有 child_process.fork() 的子级,不建议使用此选项。

¥It is not recommended to use this option once a socket has been sent to a child with child_process.fork().