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/guide/protocols/http/keepAlive.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
#### Keep alive
2
2
3
-
Jmeter-java-dsl maintains a persistent http connection for subsequent requests to the same server.
4
-
It is done by sending `Connection: keep-alive` header.
5
-
If you want to disable keep-alive logic and force a server to close connection after each request then use`.useKeepAlive(false)` in a given `httpSampler` or `httpDefaults`.
3
+
By default, **JMeter Java DSL** uses a persistent HTTP connection (sending the `Connection: keep-alive` header) to reuse the same socket for multiple requests to the same server.
6
4
5
+
To force server to close the connection after each request, you can disable keep-alive with `.useKeepAlive(false)` either on an individual `httpSampler` or globally on `httpDefaults`.
6
+
7
+
This can be useful when you’re load-testing an API that enforces a strict limit on the number of simultaneous sockets per client. If you leave keep-alive enabled, each virtual user will hold its socket open for the duration of the test, consuming the gateway’s connection pool.
0 commit comments