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

Correct the comment of caching index & filter block with additional options to improve performance #2822

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Myasuka
Copy link
Member

@Myasuka Myasuka commented Oct 13, 2021

Descriptions of the changes in this PR:

Motivation

The previous comment of tableOptions.setCacheIndexAndFilterBlocks(true) is Options best suited for HDDs. If the comment thought that we could cache index&filter blocks when using HDD for better performance, however, this is not correct as this option actually helps on limit the memory usage of index & filter blocks. More internal details could refer to https://github.com/facebook/rocksdb/wiki/Block-Cache#caching-index-filter-and-compression-dictionary-blocks

Apart from correcting the comment, this PR also add additional options to help improve performance.

Changes

Correct the comment of caching index & filter block with additional options to improve performance.

tableOptions.setCacheIndexAndFilterBlocks(true);
// Options below are tune to mitigate the performance regression when limiting the memory usage
tableOptions.setCacheIndexAndFilterBlocksWithHighPriority(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I do not have enough information to make a call whether this is a good change or not:

  • I don't have personal experience tuning this
  • there is no link to a doc/KB article recommending these options to be used together
  • no linked perf tests proving the change will improve something.
    I can't make a call if the change that makes sense e.g. in case of SSD storage will work as well in case of HDD, and so on.

I think ideally we should move RocksDB options into config and provide reasonable defaults.
something like rocksdb.table.cacheIndexAndFilterBlocksWithHighPriority etc, to apply rocksdb.* settings without further code changes. there are also hardcoded configs in lines 134-139

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you could refer to rocksdb-wiki-cache-blocks to get some background information of setCacheIndexAndFilterBlocks. If this option is set as false, table reader would always keep the index & filter block in memory instead of limiting them in a LRU cache.
You could also refer to rocksdb-wiki-cache-blocks to see the suggestion to combine these options together.

@StevenLuMT
Copy link
Member

fix old workflow,please see #3455 for detail

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.

3 participants