Skip to content
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

maxConnAge description is misleading #32

Closed
mkosta opened this issue Apr 9, 2024 · 2 comments · Fixed by grafana/k6-docs#1543
Closed

maxConnAge description is misleading #32

mkosta opened this issue Apr 9, 2024 · 2 comments · Fixed by grafana/k6-docs#1543
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@mkosta
Copy link

mkosta commented Apr 9, 2024

maxConnAge description says that this parameter manages idle connections, which is misleading. if there is one conection open and is fully and constantly utilized by redis client, socket will be still closed after connection life time reaches this maxage vaue despite connection status. so it has nothing to do with idleness, but is simply maxlifetime of connection. readin the doc i figured it will close idle connections after say 10 secs, but what i got was sockets are being closed and opened every 10 secs. and once you set it as 0, it is handled like persistent socket and same load is going through one socket for hours.
we should just remove "idle" from the doc) thanks

/**
* The maximum amount of time, in milliseconds, a connection can stay idle in the pool before being closed.
*
* This can help in cycling connections and preventing stale connections.
*/
maxConnAge?: number;

@joanlopez
Copy link

Hi @mkosta,

Yeah, I think you're right! maxConnAge is used as ConnMaxLifetime, and from the library docs:

// ConnMaxLifetime is the maximum amount of time a connection may be reused.
//
// Expired connections may be closed lazily before reuse.
// If <= 0, connections are not closed due to a connection's age.
//
// Default is to not close idle connections.

which isn't the same as ConnMaxIdleTime, which in xk6-redis is configured with: idleTimeout.

I'll open a PR in k6-docs to fix it.

Thanks for reporting it! 🙇🏻

@mkosta
Copy link
Author

mkosta commented Apr 9, 2024

@joanlopez thank you!

@joanlopez joanlopez added documentation Improvements or additions to documentation and removed triage labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants