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

Always collect metrics about top backend requests #4282

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

awly
Copy link
Contributor

@awly awly commented Sep 1, 2020

Previously, it was only done in debug mode. This makes some tabs in
tctl top empty, when auth server is not in debug mode.

Fixes #4083

@russjones
Copy link
Contributor

@klizhentas Any reason we might only want this available in debug mode?

@awly
Copy link
Contributor Author

awly commented Sep 8, 2020

Chatted with @klizhentas, this can result in high memory usage on especially large clusters (with lots of nodes and/or remote clusters).
Need to think about this more, maybe there's a clever way to only record the slowest requests.

@awly awly marked this pull request as draft September 8, 2020 22:17
Previously, it was only done in debug mode. This makes some tabs in
`tctl top` empty, when auth server is not in debug mode.
@awly awly force-pushed the andrew/tctl-top-requests branch from 5f4f053 to e589366 Compare September 15, 2020 23:58
This LRU cache tracks the most frequent recent backend keys. All keys in
this cache map to existing labels in the requests metric. Any evicted
keys are also deleted from the metric.

This will keep an upper limit on our memory usage while still always
reporting the most active keys.
@awly awly marked this pull request as ready for review September 16, 2020 01:02
@awly
Copy link
Contributor Author

awly commented Sep 16, 2020

OK, added an LRU cache for the top requests alongside with the metric. On every cache eviction we'll delete the matching metric entry.
As a result, we will report at most 1000 backend keys. Infrequent keys will disappear while very busy keys will always be tracked.

PTAL

@awly awly merged commit 3587cca into master Sep 16, 2020
@awly awly deleted the andrew/tctl-top-requests branch September 23, 2020 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No data shown by "tctl top"
3 participants