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

Enable large cache per column family #9127

Closed

Conversation

gfukushima
Copy link
Contributor

PR Description

This PR adds an extra property to the KVStoreColumn to allow specifying if a certain column should use a larger cache, allowing us to provide larger caches only to the columns that require that.

Fixed Issue(s)

Fixes #9089

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

.map(
isLarger -> {
if (isLarger) {
LOG.info("Using larger cache for column {}", column.getId().toHexString());
Copy link
Member

Choose a reason for hiding this comment

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

NIT: not sure if we need this as a info. It seems to be pretty low level and I belive we are happy that most users are gonna use default values anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just for testing purposes.

return new LRUCache(configuration.getCacheCapacity());
}
})
.orElse(new LRUCache(configuration.getCacheCapacity()));
Copy link
Member

Choose a reason for hiding this comment

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

If getIsLargerCacheAvalilable() is Optional.empty(), it means that we are on the default case, right? If we don't want to change the existing behaviour we should use the large capacity (matching the old value) when getIsLargerCacheAvalilable() is empty. Maybe I am missing something but it does look like to me that we would be changing every cache to 32MB.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So long story short the default value used to be 8MB, which is low. We've changed to 128MB as a first step to get the db performing better and we're trying to narrow down what columns need larger caches, that being said the default should be something lower than 128MB, Rocks default is 32MB (as of release 8.x) which is what I believe we should be using by default as well, 8MB was set long time ago and I don't think is suitable anymore for the current needs.

@gfukushima
Copy link
Contributor Author

I'm closing this PR because I haven't seen the benefits of using lower caches.

@gfukushima gfukushima closed this Feb 21, 2025
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.

[RocksDB] Enable setting larger cache for specific columns
2 participants