- Last Updated: [[2020-12-10]]
-
- ### Toggle connection reuse
- > A boolean, true or false, specifying whether k6 should disable keep-alive connections. Available in k6 run and k6 cloud commands.
- Source: https://k6.io/docs/using-k6/options#no-connection-reuse
- ```javascript
export let options = {
noConnectionReuse: true,
};```
- ### Toggle VU connection reuse
- > A boolean, true or false, specifying whether k6 should reuse TCP connections between iterations of a VU. Available in k6 run and k6 cloud commands.
- Source: https://k6.io/docs/using-k6/options#no-vu-connection-reuse
- ```javascript
export let options = {
noVUConnectionReuse: true,
};```
- ### What's the difference between the two?
- `noConnectionReuse` determines whether a connection is reused throughout different actions of the same virtual user and in the same iteration.
- `noVUConnectionReuse` determines whether a connection between iterations of a single virtual user.
- > vu connection reuse is for reusing it between VU iterations (so basically not cleaning up after iteration finishes), while the other is during a single iteration ... so both do different thing
- [[Mihail Stoykov]] via Slack