facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.48k stars 712 forks source link

MyRocks block cache uses a lot more memory than rocksdb_block_cache_size #1040

Open ghost opened 5 years ago

ghost commented 5 years ago

I was running Sysbench oltp_read_only test on MyRocks. The memory used by MyRocks just keeps increasing although I have set rocksdb_block_cache_size = 1G and strict_capacity_limit=true. Is there anything missing in the configuration shown below? Or is this a bug in current MyRocks source?

Server and OS: CPU: Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz x 24 cores DRAM: 128 GB OS: CentOS 7.2 Kernel: 3.10.0-327.el7.x86_64

my.cnf:

rocksdb
log_error = mysql_error.log
default-storage-engine=rocksdb
skip-innodb
default-tmp-storage-engine=MyISAM
binlog_format=ROW
collation-server=latin1_bin
transaction-isolation=READ-COMMITTED

# I add, speed up load data
rocksdb_commit_in_the_middle=1
rocksdb_bulk_load=1
rocksdb_bulk_load_allow_unsorted=1
sql_log_bin=0

rocksdb_max_open_files=-1
rocksdb_max_background_jobs=8
rocksdb_max_total_wal_size=4G
rocksdb_table_cache_numshardbits=6

# rate limiter
rocksdb_bytes_per_sync=4194304
rocksdb_wal_bytes_per_sync=4194304
rocksdb_rate_limiter_bytes_per_sec=304857600 #100MB/s. Increase if you're running on higher spec machines

# triggering compaction if there are many sequential deletes
rocksdb_compaction_sequential_deletes_count_sd=1
rocksdb_compaction_sequential_deletes=199999
rocksdb_compaction_sequential_deletes_window=200000

rocksdb_default_cf_options=write_buffer_size=32m;target_file_size_base=32m;max_bytes_for_level_base=512m;level0_file_num_compaction_trigger=12;level0_slowdown_writes_trigger=40;level0_stop_writes_trigger=60;max_write_buffer_number=32;bottommost_compression=kDisableCompressionOption;compression_opts=-14:1:0;block_based_table_factory={cache_index_and_filter_blocks=0;filter_policy=bloomfilter:10:false;whole_key_filtering=1;block_cache={capacity=1G;num_shard_bits=1;strict_capacity_limit=true;high_pri_pool_ratio=0;};};level_compaction_dynamic_level_bytes=true;optimize_filters_for_hits=true;compaction_pri=kMinOverlappingRatio;compression_per_level=kNoCompression
rocksdb_use_direct_reads = 1
rocksdb_block_cache_size = 1G
datadir = /mnt/sfx-card-root/orig_myrocks

MyRocks version: MySQL git hash: f8a411f3133984ea22e9cd9733a17923829e91fc RocksDB git hash: f8a411f3133984ea22e9cd9733a17923829e91fc

Sysbench version: 1.0.17

  1. Load data sysbench --db-driver=mysql --mysql-host=localhost --mysql-port=3306 --mysql-user=sbte st --mysql-password=sbtest /usr/share/sysbench/oltp_read_only.lua --tables=16 --threads=16 --table -size=$((100010241024/200)) --time=10 --mysql-storage-engine=rocksdb --mysql-socket=/tmp/mysql.sock prepare

  2. Run test sysbench --db-driver=mysql --mysql-host=localhost --mysql-port=3306 --mysql-user=sbte st --mysql-password=sbtest /usr/share/sysbench/oltp_read_only.lua --tables=16 --threads=16 --table -size=$((100010241024/200)) --time=2000 --mysql-storage-engine=rocksdb --mysql-socket=/tmp/mysql.sock run

mdcallag commented 5 years ago

It would help if you were more specific about RSS and VSZ from mysqld