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

Support using secondary cache with the blob cache #10349

Closed
wants to merge 12 commits into from

Conversation

gangliao
Copy link
Contributor

@gangliao gangliao commented Jul 12, 2022

Summary:

RocksDB supports a two-level cache hierarchy (see https://rocksdb.org/blog/2021/05/27/rocksdb-secondary-cache.html), where items evicted from the primary cache can be spilled over to the secondary cache, or items from the secondary cache can be promoted to the primary one. We have a CacheLib-based non-volatile secondary cache implementation that can be used to improve read latencies and reduce the amount of network bandwidth when using distributed file systems. In addition, we have recently implemented a compressed secondary cache that can be used as a replacement for the OS page cache when e.g. direct I/O is used. The goals of this task are to add support for using a secondary cache with the blob cache and to measure the potential performance gains using db_bench.

This task is a part of #10156

db/blob/blob_source.cc Outdated Show resolved Hide resolved
db/blob/blob_source.cc Show resolved Hide resolved
db/blob/blob_source_test.cc Outdated Show resolved Hide resolved
db/blob/blob_source_test.cc Show resolved Hide resolved
@gangliao gangliao mentioned this pull request Jul 13, 2022
14 tasks
@zhichao-cao
Copy link
Contributor

Blob cache should use the same secondary cache as used in LRU cache backed or they should be 2 separate Cachelib instances?

@gangliao
Copy link
Contributor Author

Blob cache should use the same secondary cache as used in LRU cache backed or they should be 2 separate Cachelib instances?

Hi @zhichao-cao, we haven't tested it yet. But ideally, both modes can be supported.

db/blob/blob_source.h Outdated Show resolved Hide resolved
db/blob/blob_source.h Outdated Show resolved Hide resolved
db/blob/blob_source.cc Outdated Show resolved Hide resolved
db/blob/blob_source_test.cc Outdated Show resolved Hide resolved
db/blob/blob_source_test.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@ltamasi ltamasi left a comment

Choose a reason for hiding this comment

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

Thanks @gangliao! LGTM, just some minor comments/questions.

Please also add an entry to HISTORY.md.

db/blob/blob_source.h Outdated Show resolved Hide resolved
db/blob/blob_source.h Outdated Show resolved Hide resolved
db/blob/blob_source_test.cc Outdated Show resolved Hide resolved
db/blob/blob_source_test.cc Outdated Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@gangliao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@gangliao has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@gangliao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

RocksDB supports a two-level cache hierarchy (see https://rocksdb.org/blog/2021/05/27/rocksdb-secondary-cache.html), where items evicted from the primary cache can be spilled over to the secondary cache, or items from the secondary cache can be promoted to the primary one. We have a CacheLib-based non-volatile secondary cache implementation that can be used to improve read latencies and reduce the amount of network bandwidth when using distributed file systems. In addition, we have recently implemented a compressed secondary cache that can be used as a replacement for the OS page cache when e.g. direct I/O is used. The goals of this task are to add support for using a secondary cache with the blob cache and to measure the potential performance gains using `db_bench`.
@facebook-github-bot
Copy link
Contributor

@gangliao has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@gangliao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants