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

Frontend cleanup and perf improvement #3996

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

joe-elliott
Copy link
Member

@joe-elliott joe-elliott commented Aug 22, 2024

What this PR does:
This PR cleans up unused code that Tempo inherited that allows the configuration of the max number of queriers a tenant has access to. This code is complicating attempts to improve this element of the frontend. It is currently unused and not even usable.

Additionally, I've moved the clean up of user queues to a timer. This prevents "flapping" of user queue creation/deletion. Currently, we delete the queue if we notice it has 0 jobs. This requires us to over provision go routines to shove jobs into the queue to prevent it from being constantly recreated. This PR should allow us to reduce the number of goroutines used to put pressure on the user queues lock and achieve the same query performance.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Copy link
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Love the code clean-up

modules/frontend/v1/frontend.go Outdated Show resolved Hide resolved
modules/frontend/v1/frontend.go Show resolved Hide resolved
modules/frontend/queue/user_queues.go Outdated Show resolved Hide resolved
modules/frontend/queue/user_queues.go Show resolved Hide resolved
modules/frontend/queue/queue.go Outdated Show resolved Hide resolved
modules/frontend/queue/queue.go Outdated Show resolved Hide resolved
modules/frontend/queue/queue.go Outdated Show resolved Hide resolved
modules/frontend/queue/queue.go Outdated Show resolved Hide resolved
modules/frontend/queue/queue.go Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@javiermolinar
Copy link
Contributor

I wonder if we should rename "users" to "tenants". It's pretty confusing already

)

const (
// How frequently to check for disconnected queriers that should be forgotten.
forgetCheckPeriod = 5 * time.Second
forgetCheckPeriod = 30 * time.Second // every 30 seconds b/c the the stopping code requires there to be no queues. i would like to make this 5-10 minutes but then shutdowns would be blocked
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we put this info somewhere in docs? feel like an internal detail so not sure if we should.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure where i would do that

Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott
Copy link
Member Author

joe-elliott commented Aug 23, 2024

I wonder if we should rename "users" to "tenants". It's pretty confusing already

We should drift towards "tenant", but I'm not willing to take that on in this PR.

Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott merged commit 3414179 into grafana:main Aug 23, 2024
17 checks passed
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.

3 participants