[Backport] [2.x] feat: add vertical scaling and SoftReference for snapshot repository data cache (#16489)#16624
Merged
dbwiddis merged 1 commit intoopensearch-project:2.xfrom Nov 12, 2024
Conversation
…data cache (opensearch-project#16489) - Applies `SoftReference` to cached repository data for efficient memory management under heap pressure. - Enables cache size configuration in `opensearch.yml`, adjustable within a range of 500KB to 1% of heap memory. - Sets the default cache size to `Math.max(ByteSizeUnit.KB.toBytes(500), CACHE_MAX_THRESHOLD / 2)` so it’s generally proportional to heap size. In cases where 1% of the heap is less than 1000KB, indicating a low-memory environment, the default reverts to 500KB as before. - Since `BytesReference` internally uses `byte[]`, the compressed array size is capped at `Integer.MAX_VALUE - 8` to ensure compatibility with JDK limitations on array sizes. Therefore, the maximum cache size cannot exceed this limit. Signed-off-by: inpink <inpink@kakao.com> (cherry picked from commit 53d41d3) Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
51c75bd to
91fc7ab
Compare
Contributor
|
❕ Gradle check result for 91fc7ab: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #16624 +/- ##
============================================
- Coverage 71.87% 71.81% -0.06%
+ Complexity 65431 65409 -22
============================================
Files 5314 5314
Lines 305140 305166 +26
Branches 44458 44464 +6
============================================
- Hits 219311 219159 -152
- Misses 67507 67772 +265
+ Partials 18322 18235 -87 ☔ View full report in Codecov by Sentry. |
dbwiddis
approved these changes
Nov 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #16489 to
2.x