You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/connecting.asciidoc
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ This page contains the information you need to connect and use the Client with
11
11
* <<client-faas-env, Using the Client in a Function-as-a-Service Environment>>
12
12
* <<client-connect-proxy, Connecting through a proxy>>
13
13
* <<client-error-handling, Handling errors>>
14
+
* <<keep-alive, Keep-alive connections>>
14
15
* <<product-check, Automatic product check>>
15
16
16
17
[[authentication]]
@@ -659,6 +660,37 @@ a|* `name` - `string`
659
660
* `headers` - `object`, the response status code
660
661
|===
661
662
663
+
[[keep-alive]]
664
+
[discrete]
665
+
=== Keep-alive connections
666
+
667
+
By default, the client uses persistent, keep-alive connections to reduce the overhead of creating a new HTTP connection for each Elasticsearch request.
668
+
If you are using the default `UndiciConnection` connection class, it maintains a pool of 256 connections with a keep-alive of 10 minutes.
669
+
If you are using the legacy `HttpConnection` connection class, it maintains a pool of 256 connections with a keep-alive of 1 minute.
670
+
671
+
If you need to disable keep-alive connections, you can override the HTTP agent with your preferred https://nodejs.org/api/http.html#http_new_agent_options[HTTP agent options]:
0 commit comments