Skip to content

Commit

Permalink
doc: clarify maxSockets option of http.Agent
Browse files Browse the repository at this point in the history
PR-URL: #36941
Fixes: #36463
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
PoojaDurgad authored and ruyadorno committed Jan 21, 2021
1 parent 9531922 commit 5693ed9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5693ed9

Please sign in to comment.