Buy Percona ServicesBuy Now!

MyRocks Variables

MyRocks provides variables to tune performance and manage the behavior of the storage engine.

MyRocks Server Variables

The MyRocks server variables expose configuration of the underlying RocksDB engine. There several ways to set these variables:

  • For production deployments, you should have all variables defined in the configuration file.
  • Dynamic variables can be changed at runtime using the SET statement.
  • If you want to test things out, you can set some of the variables when starting mysqld using corresponding command-line options.

If a variable was not set in either the configuration file or as a command-line option, the default value is used.

Also, all variables can exist in one or both of the following scopes:

  • Global scope defines how the variable affects overall server operation.
  • Session scope defines how the variable affects operation for individual client connections.
Name Command Line Dynamic Scope
rocksdb_access_hint_on_compaction_start Yes No Global
rocksdb_advise_random_on_open Yes No Global
rocksdb_allow_concurrent_memtable_write Yes No Global
rocksdb_allow_mmap_reads Yes No Global
rocksdb_allow_mmap_writes Yes No Global
rocksdb_base_background_compactions Yes No Global
rocksdb_block_cache_size Yes No Global
rocksdb_block_restart_interval Yes No Global
rocksdb_block_size Yes No Global
rocksdb_block_size_deviation Yes No Global
rocksdb_bulk_load Yes Yes Global, Session
rocksdb_bulk_load_size Yes Yes Global
rocksdb_bytes_per_sync Yes No Global
rocksdb_cache_index_and_filter_blocks Yes No Global
rocksdb_checksums_pct Yes Yes Global, Session
rocksdb_collect_sst_properties Yes No Global
rocksdb_commit_in_the_middle Yes Yes Global
rocksdb_compact_cf Yes Yes Global
rocksdb_compaction_readahead_size Yes Yes Global
rocksdb_compaction_sequential_deletes Yes Yes Global
rocksdb_compaction_sequential_deletes_count_sd Yes Yes Global
rocksdb_compaction_sequential_deletes_file_size Yes Yes Global
rocksdb_compaction_sequential_deletes_window Yes Yes Global
rocksdb_create_checkpoint Yes Yes Global
rocksdb_create_if_missing Yes No Global
rocksdb_create_missing_column_families Yes No Global
rocksdb_datadir Yes No Global
rocksdb_db_write_buffer_size Yes No Global
rocksdb_deadlock_detect Yes Yes Global, Session
rocksdb_debug_optimizer_no_zero_cardinality Yes Yes Global, Session
rocksdb_default_cf_options Yes No Global
rocksdb_delayed_write_rate Yes Yes Global
rocksdb_delete_obsolete_files_period_micros Yes No Global
rocksdb_enable_bulk_load_api Yes No Global
rocksdb_enable_ttl Yes No Global
rocksdb_enable_thread_tracking Yes No Global
rocksdb_enable_write_thread_adaptive_yield Yes No Global
rocksdb_error_if_exists Yes No Global
rocksdb_flush_log_at_trx_commit Yes Yes Global, Session
rocksdb_flush_memtable_on_analyze Yes Yes Global, Session
rocksdb_force_compute_memtable_stats Yes Yes Global
rocksdb_force_flush_memtable_and_lzero_now Yes Yes Global
rocksdb_force_flush_memtable_now Yes Yes Global
rocksdb_force_index_records_in_range Yes Yes Global, Session
rocksdb_hash_index_allow_collision Yes No Global
rocksdb_index_type Yes No Global
rocksdb_info_log_level Yes Yes Global
rocksdb_is_fd_close_on_exec Yes No Global
rocksdb_keep_log_file_num Yes No Global
rocksdb_lock_scanned_rows Yes Yes Global, Session
rocksdb_lock_wait_timeout Yes Yes Global, Session
rocksdb_log_file_time_to_roll Yes No Global
rocksdb_manifest_preallocation_size Yes No Global
rocksdb_max_background_compactions Yes Yes Global
rocksdb_max_background_flushes Yes No Global
rocksdb_max_log_file_size Yes No Global
rocksdb_max_manifest_file_size Yes No Global
rocksdb_max_open_files Yes No Global
rocksdb_max_row_locks Yes Yes Global, Session
rocksdb_max_subcompactions Yes No Global
rocksdb_max_total_wal_size Yes No Global
rocksdb_merge_buf_size Yes Yes Global, Session
rocksdb_merge_combine_read_size Yes Yes Global, Session
rocksdb_new_table_reader_for_compaction_inputs Yes No Global
rocksdb_no_block_cache Yes No Global
rocksdb_override_cf_options Yes No Global
rocksdb_paranoid_checks Yes No Global
rocksdb_pause_background_work Yes Yes Global
rocksdb_perf_context_level Yes Yes Global, Session
rocksdb_persistent_cache_path Yes No Global
rocksdb_persistent_cache_size_mb Yes No Global, Session
rocksdb_pin_l0_filter_and_index_blocks_in_cache Yes No Global
rocksdb_print_snapshot_conflict_queries Yes Yes Global
rocksdb_rate_limiter_bytes_per_sec Yes Yes Global
rocksdb_read_free_rpl_tables Yes Yes Global, Session
rocksdb_records_in_range Yes Yes Global, Session
rocksdb_reset_stats Yes Yes Global
rocksdb_rpl_skip_tx_api Yes Yes Global
rocksdb_seconds_between_stat_computes Yes Yes Global
rocksdb_signal_drop_index_thread Yes Yes Global
rocksdb_skip_bloom_filter_on_read Yes Yes Global, Session
rocksdb_skip_fill_cache Yes Yes Global, Session
rocksdb_sst_mgr_rate_bytes_per_sec Yes No Global
rocksdb_stats_dump_period_sec Yes No Global
rocksdb_store_row_debug_checksums Yes Yes Global, Session
rocksdb_strict_collation_check Yes Yes Global
rocksdb_strict_collation_exceptions Yes Yes Global
rocksdb_table_cache_numshardbits Yes No Global
rocksdb_table_stats_sampling_pct Yes Yes Global
rocksdb_tmpdir Yes Yes Global, Session
rocksdb_trace_sst_api Yes Yes Global, Session
rocksdb_unsafe_for_binlog Yes Yes Global, Session
rocksdb_update_cf_options Yes Yes Global
rocksdb_use_adaptive_mutex Yes No Global
rocksdb_use_direct_io_for_flush_and_compaction Yes No Global
rocksdb_use_direct_reads Yes No Global
rocksdb_use_fsync Yes No Global
rocksdb_validate_tables Yes No Global
rocksdb_verify_row_debug_checksums Yes Yes Global, Session
rocksdb_wal_bytes_per_sync Yes No Global
rocksdb_wal_dir Yes No Global
rocksdb_wal_recovery_mode Yes Yes Global
rocksdb_wal_size_limit_mb Yes No Global
rocksdb_wal_ttl_seconds Yes No Global
rocksdb_whole_key_filtering Yes No Global
rocksdb_write_disable_wal Yes Yes Global, Session
rocksdb_write_ignore_missing_column_families Yes Yes Global, Session
variable rocksdb_access_hint_on_compaction_start
Version Info:
Command Line:

--rocksdb-access-hint-on-compaction-start

Dynamic:

No

Scope:

Global

Variable Type:

String or Numeric

Default Value:

NORMAL or 1

Specifies the file access pattern once a compaction is started, applied to all input files of a compaction. Possible values are:

  • 0 = NONE
  • 1 = NORMAL (default)
  • 2 = SEQUENTIAL
  • 3 = WILLNEED
variable rocksdb_advise_random_on_open
Version Info:
Command Line:

--rocksdb-advise-random-on-open

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether to hint the underlying file system that the file access pattern is random, when a data file is opened. Enabled by default.

variable rocksdb_allow_concurrent_memtable_write
Version Info:
Command Line:

--rocksdb-allow-concurrent-memtable-write

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to allow multiple writers to update memtables in parallel. Disabled by default.

Note

Not all memtables support concurrent writes.

variable rocksdb_allow_mmap_reads
Version Info:
Command Line:

--rocksdb-allow-mmap-reads

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to allow the OS to map a data file into memory for reads. Disabled by default. If you enable this, make sure that rocksdb_use_direct_reads is disabled.

variable rocksdb_allow_mmap_writes
Version Info:
Command Line:

--rocksdb-allow-mmap-writes

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to allow the OS to map a data file into memory for writes. Disabled by default.

variable rocksdb_base_background_compactions
Version Info:
Command Line:

--rocksdb-base-background-compactions

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies the suggested number of concurrent background compaction jobs, submitted to the default LOW priority thread pool in RocksDB. Default is 1. Allowed range of values is from -1 to 64. Maximum depends on the rocksdb_max_background_compactions variable.

variable rocksdb_block_cache_size
Version Info:
Command Line:

--rocksdb-block-cache-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

536870912

Specifies the size of the LRU block cache for RocksDB. This memory is reserved for the block cache, which is in addition to any filesystem caching that may occur.

Minimum value is 1024, because that’s the size of one block.

Default value is 536870912.

Maximum value is 9223372036854775807.

variable rocksdb_block_restart_interval
Version Info:
Command Line:

--rocksdb-block-restart-interval

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

16

Specifies the number of keys for each set of delta encoded data. Default value is 16. Allowed range is from 1 to 2147483647.

variable rocksdb_block_size
Version Info:
Command Line:

--rocksdb-block-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

4096

Specifies the size of the data block for reading RocksDB data files. Default value is 4096. Allowed range is from 1 to 18446744073709551615.

variable rocksdb_block_size_deviation
Version Info:
Command Line:

--rocksdb-block-size-deviation

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

10

Specifies the threshold for free space allowed in a data block (see rocksdb_block_size). If there is less space remaining, close the block (and write to new block). Default value is 10, meaning that the block is not closed until there is less than 10 bits of free space remaining.

Allowed range is from 1 to 2147483647.

variable rocksdb_bulk_load
Version Info:
Command Line:

--rocksdb-bulk-load

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to use bulk load: MyRocks will ignore checking keys for uniqueness or acquiring locks during transactions. Disabled by default. Enable this only if you are certain that there are no row conflicts, for example, when setting up a new MyRocks instance from a MySQL dump.

Enabling this variable will also enable the rocksdb_commit_in_the_middle variable.

variable rocksdb_bulk_load_size
Version Info:
Command Line:

--rocksdb-bulk-load-size

Dynamic:

Yes

Scope:

Global. Session

Variable Type:

Numeric

Default Value:

1000

Specifies the number of keys to accumulate before committing them to the storage engine when bulk load is enabled (see rocksdb_bulk_load). Default value is 1000, which means that a batch can contain up to 1000 records before they are implicitly committed. Allowed range is from 1 to 1073741824.

variable rocksdb_bytes_per_sync
Version Info:
Command Line:

--rocksdb-bytes-per-sync

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies how often should the OS sync files to disk as they are being written, asynchronously, in the background. This operation can be used to smooth out write I/O over time. Default value is 0 meaning that files are never synced. Allowed range is up to 18446744073709551615.

variable rocksdb_cache_index_and_filter_blocks
Version Info:
Command Line:

--rocksdb-cache-index-and-filter-blocks

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether RocksDB should use the block cache for caching the index and bloomfilter data blocks from each data file. Enabled by default. If you disable this feature, RocksDB will allocate additional memory to maintain these data blocks.

variable rocksdb_checksums_pct
Version Info:
Command Line:

--rocksdb-checksums-pct

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

100

Specifies the percentage of rows to be checksummed. Default value is 100 (checksum all rows). Allowed range is from 0 to 100.

variable rocksdb_collect_sst_properties
Version Info:
Command Line:

--rocksdb-collect-sst-properties

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether to collect statistics on each data file to improve optimizer behavior. Enabled by default.

variable rocksdb_commit_in_the_middle
Version Info:
Command Line:

--rocksdb-commit-in-the-middle

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to commit rows implicitly when a batch contains more than the value of rocksdb_bulk_load_size. This is disabled by default and will be enabled if rocksdb_bulk_load is enabled.

variable rocksdb_compact_cf
Version Info:
Command Line:

--rocksdb-compact-cf

Dynamic:

Yes

Scope:

Global

Variable Type:

String

Default Value:

Specifies the name of the column family to compact.

variable rocksdb_compaction_readahead_size
Version Info:
Command Line:

--rocksdb-compaction-readahead-size

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the size of reads to perform ahead of compaction. Default value is 0. Set this to at least 2 megabytes (16777216) when using MyRocks with spinning disks to ensure sequential reads instead of random. Maximum allowed value is 18446744073709551615.

Note

If you set this variable to a non-zero value, new_table_reader_for_compaction_inputs is enabled.

variable rocksdb_compaction_sequential_deletes
Version Info:
Command Line:

--rocksdb-compaction-sequential-deletes

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the threshold to trigger compaction on a file if it has more than this number of sequential delete markers. Default value is 0 meaning that compaction is not triggered regardless of the number of delete markers. Maximum allowed value is 2000000 (two million delete markers).

Note

Depending on workload patterns, MyRocks can potentially maintain large numbers of delete markers, which increases latency of queries. This compaction feature will reduce latency, but may also increase the MyRocks write rate. Use this variable together with rocksdb_compaction_sequential_deletes_file_size to only perform compaction on large files.

variable rocksdb_compaction_sequential_deletes_count_sd
Version Info:
Command Line:

--rocksdb-compaction-sequential-deletes-count-sd

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to count single deletes as delete markers recognized by rocksdb_compaction_sequential_deletes. Disabled by default.

variable rocksdb_compaction_sequential_deletes_file_size
Version Info:
Command Line:

--rocksdb-compaction-sequential-deletes-file-size

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the minimum file size required to trigger compaction on it by rocksdb_compaction_sequential_deletes. Default value is 0, meaning that compaction is triggered regardless of file size. Allowed range is from -1 to 9223372036854775807.

variable rocksdb_compaction_sequential_deletes_window
Version Info:
Command Line:

--rocksdb-compaction-sequential-deletes-window

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the size of the window for counting delete markers by rocksdb_compaction_sequential_deletes. Default value is 0. Allowed range is up to 2000000 (two million).

variable rocksdb_create_checkpoint
Version Info:
Command Line:

--rocksdb-create-checkpoint

Dynamic:

Yes

Scope:

Global

Variable Type:

String

Default Value:

Specifies the directory where MyRocks should create a checkpoint. Empty by default.

variable rocksdb_create_if_missing
Version Info:
Command Line:

--rocksdb-create-if-missing

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether MyRocks should create its database if it does not exist. Enabled by default.

variable rocksdb_create_missing_column_families
Version Info:
Command Line:

--rocksdb-create-missing-column-families

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether MyRocks should create new column families if they do not exist. Disabled by default.

variable rocksdb_datadir
Version Info:
Command Line:

--rocksdb-datadir

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

./.rocksdb

Specifies the location of the MyRocks data directory. By default, it is created in the current working directory.

variable rocksdb_db_write_buffer_size
Version Info:
Command Line:

--rocksdb-db-write-buffer-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the size of the memtable used to store writes in MyRocks. This is the size per column family. When this size is reached, the memtable is flushed to persistent media. Default value is 0. Allowed range is up to 18446744073709551615.

variable rocksdb_deadlock_detect
Version Info:
Command Line:

--rocksdb-deadlock-detect

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether MyRocks should detect deadlocks. Disabled by default.

variable rocksdb_debug_optimizer_no_zero_cardinality
Version Info:
Command Line:

--rocksdb-debug-optimizer-no-zero-cardinality

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether MyRocks should prevent zero cardinality by always overriding it with some value.

variable rocksdb_default_cf_options
Version Info:
Command Line:

--rocksdb-default-cf-options

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

Specifies the default column family options for MyRocks. Empty by default.

variable rocksdb_delayed_write_rate
Version Info:
Command Line:

--rocksdb-delayed-write-rate

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

16777216

Specifies the write rate in bytes per second, which should be used if MyRocks hits a soft limit or threshold for writes. Default value is 16777216 (16 MB/sec). Allowed range is from 0 to 18446744073709551615.

variable rocksdb_delete_obsolete_files_period_micros
Version Info:
Command Line:

--rocksdb-delete-obsolete-files-period-micros

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

21600000000

Specifies the period in microseconds to delete obsolete files regardless of files removed during compaction. Default value is 21600000000 (6 hours). Allowed range is up to 9223372036854775807.

variable rocksdb_enable_bulk_load_api
Version Info:
Command Line:

--rocksdb-enable-bulk-load-api

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether to use the SSTFileWriter feature for bulk loading, This feature bypasses the memtable, but requires keys to be inserted into the table in either ascending or descending order. Enabled by default. If disabled, bulk loading uses the normal write path via the memtable and does not require keys to be inserted in any order.

variable rocksdb_enable_ttl
Version Info:
Command Line:

--rocksdb-enable-ttl

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether to keep expired TTL records during compaction. Enabled by default. If disabled, expired TTL records will be dropped during compaction.

variable rocksdb_enable_thread_tracking
Version Info:
Command Line:

--rocksdb-enable-thread-tracking

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to enable tracking the status of threads accessing the database. Disabled by default. If enabled, thread status will be available via GetThreadList().

variable rocksdb_enable_write_thread_adaptive_yield
Version Info:
Command Line:

--rocksdb-enable-write-thread-adaptive-yield

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether the MyRocks write batch group leader should wait up to the maximum allowed time before blocking on a mutex. Disabled by default. Enable it to increase throughput for concurrent workloads.

variable rocksdb_error_if_exists
Version Info:
Command Line:

--rocksdb-error-if-exists

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to report an error when a database already exists. Disabled by default.

variable rocksdb_flush_log_at_trx_commit
Version Info:
Command Line:

--rocksdb-flush-log-at-trx-commit

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

1

Specifies whether to sync on every transaction commit, similar to innodb_flush_log_at_trx_commit. Enabled by default, which ensures ACID compliance.

Possible values:

  • 0: Do not sync on transaction commit. This provides better performance, but may lead to data inconsistency in case of a crash.
  • 1: Sync on every transaction commit. This is set by default and recommended as it ensures data consistency, but reduces performance.
  • 2: Sync every second.
variable rocksdb_flush_memtable_on_analyze
Version Info:
Command Line:

--rocksdb-flush-memtable-on-analyze

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

ON

Specifies whether to flush the memtable when running ANALYZE on a table. Enabled by default. This ensures accurate cardinality by including data in the memtable for calculating stats.

variable rocksdb_force_compute_memtable_stats
Version Info:
Command Line:

--rocksdb-force-compute-memtable-stats

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether data in the memtables should be included for calculating index statistics used by the query optimizer. Enabled by default. This provides better accuracy, but may reduce performance.

variable rocksdb_force_flush_memtable_and_lzero_now
Version Info:
Command Line:

--rocksdb-force-flush-memtable-and-lzero-now

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Works similar to force_flush_memtable_now but also flushes all L0 files.

variable rocksdb_force_flush_memtable_now
Version Info:
Command Line:

--rocksdb-force-flush-memtable-now

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Forces MyRocks to immediately flush all memtables out to data files.

Warning

Use with caution! Write requests will be blocked until all memtables are flushed.

variable rocksdb_force_index_records_in_range
Version Info:
Command Line:

--rocksdb-force-index-records-in-range

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

1

Specifies the value used to override the number of rows returned to query optimizer when FORCE INDEX is used. Default value is 1. Allowed range is from 0 to 2147483647. Set to 0 if you do not want to override the returned value.

variable rocksdb_hash_index_allow_collision
Version Info:
Command Line:

--rocksdb-hash-index-allow-collision

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether hash collisions are allowed. Enabled by default, which uses less memory. If disabled, full prefix is stored to prevent hash collisions.

variable rocksdb_index_type
Version Info:
Command Line:

--rocksdb-index-type

Dynamic:

No

Scope:

Global

Variable Type:

Enum

Default Value:

kBinarySearch

Specifies the type of indexing used by MyRocks:

  • kBinarySearch: Binary search (default).
  • kHashSearch: Hash search.
variable rocksdb_info_log_level
Version Info:
Command Line:

--rocksdb-info-log-level

Dynamic:

Yes

Scope:

Global

Variable Type:

Enum

Default Value:

error_level

Specifies the level for filtering messages written by MyRocks to the mysqld log.

  • debug_level: Maximum logging (everything including debugging log messages)
  • info_level
  • warn_level
  • error_level (default)
  • fatal_level: Minimum logging (only fatal error messages logged)
variable rocksdb_is_fd_close_on_exec
Version Info:
Command Line:

--rocksdb-is-fd-close-on-exec

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether child processes should inherit open file jandles. Enabled by default.

variable rocksdb_keep_log_file_num
Version Info:
Command Line:

--rocksdb-keep-log-file-num

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

1000

Specifies the maximum number of info log files to keep. Default value is 1000. Allowed range is from 1 to 18446744073709551615.

variable rocksdb_lock_scanned_rows
Version Info:
Command Line:

--rocksdb-lock-scanned-rows

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to hold the lock on rows that are scanned during UPDATE and not actually updated. Disabled by default.

variable rocksdb_lock_wait_timeout
Version Info:
Command Line:

--rocksdb-lock-wait-timeout

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

1

Specifies the number of seconds MyRocks should wait to acquire a row lock before aborting the request. Default value is 1. Allowed range is up to 1073741824.

variable rocksdb_log_file_time_to_roll
Version Info:
Command Line:

--rocksdb-log-file-time-to-roll

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the period (in seconds) for rotating the info log files. Default value is 0, meaning that the log file is not rotated. Allowed range is up to 18446744073709551615.

variable rocksdb_manifest_preallocation_size
Version Info:
Command Line:

--rocksdb-manifest-preallocation-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the number of bytes to preallocate for the MANIFEST file used by MyRocks to store information about column families, levels, active files, etc. Default value is 0. Allowed range is up to 18446744073709551615.

Note

A value of 4194304 (4 MB) is reasonable to reduce random I/O on XFS.

variable rocksdb_max_background_compactions
Version Info:
Command Line:

--rocksdb-max-background-compactions

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies the maximum number of concurrent background compaction threads, submitted to the low-priority thread pool. Default value is 1. Allowed range is up to 64.

variable rocksdb_max_background_flushes
Version Info:
Command Line:

--rocksdb-max-background-flushes

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies the maximum number of concurrent background memtable flush threads, submitted to the high-priority thread-pool. Default value is 1. Allowed range is up to 64.

variable rocksdb_max_log_file_size
Version Info:
Command Line:

--rocksdb-max-log-file-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the maximum size for info log files, after which the log is rotated. Default value is 0, meaning that only one log file is used. Allowed range is up to 18446744073709551615.

Also see rocksdb_log_file_time_to_roll.

variable rocksdb_max_manifest_file_size
Version Info:
Command Line:

--rocksdb-manifest-log-file-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

18446744073709551615

Specifies the maximum size of the MANIFEST data file, after which it is rotated. Default value is also the maximum, making it practically unlimited: only one manifest file is used.

variable rocksdb_max_open_files
Version Info:
Command Line:

--rocksdb-max-open-files

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

4294967295

Specifies the maximum number of file handles opened by MyRocks. Default value is also the maximum, making it practically unlimited: all opened files remain open.

variable rocksdb_max_row_locks
Version Info:
Command Line:

--rocksdb-max-row-locks

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

1073741824

Specifies the limit on the maximum number of row locks a transaction can have before it fails. Default value is also the maximum, making it practically unlimited: transactions never fail due to row locks.

variable rocksdb_max_subcompactions
Version Info:
Command Line:

--rocksdb-max-subcompactions

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies the maximum number of threads allowed for each compaction job. Default value of 1 means no subcompactions (one thread per compaction job). Allowed range is up to 64.

variable rocksdb_max_total_wal_size
Version Info:
Command Line:

--rocksdb-max-total-wal-size

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the maximum total size of WAL (write-ahead log) files, after which memtables are flushed. Default value is 0: WAL size limit is chosen dynamically. Allowed range is up to 9223372036854775807.

variable rocksdb_merge_buf_size
Version Info:
Command Line:

--rocksdb-merge-buf-size

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

67108864

Specifies the size (in bytes) of the merge-sort buffers used to accumulate data during secondary key creation. New entries are written directly to the lowest level in the database, instead of updating indexes through the memtable and L0. These values are sorted using merge-sort, with buffers set to 64 MB by default (67108864). Allowed range is from 100 to 18446744073709551615.

variable rocksdb_merge_combine_read_size
Version Info:
Command Line:

--rocksdb-merge-combine-read-size

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

1073741824

Specifies the size (in bytes) of the merge-combine buffer used for the merge-sort algorithm as described in rocksdb_merge_buf_size. Default size is 1 GB (1073741824). Allowed range is from 100 to 18446744073709551615.

variable rocksdb_new_table_reader_for_compaction_inputs
Version Info:
Command Line:

--rocksdb-new-table-reader-for-compaction-inputs

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether MyRocks should create a new file descriptor and table reader for each compaction input. Disabled by default. Enabling this may increase memory consumption, but will also allow pre-fetch options to be specified for compaction input files without impacting table readers used for user queries.

variable rocksdb_no_block_cache
Version Info:
Command Line:

--rocksdb-no-block-cache

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to disable the block cache for column families. Variable is disabled by default, meaning that using the block cache is allowed.

variable rocksdb_override_cf_options
Version Info:
Command Line:

--rocksdb-override-cf-options

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

Specifies option overrides for each column family. Empty by default.

variable rocksdb_paranoid_checks
Version Info:
Command Line:

--rocksdb-paranoid-checks

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether MyRocks should re-read the data file as soon as it is created to verify correctness. Enabled by default.

variable rocksdb_pause_background_work
Version Info:
Command Line:

--rocksdb-pause-background-work

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether MyRocks should pause all background operations. Disabled by default.

variable rocksdb_perf_context_level
Version Info:
Command Line:

--rocksdb-perf-context-level

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

0

Specifies the level of information to capture with the Perf Context plugins. Default value is 0. Allowed range is up to 4.

variable rocksdb_persistent_cache_path
Version Info:
Command Line:

--rocksdb-persistent-cache-path

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

Specifies the path to the persistent cache. Set this together with rocksdb_persistent_cache_size_mb.

variable rocksdb_persistent_cache_size_mb
Version Info:
Command Line:

--rocksdb-persistent-cache-size-mb

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the size of the persisten cache in megabytes. Default is 0 (persistent cache disabled). Allowed range is up to 18446744073709551615. Set this together with rocksdb_persistent_cache_path.

variable rocksdb_pin_l0_filter_and_index_blocks_in_cache
Version Info:
Command Line:

--rocksdb-pin-l0-filter-and-index-blocks-in-cache

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether MyRocks pins the filter and index blocks in the cache if rocksdb_cache_index_and_filter_blocks is enabled. Enabled by default.

variable rocksdb_print_snapshot_conflict_queries
Version Info:
Command Line:

--rocksdb-print-snapshot-conflict-queries

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether queries that generate snapshot conflicts should be logged to the error log. Disabled by default.

variable rocksdb_rate_limiter_bytes_per_sec
Version Info:
Command Line:

--rocksdb-rate-limiter-bytes-per-sec

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the maximum rate at which MyRocks can write to media via memtable flushes and compaction. Default value is 0 (write rate is not limited). Allowed range is up to 9223372036854775807.

variable rocksdb_read_free_rpl_tables
Version Info:
Command Line:

--rocksdb-read-free-rpl-tables

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

String

Default Value:

Lists tables (as a regular expression) that should use read-free replication on the slave (that is, replication without row lookups). Empty by default.

variable rocksdb_records_in_range
Version Info:
Command Line:

--rocksdb-records-in-range

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

0

Specifies the value to overrride the result of records_in_range(). Default value is 0. Allowed range is up to 2147483647.

variable rocksdb_reset_stats
Version Info:
Command Line:

--rocksdb-reset-stats

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Resets MyRocks internal statistics dynamically (without restarting the server).

variable rocksdb_rpl_skip_tx_api
Version Info:
Command Line:

--rocksdb-rpl-skip-tx-api

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether write batches should be used for replication thread instead of the transaction API. Disabled by default.

variable rocksdb_seconds_between_stat_computes
Version Info:
Command Line:

--rocksdb-seconds-between-stat-computes

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

3600

Specifies the number of seconds to wait between recomputation of table statistics for the optimizer. During that time, only changed indexes are updated. Default value is 3600. Allowed is from 0 to 4294967295.

variable rocksdb_signal_drop_index_thread
Version Info:
Command Line:

--rocksdb-signal-drop-index-thread

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Signals the MyRocks drop index thread to wake up.

variable rocksdb_skip_bloom_filter_on_read
Version Info:
Command Line:

--rocksdb-skip-bloom-filter-on_read

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether bloom filters should be skipped on reads. Disabled by default (bloom filters are not skipped).

variable rocksdb_skip_fill_cache
Version Info:
Command Line:

--rocksdb-skip-fill-cache

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to skip caching data on read requests. Disabled by default (caching is not skipped).

variable rocksdb_sst_mgr_rate_bytes_per_sec
Version Info:
Command Line:

--rocksdb-sst-mgr-rate-bytes-per-sec

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Numeric

Default Value:

67108864

Specifies the maximum rate for writing to data files. Default value is 67108864 (64 MB/sec). Allowed range is from 0 to 18446744073709551615.

variable rocksdb_stats_dump_period_sec
Version Info:
Command Line:

--rocksdb-stats-dump-period-sec

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

600

Specifies the period in seconds for performing a dump of the MyRocks statistics to the info log. Default value is 600. Allowed range is up to 2147483647.

variable rocksdb_store_row_debug_checksums
Version Info:
Command Line:

--rocksdb-store-row-debug-checksums

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to include checksums when writing index or table records. Disabled by default.

variable rocksdb_strict_collation_check
Version Info:
Command Line:

--rocksdb-strict-collation-check

Dynamic:

Yes

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether to check and verify that table indexes have proper collation settings. Enabled by default.

variable rocksdb_strict_collation_exceptions
Version Info:
Command Line:

--rocksdb-strict-collation-exceptions

Dynamic:

Yes

Scope:

Global

Variable Type:

String

Default Value:

Lists tables (as a regular expression) that should be excluded from verifying case-sensitive collation enforced by rocksdb_strict_collation_check. Empty by default.

variable rocksdb_table_cache_numshardbits
Version Info:
Command Line:

--rocksdb-table-cache-numshardbits

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

6

Specifies the number if table caches. Default value is 6. Allowed range is from 0 to 2147483647.

variable rocksdb_table_stats_sampling_pct
Version Info:
Command Line:

--rocksdb-table-stats-sampling-pct

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

10

Specifies the percentage of entries to sample when collecting statistics about table properties. Default value is 10. Allowed range is from 0 to 100.

variable rocksdb_tmpdir
Version Info:
Command Line:

--rocksdb-tmpdir

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

String

Default Value:

Specifies the path to the directory for temporary files during DDL operations.

variable rocksdb_trace_sst_api
Version Info:
Command Line:

--rocksdb-trace-sst-api

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to generate trace output in the log for each call to SstFileWriter. Disabled by default.

variable rocksdb_unsafe_for_binlog
Version Info:
Command Line:

--rocksdb-unsafe-for-binlog

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to allow statement-based binary logging which may break consistency. Disabled by default.

variable rocksdb_update_cf_options
Version Info:
Command Line:

--rocksdb-update-cf-options

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

Specifies option updates for each column family. Empty by default.

variable rocksdb_use_adaptive_mutex
Version Info:
Command Line:

--rocksdb-use-adaptive-mutex

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to use adaptive mutex which spins in user space before resorting to the kernel. Disabled by default.

variable rocksdb_use_direct_io_for_flush_and_compaction
Version Info:
Command Line:

--rocksdb-use-direct-io-for-flush-and-compaction

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to write to data files directly, without caches or buffers. Disabled by default.

variable rocksdb_use_direct_reads
Version Info:
Command Line:

--rocksdb-use-direct-reads

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to read data files directly, without caches or buffers. Disabled by default. If you enable this, make sure that rocksdb_allow_mmap_reads is disabled.

variable rocksdb_use_fsync
Version Info:
Command Line:

--rocksdb-use-fsync

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

OFF

Specifies whether MyRocks should use fsync instead of fdatasync when requesting a sync of a data file. Disabled by default.

variable rocksdb_validate_tables
Version Info:
Command Line:

--rocksdb-validate-tables

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies whether to verify that MySQL .frm files match MyRocks tables.

  • 0: do not verify.
  • 1: verify and fail on error (default).
  • 2: verify and continue with error.
variable rocksdb_verify_row_debug_checksums
Version Info:
Command Line:

--rocksdb-verify-row-debug-checksums

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to verify checksums when reading index or table records. Disabled by default.

variable rocksdb_wal_bytes_per_sync
Version Info:
Command Line:

--rocksdb-wal-bytes-per-sync

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies how often should the OS sync WAL (write-ahead log) files to disk as they are being written, asynchronously, in the background. This operation can be used to smooth out write I/O over time. Default value is 0, meaning that files are never synced. Allowed range is up to 18446744073709551615.

variable rocksdb_wal_dir
Version Info:
Command Line:

--rocksdb-wal-dir

Dynamic:

No

Scope:

Global

Variable Type:

String

Default Value:

Specifies the path to the directory where MyRocks stores WAL files.

variable rocksdb_wal_recovery_mode
Version Info:
Command Line:

--rocksdb-wal-recovery-mode

Dynamic:

Yes

Scope:

Global

Variable Type:

Numeric

Default Value:

1

Specifies the level of tolerance when recovering WAL files after a system crash. Default is 1. Allowed range is from 0 to 3.

variable rocksdb_wal_size_limit_mb
Version Info:
Command Line:

--rocksdb-wal-size-limit-mb

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the maximum size of all WAL files in megabytes before attempting to flush memtables and delete the oldest files. Default value is 0 (never rotated). Allowed range is up to 9223372036854775807.

variable rocksdb_wal_ttl_seconds
Version Info:
Command Line:

--rocksdb-wal-ttl-seconds

Dynamic:

No

Scope:

Global

Variable Type:

Numeric

Default Value:

0

Specifies the timeout in seconds before deleting archived WAL files. Default is 0 (archived WAL files are never deleted). Allowed range is up to 9223372036854775807.

variable rocksdb_whole_key_filtering
Version Info:
Command Line:

--rocksdb-whole-key-filtering

Dynamic:

No

Scope:

Global

Variable Type:

Boolean

Default Value:

ON

Specifies whether the bloomfilter should use the whole key for filtering instead of just the prefix. Enabled by default. Make sure that lookups use the whole key for matching.

variable rocksdb_write_disable_wal
Version Info:
Command Line:

--rocksdb-write-disable-wal

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Lets you temporarily disable writes to WAL files, which can be useful for bulk loading.

variable rocksdb_write_ignore_missing_column_families
Version Info:
Command Line:

--rocksdb-write-ignore-missing-column-families

Dynamic:

Yes

Scope:

Global, Session

Variable Type:

Boolean

Default Value:

OFF

Specifies whether to ignore writes to column families that do not exist. Disabled by default (writes to non-existent column families are not ignored).

Visit Percona Store


General Inquiries

For general inquiries, please send us your question and someone will contact you.