Configure memtable thresholds
DataStax Enterprise (DSE) flushes memtable data to disk in the following situations:
-
When the memtable flush threshold is met based on
memtable_cleanup_threshold. -
When commit logs are full based on
commitlog_total_space_in_mb. -
On shutdown.
-
When you run
nodetool flushornodetool drain. -
(Not recommended) On a fixed schedule set by the
memtable_flush_period_in_mstable property.
Configuring memtable flush thresholds can improve database performance. The following conditions indicate that memtable parameters might need tuning:
-
Frequent memtable flushes impacting performance.
-
Commit log space being exhausted frequently.
-
Compaction unable to keep up with memtable flushes.
Memtable and commit log parameters in cassandra.yaml
The memtable and commit log parameters in cassandra.yaml apply to the entire node.
The way you tune these parameters depends on your workloads and performance targets.
For example, higher thresholds often improve performance for small datasets with high write loads and datasets with a continuous level of write activity.
|
Allocating more memory to memtables reduces the available memory for caching and other internal database structures. Tune allocations incrementally and monitor node performance between changes. |
For information about the available parameters, see the following:
Memtable table properties (not recommended)
You can set table properties when you create (CREATE TABLE) or alter (ALTER TABLE) a table.
The memtable_flush_period_in_ms table property sets a fixed cadence for a table’s memtable flushes.
The default is 0 (disabled).
DataStax recommends leaving this disabled except for edge cases where specific tables require a fixed memtable flush cadence. For example, a table that is rarely modified doesn’t need to retain commit logs on disk for the extended amount of time that could elapse between naturally triggered flushes.
DataStax recommends tuning memtable and commit log parameters in cassandra.yaml before setting this property on a table.