Skip to content

Commit cfd354e

Browse files
mdcallaginikep
authored andcommitted
[myrocks] Add rocksdb_block_cache_numshardbits for issue 1336 (facebook#1339)
Summary: This fixes facebook#1336 This adds the my.cnf options: rocksdb_block_cache_numshardbits This option can be set so that RocksDB to fix the number of block cache shards. The default value is -1 to match existing behavior. When -1 RocksDB code will determine the number of block cache shards as min(6, rocksdb_block_cache_size / min_shard_size) and today min_shard_size is 512K for LRU and 32M for Hyper. The math above frequently results in a block cache with too many small shards when rocksdb_block_cache_size is not too big (a few GB is not too big) and there will be perf problems that are hard to debug in such a case. Pull Request resolved: facebook#1339 Differential Revision: D47635762
1 parent 2b89efd commit cfd354e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎mysql-test/r/mysqld--help-notwin.result‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,8 @@ The following options may be given as the first argument:
13231323
Deleting rows by primary key lookup, without reading rows
13241324
(Blind Deletes). Blind delete is disabled if the table
13251325
has secondary key
1326+
--rocksdb-block-cache-numshardbits=#
1327+
Block cache numshardbits for RocksDB
13261328
--rocksdb-block-cache-size=#
13271329
block_cache size for RocksDB
13281330
--rocksdb-block-restart-interval=#
@@ -2526,6 +2528,7 @@ rocksdb-allow-mmap-reads FALSE
25262528
rocksdb-allow-mmap-writes FALSE
25272529
rocksdb-allow-to-start-after-corruption FALSE
25282530
rocksdb-blind-delete-primary-key FALSE
2531+
rocksdb-block-cache-numshardbits -1
25292532
rocksdb-block-cache-size 536870912
25302533
rocksdb-block-restart-interval 16
25312534
rocksdb-block-size 4096

0 commit comments

Comments
 (0)