forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rocksdb_block_cache_numshardbits for issue 1336 (percona#1339)
Upstream commit ID: facebook/mysql-5.6@730887a PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951) Summary: This fixes facebook/mysql-5.6#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/mysql-5.6#1339 Differential Revision: D47635762 fbshipit-source-id: 7ca759f9a001dbe1a20978ded5b614c209bd5b1f
- Loading branch information
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
mysql-test/suite/rocksdb_sys_vars/r/rocksdb_block_cache_numshardbits_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SET @start_global_value = @@global.ROCKSDB_BLOCK_CACHE_NUMSHARDBITS; | ||
SELECT @start_global_value; | ||
@start_global_value | ||
-1 | ||
"Trying to set variable @@global.ROCKSDB_BLOCK_CACHE_NUMSHARDBITS to 444. It should fail because it is readonly." | ||
SET @@global.ROCKSDB_BLOCK_CACHE_NUMSHARDBITS = 444; | ||
ERROR HY000: Variable 'rocksdb_block_cache_numshardbits' is a read only variable |
6 changes: 6 additions & 0 deletions
6
mysql-test/suite/rocksdb_sys_vars/t/rocksdb_block_cache_numshardbits_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
--let $sys_var=ROCKSDB_BLOCK_CACHE_NUMSHARDBITS | ||
--let $read_only=1 | ||
--let $session=0 | ||
--source ../include/rocksdb_sys_var.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters