Skip to content

Overload: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure. - #17949

Merged
alyssawilk merged 2 commits into
envoyproxy:mainfrom
KBaichoo:rst-stream-limit
Sep 7, 2021
Merged

alyssawilk merged 2 commits into
envoyproxy:mainfrom
KBaichoo:rst-stream-limit

Conversation

@KBaichoo

@KBaichoo KBaichoo commented Sep 1, 2021 •

Copy link
Copy Markdown
Contributor

Signed-off-by: Kevin Baichoo [email protected]

Commit Message: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.
Additional Description: Since we limit number of streams reset, we should start resetting the largest eligible streams first.
Risk Level: low
Testing: unit test
Docs Changes: Included
Release Notes: TBD
Platform Specific Features: NA
Related Issue #15791

WatermarkBufferFactory::resetAccountsGivenPressure.

Signed-off-by: Kevin Baichoo <[email protected]>
@KBaichoo

KBaichoo commented Sep 1, 2021

Copy link
Copy Markdown
Contributor Author

/assign @alyssawilk

@alyssawilk alyssawilk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! Looks good modulo 2 tiny nits.
/wait

// Effectively disables tracking as this should zero out all reasonable account
// balances when shifted by this amount.
constexpr uint32_t kEffectivelyDisableTrackingBitshift = 63;
constexpr uint32_t kMaxNumberOfStreamsToResetPerInvocation = 50;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd comment here as well that 50 is arbitrary, to limit work done (as you doc up above)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

no streams will be reset. When heap usage is at or above 85%, we start to
reset buckets according to the strategy described below. When the heap
usage is at 95% all streams using >= 1MiB memory are eligible for reset.
This Overload action will reset up to 50 streams (this is a hardcoded limit)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/Overload/overload?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Kevin Baichoo <[email protected]>

@KBaichoo KBaichoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @alyssawilk

// Effectively disables tracking as this should zero out all reasonable account
// balances when shifted by this amount.
constexpr uint32_t kEffectivelyDisableTrackingBitshift = 63;
constexpr uint32_t kMaxNumberOfStreamsToResetPerInvocation = 50;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

no streams will be reset. When heap usage is at or above 85%, we start to
reset buckets according to the strategy described below. When the heap
usage is at 95% all streams using >= 1MiB memory are eligible for reset.
This Overload action will reset up to 50 streams (this is a hardcoded limit)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@alyssawilk
alyssawilk merged commit de5bf9b into envoyproxy:main Sep 7, 2021
tyxia pushed a commit to tyxia/envoy that referenced this pull request Sep 21, 2021
…rkBufferFactory::resetAccountsGivenPressure. (envoyproxy#17949)

Commit Message: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.
Additional Description: Since we limit number of streams reset, we should start resetting the largest eligible streams first.
Risk Level: low
Testing: unit test
Docs Changes: Included
Release Notes: TBD
Platform Specific Features: NA
Related Issue envoyproxy#15791
Signed-off-by: Kevin Baichoo <[email protected]>
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