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

ingester: implement request size instance limit #6492

Merged
merged 12 commits into from
Nov 1, 2023
Merged

Conversation

pstibrany
Copy link
Member

What this PR does

This PR implements total request size instance limit. Works best in combination with -ingester.limit-inflight-requests-using-grpc-method-limiter flag, and distributors with #6490.

Which issue(s) this PR fixes or relates to

Previous attempt #5958, rejected because the check is not very effective when done from inside Push handler in ingester.

Checklist

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

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Nice job! LGTM (modulo a nit)

if err := i.checkAvailable(); err != nil {
return err
}

inflight := i.inflightPushRequests.Inc()
decreaseInflightInDefer := true
inflightBytes := int64(0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we don't know the requestSize we may want to set inflightBytes to i.inflightPushRequestsBytes.Load() so that the later check runs at least on the inflight requests for which size was known.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, that's a great point. I'll add test for this as well, and double-check if we do the same on distributor.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
…ytes error.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
… known.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@pstibrany pstibrany merged commit 3ca84fe into main Nov 1, 2023
28 checks passed
@pstibrany pstibrany deleted the ingester-size-check branch November 1, 2023 15:57
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.

2 participants