server.maxConnections
版本历史
| 版本 | 变更 |
|---|---|
| v21.0.0 | 将 |
| v0.2.0 | 新增于: v0.2.0 |
当连接数达到 server.maxConnections 阈值时:
\When the number of connections reaches the server.maxConnections threshold:
-
如果进程未在集群模式下运行,Node.js 将关闭连接。
\If the process is not running in cluster mode, Node.js will close the connection.
-
如果进程在集群模式下运行,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][] totrue.
一旦将套接字发送给具有 child_process.fork() 的子级,不建议使用此选项。
\It is not recommended to use this option once a socket has been sent to a child
with child_process.fork().