-
Notifications
You must be signed in to change notification settings - Fork 113
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
state: document memory_cache_bytes, reduce default #1233
Conversation
Closes #1026 Because of the way that sled uses this parameter, the actual in-memory size may be much larger. Dialing this down should help avoid high memory usage.
@@ -87,7 +96,7 @@ impl Default for Config { | |||
|
|||
Self { | |||
cache_dir, | |||
memory_cache_bytes: 512 * 1024 * 1024, | |||
memory_cache_bytes: 50_000_000, |
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 doesn't correspond to an actual in-memory size, so there's no reason to have an exact power of two size.
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.
It's also much easier for users to understand and tweak a default that ends with lots of zeroes.
/// This corresponds to `sled`'s [`cache_capacity`][cc] parameter. | ||
/// Note that the behavior of this parameter is [somewhat | ||
/// unintuitive][gh], measuring the on-disk size of the cached data, | ||
/// not the in-memory size, which may be much larger, especially for | ||
/// smaller keys and values. |
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.
👍
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.
🗜
PR #1233 changed the default `memory_cache_bytes`, but left the acceptance tests with their old value. To avoid similar issues in future, we simply divide the default by 2.
* Use the default memory limit in the acceptance tests PR #1233 changed the default `memory_cache_bytes`, but left the acceptance tests with their old value.
Closes #1026
Because of the way that sled uses this parameter, the actual in-memory
size may be much larger. Dialing this down should help avoid high
memory usage.