You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/variables.md
+54-9Lines changed: 54 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -269,8 +269,18 @@ Enabled by default.
269
269
| Data type | Boolean |
270
270
| Default | OFF |
271
271
272
-
Specifies whether to allow multiple writers to update memtables in parallel.
273
-
Disabled by default.
272
+
#### Enable concurrent memtable writes
273
+
274
+
This option is a direct bridge to RocksDB's `DBOptions::allow_concurrent_memtable_write`. If this setting is not enabled, MyRocks processes memtable updates sequentially, even when multiple threads issue writes simultaneously. Enabling this option allows parallel memtable updates, which can improve write throughput in multi-threaded workloads.
275
+
276
+
#### When to enable
277
+
278
+
This setting is disabled by default. Consider enabling rocksdb_allow_concurrent_memtable_write in the following situations:
279
+
280
+
| Condition | Description |
281
+
|----------------------------|-------------|
282
+
| High concurrent write workload | Your application has many threads or clients writing to MyRocks at the same time. Enabling this option can improve throughput and reduce latency in multi-threaded environments. |
283
+
| Write-bound workloads | If write performance is a bottleneck and CPU usage is low during writes, it may be due to serialized memtable updates. Enabling this option allows better use of CPU cores and can improve overall write performance. |
274
284
275
285
### `rocksdb_allow_to_start_after_corruption`
276
286
@@ -1092,11 +1102,27 @@ By default, it is created in the current working directory.
1092
1102
| Data type | Numeric |
1093
1103
| Default | 0 |
1094
1104
1095
-
Specifies the maximum size of all memtables used to store writes in MyRocks
1096
-
across all column families. When this size is reached, the data is flushed
1097
-
to persistent media.
1098
-
The default value is `0`.
1099
-
The allowed range is up to `18446744073709551615`.
1105
+
This option is a direct bridge to RocksDB's `DBOptions::db_write_buffer_size`.
1106
+
1107
+
The `rocksdb_db_write_buffer_size` setting limits the amount of memory in memtables across all column families. MyRocks flushes the largest memtable to disk when the total size exceeds this limit. This operation helps prevent excessive memory use and makes memory behavior more predictable.
1108
+
1109
+
#### Available values
1110
+
1111
+
The default value is `0`, which is disabled, and MyRocks does not limit the amount of memory used by memtables.
1112
+
1113
+
Setting a non-zero value provides a safeguard against excessive memory usage. It ensures that the total memory used by memtables does not exceed the specified limit, preventing potential memory overflow issues.
1114
+
1115
+
The maximum range is `18446744073709551615`.
1116
+
1117
+
#### When to use
1118
+
1119
+
This setting is disabled by default. You should consider setting rocksdb_db_write_buffer_size under the following conditions:
1120
+
1121
+
• Running multiple column families and controlling overall memory usage.
1122
+
1123
+
• Operating in shared environments or low-memory systems.
1124
+
1125
+
• Avoiding Out-of-Memory (OOM) issues in write-heavy workloads.
1100
1126
1101
1127
### `rocksdb_deadlock_detect`
1102
1128
@@ -1488,11 +1514,30 @@ The variable was implemented in [Percona Server for MySQL 8.0.20-11](release-not
1488
1514
| Data type | Boolean |
1489
1515
| Default | OFF |
1490
1516
1517
+
#### Version changes
1518
+
1491
1519
The variable was implemented in [Percona Server for MySQL 8.0.25-15](release-notes/Percona-Server-8.0.25-15.md#id1).
1492
1520
1493
-
DBOptions::enable_pipelined_write for RocksDB.
1521
+
#### Improving Write Throughput with Pipelined Writes
1522
+
1523
+
This option maps directly to RocksDB’s `DBOptions::enable_pipelined_write`. For details, see the [RocksDB documentation on Pipelined Write](https://github.com/facebook/rocksdb/wiki/Pipelined-Write).
1524
+
1525
+
In database systems, concurrency means that multiple operations can run simultaneously. By default, write operations are handled in order using a single thread queue. The first thread in line becomes the leader and performs the write to both the Write-Ahead Log (WAL) and the memtable, one after the other. This setup limits the number of writes that can happen simultaneously.
1526
+
1527
+
The pipelined write feature allows WAL and memtable writes to happen in parallel. When `rocksdb_enable_pipelined_write` is set to `ON`, RocksDB uses separate threads for writing to the Write-Ahead Log (WAL) and the memtable. A thread waits in the WAL queue and then moves to the memtable queue. In the WAL queue, each thread waits only for earlier WAL writes to finish. They do not wait for memtable updates.
1528
+
1529
+
This setup allows WAL and memtable operations to run in parallel. It improves write throughput and can reduce latency during the prepare phase of a two phase commit.
1530
+
1531
+
#### When to enable pipelined writes
1532
+
1533
+
Pipelined writes are disabled by default. You should consider enabling enable_pipelined_write in MyRocks under the following conditions:
1494
1534
1495
-
If `enable_pipelined_write` is `ON`, a separate write thread is maintained for WAL write and memtable write. A write thread first enters the WAL writer queue and then the memtable writer queue. A pending thread on the WAL writer queue only waits for the previous WAL write operations but does not wait for memtable write operations. Enabling the feature may improve write throughput and reduce latency of the prepare phase of a two-phase commit.
| High concurrent write workloads | If your application involves many concurrent writers, pipelined writes, which overlap WAL and memtable writes, can improve throughput. |
1538
+
| Write-Ahead logging (WAL) is enabled | This feature only applies when WAL is enabled. Enabling pipelined writes has no effect if you’re not using WAL. |
1539
+
| Lower latency for transactions | Particularly beneficial in reducing latency during the prepare phase of two-phase commits (2PC), which is critical in transactional workloads. |
1540
+
| WAL writes are a bottleneck | If profiling shows that waiting for WAL writes limits your write throughput, pipelined writes can help by decoupling WAL and memtable operations. |
0 commit comments