参数 |
说明 |
备注 |
rocksdb_block_cache |
缓存uncompressed blocks,此cache有分区优化,分区数由table_cache_numshardbits控制,默认为6即64个分区。 每个分区至少大于512k(rocksdb::LRUCache::LRUCache) |
默认为512M |
rocksdb_max_total_wal_size |
如果WAL超过rocksdb_max_total_wal_size,会swich memtable并flush memtable |
默认为0, 表示大小不能超过所有 columnfamily write_buffer的4倍 |
rocksdb_wal_size_limit_mb |
purge wal时最多可以保留wal的最大大小 (对应DBOptions::WAL_size_limit_MB) |
默认为0,表示不控制保留wal数量, 只要memtable flush了wal都可以 purge |
rocksdb_wal_ttl_seconds |
控制purge wal的频率,每隔rocksdb_wal_ttl_seconds/2 purge一次
。如果rocksdb_wal_size_limit_mb > 0, 那么每600s purge一次(kDefaultIntervalToDeleteObsoleteWAL)
|
默认为0 |
rocksdb_manual_wal_flush |
If true WAL is not flushed automatically after each write. Instead it relies on manual invocation of FlushWAL to write the WAL buffer to its file. |
默认为true |
rocksdb_deadlock_detect |
是否开启死锁检测 |
默认是关闭的 |
rocksdb_wal_bytes_per_sync |
每rocksdb_wal_bytes_per_sync字节sync一次WAL(WritableFileWriter::Flush) |
默认为0, 每次都刷 |
rocksdb_wal_recovery_mode |
重启时recovery模式 |
1: Fail to start, do not recover
0: If corrupted last entry: truncate and start
2: Truncate everything after corrupted entry
• Even not corrupted entries
• Acceptable on slaves
3: Truncate only corrupted entry • Most dangerous option
|
rocksdb_strict_collation_exceptions |
可以取非memcompare类型collation的表 |
取值为正则表达式,如"t1,t2*" |
rpl_skip_tx_api |
Use write batches for replication thread instead of tx api |
作用于备库 |
rocksdb_master_skip_tx_api |
Disables Transaction API Enables WriteBatch API, There is no row lock,UPDATE and DELETEs are faster |
You must ensure no concurrent operation running |
rocksdb_read_free_rpl_tables |
用正则表达式指定使用read free replication的库表,如.*或t.* |
默认为空
|
rocksdb_info_log_level |
日志级别,数值越小越详细 |
0:debug_level 1:info_level 2:warn_level 3:error_level 4:fatal_level 5:header_level |
rocksdb_perf_context_level |
指定 perf context的级别
0,1: disable
2: enable only count stats
3: Other than count stats, also enable time stats except for mutexes
4: enable count and time stats
|
默认0 |
rocksdb_max_background_jobs |
后台工作线程数 |
|
rocksdb_commit_in_the_middle |
Commit rows implicitly every rocksdb_bulk_load_size, 设置rocksdb_bulk_load为on时自动commit in middle |
默认OFF,
不建议全局设置,应回话级别设置
|
rocksdb_blind_delete_primary_key |
通过主键delete 有且仅有主键索引的表时,不需要读取数据,直接通过指定的主键来删除 |
默认OFF,
DELETES by Primary Key Works: DELETE FROM t WHERE id IN (1, 2, 3, 4, 5, 6, ...., 10000)
Does not work:
DELETE .. WHERE id < 10
|
rocksdb_use_direct_reads |
use O_DIRECT for reading data |
默认OFF |
rocksdb_use_direct_io_for_flush_and_compaction |
use O_DIRECT for flush and compact |
默认OFF |
rocksdb_skip_fill_cache |
Skip filling block cache on read requests |
默认OFF,
DDL load 时使用
|
gap_lock_raise_error |
Using Gap Lock without full unique key in multi-table or multi-statement transactions is not allowed.
违法以上情况使用gap lock会记入错误日志
|
默认false |
gap_lock_write_log |
Using Gap Lock without full unique key in multi-table or multi-statement transactions is not allowed. 违法以上情况使用gap lock会记入gap_lock_log_file指定的文件中 |
默认false |
gap_lock_log_file |
指定记录gap lock的文件 |
|
rocksdb_stats_dump_period_sec |
控制Statistic信息记录到LOG中的频率(DBImpl::PrintStatistics)
|
默认600,
Note that currently it is only dumped after a compaction. So if the database doesn't serve any write for a long time, statistics may not be dumped, despite of options.stats_dump_period_sec.
|
rocksdb_compaction_readahead_size |
If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads.
|
默认为0 |
rocksdb_advise_random_on_open |
If set true, will hint the underlying file system that the file access pattern is random, when a sst file is opened. |
默认ON |
rocksdb_max_row_locks |
事务最多可以持有锁的个数 |
默认1M |
rocksdb_bytes_per_sync |
每rocksdb_wal_bytes_per_sync字节sync一次sst文件(WritableFileWriter::Flush) |
默认为0, 每次都刷
You may consider using rate_limiter to regulate write rate to device. When rate limiter is enabled, it automatically enables bytes_per_sync to 1MB.
|
rocksdb_enable_ttl |
Enable expired TTL records to be dropped during compaction |
默认ON |
rocksdb_enable_ttl_read_filtering |
For tables with TTL, expired records are skipped/filtered out during processing and in query results. Disabling this will allow these records to be seen, but as a result rows may disappear in the middle of transactions as they are dropped during compaction. Use with caution. |
默认ON |
rocksdb_bulk_load |
bulk_load开关 |
默认OFF,
|
rocksdb_bulk_load_allow_unsorted |
支持非主键排序数据的bulk_load |
默认OFF |
rocksdb_bulk_load_size |
每rocksdb_bulk_load_size次write进行一次bulk_load |
默认1000次 |
rocksdb_enable_bulk_load_api |
Enables using SstFileWriter for bulk loading |
默认ON |
rocksdb_enable_2pc |
是否开启2pc |
默认ON |
rocksdb_rate_limiter_bytes_per_sec |
控制读写sst的速度
DBOptions::rate_limiter bytes_per_sec for RocksDB
|
默认0 |
rocksdb_sst_mgr_rate_bytes_per_sec |
控制删除sst的速度
DBOptions::sst_file_manager rate_bytes_per_sec for RocksDB
|
默认0 |
rocksdb_delayed_write_rate |
WriteStall时delay的时间,单位微秒(DBOptions::delayed_write_rate) |
默认0 |
rocksdb_write_disable_wal |
是否关闭WAL |
默认为OFF |
rocksdb_flush_log_at_trx_commit |
Sync wal on transaction commit
Similar to innodb_flush_log_at_trx_commit.
1: sync on commit,
0,2: not sync on commit
|
默认1 |
rocksdb_cache_index_and_filter_blocks |
index和filter blocks是否缓存到block cache |
默认ON |
rocksdb_pin_l0_filter_and_index_blocks_in_cache |
if cache_index_and_filter_blocks is true and the below is true, then filter and index blocks are stored in the cache, but a reference is held in the "table reader" object so the blocks are pinned and only evicted from cache when the table reader is freed. |
默认ON |