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.
-
variable
rocksdb_access_hint_on_compaction_start
¶ Version Info: - 5.7.19-17 – Implemented
Command Line: --rocksdb-access-hint-on-compaction-start
Dynamic: No
Scope: Global
Variable Type: String or Numeric
Default Value: NORMAL
or1
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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.
-
variable
rocksdb_allow_to_start_after_corruption
¶ Version Info: - 5.7.21-20 – Implemented
Command Line: --rocksdb_allow_to_start_after_corruption
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: OFF
Specifies whether to allow server to restart once MyRocks reported data corruption. Disabled by default.
Once corruption is detected server writes marker file (named ROCKSDB_CORRUPTED) in the data directory and aborts. If marker file exists, then mysqld exits on startup with an error message. The restart failure will continue until the problem is solved or until mysqld is started with this variable turned on in the command line.
Note
Not all memtables support concurrent writes.
-
variable
rocksdb_allow_mmap_reads
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
- 5.7.20-18 – Replaced by
rocksdb_max_background_jobs
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. This variable has been replaced in Percona Server for MySQL 5.7.20-18
by rocksdb_max_background_jobs
, which automatically decides how
many threads to allocate towards flush/compaction.
-
variable
rocksdb_blind_delete_primary_key
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-blind-delete-primary-key
Dynamic: Yes
Scope: Global, Session
Variable Type: Boolean
Default Value: OFF
Skips verifying if rows exists before executing deletes. The following conditions must be met:
- The variable is enabled
- Only a single table listed in the
DELETE
statement - The table has only a primary key with no secondary keys
-
variable
rocksdb_block_cache_size
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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 1024
to 18446744073709551615
.
-
variable
rocksdb_block_size_deviation
¶ Version Info: - 5.7.19-17 – Implemented
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_allow_sk
¶ Version Info: - 5.7.23-23 – Implemented
Command Line: --rocksdb-bulk-load-allow-sk
Dynamic: Yes
Scope: Global, Session
Variable Type: Boolean
Default Value: OFF
Enabling this variable allows secondary keys to be added using the bulk loading
feature. This variable can be toggled only when bulk load is disabled, i.e.
when rocksdb_bulk_load
is OFF
.
-
variable
rocksdb_bulk_load_allow_unsorted
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-bulk-load-allow-unsorted
Dynamic: Yes
Scope: Global, Session
Variable Type: Boolean
Default Value: OFF
By default, the bulk loader requires its input to be sorted in the primary key order. If enabled, unsorted inputs are allowed too, which are then sorted by the bulkloader itself, at a performance penalty.
-
variable
rocksdb_bulk_load
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: Yes
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_dump
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: -rocksdb-cache-dump
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
Includes RocksDB block cache content in core dump. This variable is enabled by default.
-
variable
rocksdb_cache_index_and_filter_blocks
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_commit_time_batch_for_recovery
¶ Version Info: - 5.7.23-23 – Implemented
Command Line: --rocksdb-commit-time-batch-for-recovery
Dynamic: Yes
Scope: Global, Session
Variable Type: Boolean
Default Value: OFF
Specifies whether to write the commit time write batch into the database or not.
Note
If the commit time write batch is only useful for recovery, then writing to WAL is enough.
-
variable
rocksdb_compact_cf
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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,
rocksdb_new_table_reader_for_compaction_inputs
is enabled.
-
variable
rocksdb_compaction_sequential_deletes
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_concurrent_prepare
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-concurrent_prepare
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
When enabled this variable allows/encourages threads that are using
two-phase commit to prepare
in parallel. Variable has been
deprecated in the Percona Server for MySQL 5.7.21-20, as it has been
renamed in upstream to rocksdb_two_write_queues
.
-
variable
rocksdb_create_checkpoint
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
Command Line: --rocksdb-db-write-buffer-size
Dynamic: No
Scope: Global
Variable Type: Numeric
Default Value: 0
Specifies the maximum size of all memtables used to store writes in MyRocks
across all column families. When this size is reached, the data is flushed
to persistent media.
The default value is 0
.
The allowed range is up to 18446744073709551615
.
-
variable
rocksdb_deadlock_detect
¶ Version Info: - 5.7.19-17 – Implemented
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_deadlock_detect_depth
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-deadlock-detect-depth
Dynamic: Yes
Scope: Global, Session
Variable Type: Numeric
Default Value: 50
Specifies the number of transactions deadlock detection will traverse through before assuming deadlock.
-
variable
rocksdb_debug_optimizer_no_zero_cardinality
¶ Version Info: - 5.7.19-17 – Implemented
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_debug_ttl_ignore_pk
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-debug-ttl-ignore-pk
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: OFF
For debugging purposes only. If true, compaction filtering will not occur on Primary Key TTL data. This variable is a no-op in non-debug builds.
-
variable
rocksdb_debug_ttl_read_filter_ts
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb_debug-ttl-read-filter-ts
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 0
For debugging purposes only. Overrides the TTL read
filtering time to time + debug_ttl_read_filter_ts
.
A value of 0
denotes that the variable is not set.
This variable is a no-op in non-debug builds.
-
variable
rocksdb_debug_ttl_rec_ts
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-debug-ttl-rec-ts
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 0
For debugging purposes only. Overrides the TTL of
records to now()
+ debug_ttl_rec_ts
.
The value can be +/- to simulate a record inserted in the past vs a record
inserted in the “future”. A value of 0
denotes that the
variable is not set.
This variable is a no-op in non-debug builds.
-
variable
rocksdb_debug_ttl_snapshot_ts
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb_debug_ttl_ignore_pk
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 0
For debugging purposes only. Sets the snapshot during
compaction to now()
+ rocksdb_debug_set_ttl_snapshot_ts
.
The value can be +/- to simulate a snapshot in the past vs a
snapshot created in the “future”. A value of 0
denotes
that the variable is not set. This variable is a no-op in
non-debug builds.
-
variable
rocksdb_default_cf_options
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_cf
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-delete-cf
Dynamic: Yes
Scope: Global
Variable Type: String
Default Value: “”
Deletes the column family by name. The default value is “”, an empty string.
For example:
SET @@global.ROCKSDB_DELETE_CF = 'cf_primary_key';
-
variable
rocksdb_delete_obsolete_files_period_micros
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_insert_with_update_caching
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-enable-insert-with-update-caching
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: ON
Specifies whether to enable optimization where the read is cached from a failed insertion attempt in INSERT ON DUPLICATE KEY UPDATE.. variable:: rocksdb_enable_iterate_bounds
-
variable
rocksdb_enable_iterate_bounds
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-enable-iterate-bounds
Dynamic: Yes
Scope: Global, Local
Variable Type: Boolean
Default Value: TRUE
Enables the rocksdb iterator upper bounds and lower bounds in read options.
The default value is TRUE
.
-
variable
rocksdb_enable_remove_orphaned_dropped_cfs
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-enable-remove-orphaned-dropped-cfs
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: TRUE
Enables the removal of dropped column families (cfs) from metadata if the cfs do not exist in the cf manager.
The default value is TRUE
.
-
variable
rocksdb_enable_ttl
¶ Version Info: - 5.7.19-17 – Implemented
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_ttl_read_filtering
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-enable-ttl-read-filtering
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: ON
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.
-
variable
rocksdb_enable_thread_tracking
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_error_on_suboptimal_collation
¶ Version Info: - 5.7.23-23 – Implemented
Command Line: --rocksdb-error-on-suboptimal-collation
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
Specifies whether to report an error instead of a warning if an index is created on a char field where the table has a sub-optimal collation (case insensitive). Enabled by default.
-
variable
rocksdb_flush_log_at_trx_commit
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_compute_memtable_stats_cachetime
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-force-compute-memtable-stats-cachetime
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 60000000
Specifies for how long the cached value of memtable statistics should be used instead of computing it every time during the query plan analysis.
-
variable
rocksdb_force_flush_memtable_and_lzero_now
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_ignore_unknown_options
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-ignore-unknown-options
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
When enabled, it allows RocksDB to receive unknown options and not exit.
-
variable
rocksdb_index_type
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_large_prefix
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-large-prefix
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: OFF
When enabled, this option allows index key prefixes longer than 767 bytes
(up to 3072 bytes). This option mirrors the innodb_large_prefix
The values for rocksdb_large_prefix
should be the same between
source and replica.
-
variable
rocksdb_keep_log_file_num
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_manual_wal_flush
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-manual-wal-flush
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
This variable can be used to disable automatic/timed WAL flushing and instead rely on the application to do the flushing.
-
variable
rocksdb_master_skip_tx_api
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-master-skip-tx-api
Dynamic: Yes
Scope: Global, Session
Variable Type: Boolean
Default Value: OFF
When enabled, uses the WriteBatch API, which is faster. The session does not hold any lock on row access. This variable is not effective on replica.
Note
Due to the disabled row locks, improper use of the variable can cause data corruption or inconsistency.
-
variable
rocksdb_max_background_compactions
¶ Version Info: - 5.7.19-17 – Implemented
- 5.7.20-18 – Replaced by
rocksdb_max_background_jobs
- 5.7.31-34 – Re-implemented
Command Line: --rocksdb-max-background-compactions
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: -1
Sets DBOptions:: max_background_compactions for RocksDB.
Default value is -1
. Allowed range is up to 64
.
This variable has been replaced in Percona Server for MySQL 5.7.20-18
by rocksdb_max_background_jobs
, which automatically decides how
many threads to allocate towards flush/compaction.
This variable has been re-implemented in Percona Server for MySQL 5.7.31-34.
-
variable
rocksdb_max_background_flushes
¶ Version Info: - 5.7.19-17 – Implemented
- 5.7.20-18 – Replaced by
rocksdb_max_background_jobs
- 5.7.31-34 – Re-implemented
Command Line: --rocksdb-max-background-flushes
Dynamic: No
Scope: Global
Variable Type: Numeric
Default Value: -1
Sets DBOptions:: max_background_flushes for RocksDB.
Default value is -1
. Allowed range is up to 64
.
This variable has been replaced in Percona Server for MySQL 5.7.20-18
by rocksdb_max_background_jobs
, which automatically decides how
many threads to allocate towards flush/compaction.
This variable has been re-implemented in Percona Server for MySQL 5.7.31-34.
-
variable
rocksdb_max_background_jobs
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-max-background-jobs
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 2
This variable has been introduced in Percona Server for MySQL 5.7.20-18
to replace rocksdb_base_background_compactions
,
rocksdb_max_background_compactions
, and
rocksdb_max_background_flushes
variables. This variable specifies
the maximum number of background jobs. It automatically decides
how many threads to allocate towards flush/compaction. It was implemented to
reduce the number of (confusing) options users and can tweak and push the
responsibility down to RocksDB level.
-
variable
rocksdb_max_bottom_pri_background_compactions
¶ Version: 5.7.31-34: Implemented Command Line: --rocksdb_max_bottom_pri_background_compactions
Dynamic: No Variable Type: Unsigned Integer Default Value: 0
Creates a specified number of threads, sets a lower CPU priority, and letting compactions use them. The maximum compaction concurrency is capped by rocksdb_max_background_compactions
or rocksdb_max_background_jobs
The minimum value is 0
and the maximum value is 64
.
-
variable
rocksdb_max_latest_deadlocks
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-max-latest-deadlocks
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 5
Specifies the maximum number of recent deadlocks to store.
-
variable
rocksdb_max_log_file_size
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: 1000
Specifies the maximum number of file handles opened by MyRocks.
Values in the range between 0
and open_files_limit
are taken as they are. If rocksdb_max_open_files
value is
greater than open_files_limit
, it will be reset to 1/2 of
open_files_limit
, and a warning will be emitted to the mysqld
error log. A value of -2
denotes auto tuning: just sets
rocksdb_max_open_files
value to 1/2 of open_files_limit
.
Finally, -1
means no limit, i.e. an infinite number of file handles.
Warning
Setting rocksdb_max_open_files
to -1
is dangerous,
as server may quickly run out of file handles in this case.
-
variable
rocksdb_max_row_locks
¶ Version Info: Command Line: --rocksdb-max-row-locks
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 1048576
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_merge_tmp_file_removal_delay_ms
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb_merge_tmp_file_removal_delay_ms
Dynamic: Yes
Scope: Global, Session
Variable Type: Numeric
Default Value: 0
Fast secondary index creation creates merge files when needed. After finishing secondary index creation, merge files are removed. By default, the file removal is done without any sleep, so removing GBs of merge files within <1s may happen, which will cause trim stalls on Flash. This variable can be used to rate limit the delay in milliseconds.
-
variable
rocksdb_new_table_reader_for_compaction_inputs
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_no_create_column_family
¶ Version Info: - 5.7.23-24 – Implemented
Command Line: --rocksdb-no-create-column-family
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: OFF
Specifies whether column families can created implicitly via an index comment.
If this variable is set to ON
, then column families must already exist or
must be present within the rocksdb_override_cf_options
for a user to
assign and index to a column family.
-
variable
rocksdb_override_cf_options
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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. There is no practical reason for a user to ever use this variable because it is intended as a test synchronization tool for the MyRocks MTR test suites.
Warning
If someone were to set a rocksdb_force_flush_memtable_now
to
1
while rocksdb_pause_background_work
is set to 1
,
the client that issued the rocksdb_force_flush_memtable_now=1
will be
blocked indefinitely until rocksdb_pause_background_work
is set to 0
.
-
variable
rocksdb_perf_context_level
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-read-free-rpl
Dynamic: Yes
Scope: Global
Variable Type: Enum
Default Value: OFF
Use read-free replication, which allows no row lookup during replication, on the replica.
The options are the following:
- OFF - Disables the variable
- PK_SK - Enables the variable on all tables with a primary key
- PK_ONLY - Enables the variable on tables where the only key is the primary key
-
variable
rocksdb_read_free_rpl_tables
¶ Version Info: - 5.7.30-33 – Disabled
- 5.7.19-17 – Implemented
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 replica (that is, replication without row lookups). Empty by default.
This variable is disabled in Percona Server for MySQL 5.7.30-33. We recommend
that you use rocksdb_read_free_rpl
instead of this variable.
-
variable
rocksdb_records_in_range
¶ Version Info: - 5.7.19-17 – Implemented
Command Line: --rocksdb-records-in-range
Dynamic: Yes
Scope: Global, Session
Variable Type: Numeric
Default Value: 0
Specifies the value to override the result of records_in_range()
.
Default value is 0
.
Allowed range is up to 2147483647
.
-
variable
rocksdb_reset_stats
¶ Version Info: - 5.7.19-17 – Implemented
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_rollback_on_timeout
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-rollback-on-timeout
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: OFF
By default, only the last statement on a transaction is rolled back. If
--rocksdb-rollback-on-timeout=ON
, a transaction timeout causes a rollback of
the entire transaction.
-
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.
There are two conditions which are necessary to use it: row replication format and replica operating in super read only mode.
-
variable
rocksdb_seconds_between_stat_computes
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_sim_cache_size
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-sim-cache-size
Dynamic: No
Scope: Global
Variable Type: Numeric
Default Value: 0
Enables the simulated cache, which allows us to figure out the hit/miss rate with a specific cache size without changing the real block cache.
-
variable
rocksdb_skip_bloom_filter_on_read
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: 0
Specifies the maximum rate for writing to data files.
Default value is 0
. This option is not effective on HDD.
Allowed range is from 0
to 18446744073709551615
.
-
variable
rocksdb_stats_dump_period_sec
¶ Version Info: - 5.7.19-17 – Implemented
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_stats_level
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-stats-level
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 0
- Controls the RocksDB statistics level. The default value is “0” (kExceptHistogramOrTimers),
- which is the fastest level. The maximum value is “4”.
-
variable
rocksdb_stats_recalc_rate
¶ Version Info: - 5.7.23-23 – Implemented
Command Line: --rocksdb-stats-recalc-rate
Dynamic: No
Scope: Global
Variable Type: Numeric
Default Value: 0
Specifies the number of indexes to recalculate per second. Recalculating index
statistics periodically ensures it to match the actual sum from SST files.
Default value is 0
. Allowed range is up to 4294967295
.
-
variable
rocksdb_store_row_debug_checksums
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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 19
.
-
variable
rocksdb_table_stats_background_thread_nice_value
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-table-stats-background-thread-nice-value
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 19
The nice value for index stats. The minimum = -20 (THREAD_PRIO_MIN) The maximum = 19 (THREAD_PRIO_MAX)
-
variable
rocksdb_table_stats_max_num_rows_scanned
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-table-stats-max-num-rows-scanned
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 0
The maximum number of rows to scan in a table scan based on
a cardinality calculation.
The minimum is 0
(every modification triggers a stats recalculation).
The maximum is 18,446,744,073,709,551,615
.
-
variable
rocksdb_table_stats_recalc_threshold_count
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-table-stats-recalc-threshold-count
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 100
The number of modified rows to trigger a stats recalculation. This is a
dependent variable for stats recalculation.
The minimum is 0
.
The maximum is 18,446,744,073,709,551,615
.
-
variable
rocksdb_table_stats_recalc_threshold_pct
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-table-stats-recalc-threshold-pct
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 10
The percentage of the number of modified rows over the total number of rows
to trigger stats recalculations. This is a dependent variable for stats
recalculation.
The minimum value is 0
The maximum value is 100
(RDB_TBL_STATS_RECALC_THRESHOLD_PCT_MAX).
-
variable
rocksdb_table_stats_sampling_pct
¶ Version Info: - 5.7.19-17 – Implemented
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_table_stats_use_table_scan
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-table-stats-use-table-scan
Dynamic: Yes
Scope: Global
Variable Type: Boolean
Default Value: FALSE
Enables table-scan-based index calculations.
The default value is FALSE
.
-
variable
rocksdb_tmpdir
¶ Version Info: - 5.7.19-17 – Implemented
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_block_cache_access
¶ Version Info: - 5.7.30-33 – Implemented
Command Line: --rocksdb-trace-block-cache-access
Dynamic: Yes
Scope: Global
Variable Type: String
Default Value: ""
Defines the block cache trace option string. The format is
“sampling frequency: max_trace_file_size:trace_file_name.” The
sampling frequency value and max_trace_file_size value
are positive integers. The block accesses are saved to
the rocksdb_datadir/block_cache_traces/trace_file_name
.
The default value is ""
, an empty string.
-
variable
rocksdb_trace_sst_api
¶ Version Info: - 5.7.19-17 – Implemented
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_two_write_queues
¶ Version Info: - 5.7.21-20 – Implemented
Command Line: --rocksdb-two_write_queues
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: ON
When enabled this variable allows/encourages threads that are using
two-phase commit to prepare
in parallel.
-
variable
rocksdb_unsafe_for_binlog
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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_default_sk_cf
¶ Version Info: - 5.7.32-35 – Implemented
Command Line: --rocksdb-use-default-sk-cf
Dynamic: No
Scope: Global
Variable Type: Boolean
Default Value: OFF
Use default_sk
column family for secondary keys.
-
variable
rocksdb_use_direct_io_for_flush_and_compaction
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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: Yes
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: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
Command Line: --rocksdb-wal-recovery-mode
Dynamic: Yes
Scope: Global
Variable Type: Numeric
Default Value: 2
Note
In version 5.7.31-34 and later, the default is changed from 1
to 2
.
Specifies the level of tolerance when recovering write-ahead logs (WAL) files after a system crash.
The following are the options:
0
: if the last WAL entry is corrupted, truncate the entry and either start the server normally or refuse to start.1
: if a WAL entry is corrupted, the server fails to start and does not recover from the crash.2
(default): if a corrupted WAL entry is detected, truncate all entries after the detected corrupted entry. You can select this setting for replication replicas.3
: If a corrupted WAL entry is detected, skip only the corrupted entry and continue the apply WAL entries. This option can be dangerous.
-
variable
rocksdb_wal_size_limit_mb
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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
(WAL files are not archived).
Allowed range is up to 9223372036854775807
.
-
variable
rocksdb_whole_key_filtering
¶ Version Info: - 5.7.19-17 – Implemented
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_batch_max_bytes
¶ Version Info: - 5.7.20-18 – Implemented
Command Line: --rocksdb-write-batch-max-bytes
Dynamic: Yes
Scope: Global, Session
Variable Type: Numeric
Default Value: 0
Specifies the maximum size of a RocksDB write batch in bytes. 0
means no
limit. In case user exceeds the limit following error will be shown:
ERROR HY000: Status error 10 received from RocksDB: Operation aborted: Memory
limit reached
.
-
variable
rocksdb_write_disable_wal
¶ Version Info: - 5.7.19-17 – Implemented
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: - 5.7.19-17 – Implemented
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).
-
variable
rocksdb_write_policy
¶ Version Info: - 5.7.23-23 – Implemented
Command Line: --rocksdb-write-policy
Dynamic: No
Scope: Global
Variable Type: String
Default Value: write_committed
Specifies when two-phase commit data are actually written into the database.
Allowed values are write_committed
, write_prepared
, and
write_unprepared
.
Default value is write_committed
which means data are written at commit
time. If the value is set to write_prepared
, then data are written after
the prepare phase of a two-phase transaction. If the value is set to
write_unprepared
, then data are written before the prepare phase.
Contact Us
For free technical help, visit the Percona Community Forum.To report bugs or submit feature requests, open a JIRA ticket.
For paid support and managed or professional services, contact Percona Sales.