-
Notifications
You must be signed in to change notification settings - Fork 553
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
Made storage::readers_cache
size limitted
#16846
Made storage::readers_cache
size limitted
#16846
Conversation
Signed-off-by: Michal Maslanka <michal@redpanda.com>
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45609#018e08ea-b646-4c8d-89b6-61fb399f6e11 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45609#018e08ea-b63f-4736-91cc-b69eb8f5783e ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45609#018e08fc-d372-4e56-91f4-d3bd574d0973 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45787#018e1859-f37c-4ccb-b528-d73d8615c537 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45787#018e1859-f382-465a-b816-16fdc216a2d3 |
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.
This looks good, but I'm wondering about the decision to have this be a soft limit
Added property which allows controlling maximum number of readers kept in cache per ntp. The value was previously unbounded which may lead to a situation in which readers cache grew and caused out of memory error. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Added size based eviction to `storage::readers_cache`. Previously the eviction was only time based which may lead to a problem when multiple readers were created for the same NTP. Now with the size based eviction the readers cache size is bounded and will not grow indefinitely. Note on backward compatibility: Previously the size of cache was unbounded. In this commit we change the policy to keep up to 200 readers per ntp. This number is still large enough not cause any issues as it would mean that there are 200 concurrent readers reading a single partition at the same time. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Added jitter to readers cache eviction timer to prevent all eviction timers from firing at the same time. Signed-off-by: Michal Maslanka <michal@redpanda.com>
aa3965f
to
d3b07de
Compare
*this, | ||
"readers_cache_target_max_size", | ||
"Maximum desired number of readers cached per ntp. This a soft limit, a " | ||
"number of readers in cache may temporary increase as cleanup is done in " |
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.
nit: temporarily
LGTM! Thanks for changing the approach |
/backport v23.3.x |
/backport v23.2.x |
Failed to create a backport PR to v23.3.x branch. I tried:
|
Failed to create a backport PR to v23.2.x branch. I tried:
|
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.
From the cover letter
which may lead to a problem when multiple
readers were created for the same NTP.
what's the problem?
Added size based eviction to
storage::readers_cache
. Previously theeviction was only time based which may lead to a problem when multiple
readers were created for the same NTP. Now with the size based eviction
the readers cache size is bounded and will not grow indefinitely.
Note on backward compatibility:
Previously the size of cache was unbounded. In this commit we change the
policy to keep up to 200 readers per ntp. This number is still large
enough not cause any issues as it would mean that there are 200
concurrent readers reading a single partition at the same time.
Backports Required
Release Notes
Improvements