-
Notifications
You must be signed in to change notification settings - Fork 527
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
Fix Ingester Stutter #449
Fix Ingester Stutter #449
Conversation
Signed-off-by: Joe Elliott <number101010@gmail.com>
Great improvement. LGTM |
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
tracesToCut := make([]*trace, 0, len(i.traces)) | ||
|
||
for key, trace := range i.traces { | ||
if now.Add(cutoff).After(trace.lastAppend) || immediate { | ||
if cutoffTime.After(trace.lastAppend) || immediate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you move immediate to the front, it will short circuit the cutoffTime calculation. this may reduce the amount of time tracesMtx is held
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
immediate is almost never true. it only occurs when the ingester is shutting down to force flush traces from the active trace map to disk. i think this ordering is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, thanks for considering it.
Signed-off-by: Joe Elliott <number101010@gmail.com>
tracesToCut := make([]*trace, 0, len(i.traces)) | ||
|
||
for key, trace := range i.traces { | ||
if now.Add(cutoff).After(trace.lastAppend) || immediate { | ||
if cutoffTime.After(trace.lastAppend) || immediate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, thanks for considering it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
What this PR does:
Ingesters currently show unreasonably high p99's on read and write. This is likely due to slow appends to the headblock. Note that under the hood it is inserting into a slice.
This PR reduces the time that we lock the active traces map by simply adding them to a linked list. Then we drop the active traces lock and only lock the blocks while we are adding them to the append block.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]