Skip to content

Commit 00e2e29

Browse files
authored
Merge pull request #2623 from DennisKrone/document-connection-handling
Add documentation about manually closing TCP/HTTP connections
2 parents 7f3d735 + 3d5c4c6 commit 00e2e29

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: docs/increase-performance.rst

+13
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ For a complete example, see `rest.py <https://github.com/locustio/locust/blob/ma
9090
This feature is new and details of its interface/implementation may change in new versions of Locust.
9191

9292

93+
Connection Handling
94+
===================
95+
96+
By default a user will reuse the same TCP/HTTP connection if possible. To more realistically simulate new users connecting to your application this connection can be manually closed.
97+
98+
.. code-block:: python
99+
100+
@task
101+
def t(self):
102+
self.client.client.clientpool.close()
103+
self.client.get("/") # Here a new connection will be created
104+
105+
93106
API
94107
===
95108

0 commit comments

Comments
 (0)