From 5693ed9df11667880edd29fb64166171e934671a Mon Sep 17 00:00:00 2001 From: Pooja D P Date: Fri, 15 Jan 2021 02:17:56 -0800 Subject: [PATCH] doc: clarify maxSockets option of http.Agent PR-URL: https://github.com/nodejs/node/pull/36941 Fixes: https://github.com/nodejs/node/issues/36463 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel --- doc/api/http.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 8652318ce68b5d..6a4f59f12deac7 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -141,8 +141,14 @@ changes: the [initial delay](net.md#net_socket_setkeepalive_enable_initialdelay) for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`. **Default:** `1000`. - * `maxSockets` {number} Maximum number of sockets to allow per - host. Each request will use a new socket until the maximum is reached. + * `maxSockets` {number} Maximum number of sockets to allow per host. + If the same host opens multiple concurrent connections, each request + will use new socket until the `maxSockets` value is reached. + If the host attempts to open more connections than `maxSockets`, + the additional requests will enter into a pending request queue, and + will enter active connection state when an existing connection terminates. + This makes sure there are at most `maxSockets` active connections at + any point in time, from a given host. **Default:** `Infinity`. * `maxTotalSockets` {number} Maximum number of sockets allowed for all hosts in total. Each request will use a new socket