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

RSS goes up when limit max_open_files from 1000 to 100 #13224

Open
979357361 opened this issue Dec 19, 2024 · 0 comments
Open

RSS goes up when limit max_open_files from 1000 to 100 #13224

979357361 opened this issue Dec 19, 2024 · 0 comments

Comments

@979357361
Copy link

I try to limit the memory usage of RocksDB, here are some settings:

rocksdb_block_based_options_set_cache_index_and_filter_blocks(table_option, true);
rocksdb_block_based_options_set_pin_top_level_index_and_filter(table_option, true);
rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache(table_option, true);
rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority(table_option, true);

rocksdb_block_based_options_set_index_type(table_option, rocksdb_block_based_table_index_type_two_level_index_search);
rocksdb_block_based_options_set_partition_filters(table_option, true);
rocksdb_block_based_options_set_metadata_block_size(table_option, 4096);

rocksdb_block_based_options_set_filter_policy(table_option, rocksdb_filterpolicy_create_bloom_full(10.0));
rocksdb_block_based_options_set_optimize_filters_for_memory(table_option, true);

the hyper clock cache is set to 7928MB, I think limit max_open_files to a smaller value could help,
when max_open_files=1000, stat shows:

         mem_table_total 15MB,
         mem_table_readers_total 1708690B,
         block_cache_total 7927MB,

rocksdb.estimate-table-readers-mem: 2067
Resident Set Size: 8352 MB

after I set max_open_files=100, Resident Set Size: 8352 MB goes up to 8550MB

There are three doubts:

  1. why limit max_open_files from 1000 to 100 let RSS goes up 200MB?
  2. the memory collected by RocksDB genarally has a big gap with RSS, how can I estimate the memory used by rocksdb?
  3. stats from rocksdb.estimate-table-readers-mem is not the same as MemoryUtil::kTableReadersTotal, from source code they should be the same?

is there any guideline to tell me how to calculate the memory usage and how to limit it?
Any help is welcomed, thank you!

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

No branches or pull requests

1 participant