-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for configurable connection lifetime #2054
Comments
Hmm besides This seems a bit more predictable than a timer-based approach, since iterations usually model a discrete (part of a) journey in some scenario. Not sure how this applies to your use case, but in general, closing existing connections at the end of an iteration makes logical sense to me. First, because you know that the connections aren't actively used anymore ( And if an iteration is too short of a time-frame (i.e. you want to make more requests before you close your connections), you can always use a |
Hmm yeah, we could use this. I think with our current setup, the for loop would have to make ~800 requests... I don't have a good sense of these things but that feels larger than what we want within an iteration. Is that true? |
An iteration can be a second or an hour, very much depends on your use case, k6 doesn't restrict it 🤷♂️ In your case, the |
We won't be changing this in the current HTTP API, but it will be possible in the new API (initial design document). We haven't decided on the syntax yet, but will address this once we flesh out the design more. |
Feature Description
We are in a situation where we don't necessarily want to respect a server's
Keep-Alive
headers (as they've been configured with a client in mind that isn't 1000s of loadtesting vus) but we don't want to recreate a connection per request as--no-connection-reuse
would have us do. Ideally, we'd have an option that'd let us configure amaxConnectionLifetime
which would hold a connection open for themin(keepAliveTime, maxConnectionLifetime)
and reset the connection at that point.Suggested Solution (optional)
I imagine we can implement a flag,
--max-connection-lifetime
that would take a time range string and then use similar to here to control that lifetime, something likeThe text was updated successfully, but these errors were encountered: