Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorArtur K <fatal10110@gmail.com>2021-09-11 14:55:09 +0300
committerMatteo Collina <hello@matteocollina.com>2021-09-19 17:28:20 +0300
commit4e8f11dee3b7dcea7472058f4182ddd36b86c781 (patch)
tree1b96f28504a925357e77cf90623155f42dc06f72 /doc/api
parentb0d5eecdd9dcb6f2fe569ac6fb1e3687ed49623d (diff)
http: limit requests per connection
Fixes: https://github.com/nodejs/node/issues/40071 PR-URL: https://github.com/nodejs/node/pull/40082 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/http.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index 65f2ca3d718..0f5f5a8bb11 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -1352,6 +1352,22 @@ By default, the Server does not timeout sockets. However, if a callback
is assigned to the Server's `'timeout'` event, timeouts must be handled
explicitly.
+### `server.maxRequestsPerSocket`
+<!-- YAML
+added: REPLACEME
+-->
+
+* {number} Requests per socket. **Default:** null (no limit)
+
+The maximum number of requests socket can handle
+before closing keep alive connection.
+
+A value of `null` will disable the limit.
+
+When limit is reach it will set `Connection` header value to `closed`,
+but will not actually close the connection, subsequent requests sent
+after the limit is reached will get `503 Service Unavailable` as a response.
+
### `server.timeout`
<!-- YAML
added: v0.9.12