Skip to content

Commit d614367

Browse files
authored
Merge pull request #517 from percona/ps-9822
PS-9822 Improve documentation on MyRocks variables (8.0)
2 parents 421782a + 5041b71 commit d614367

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

docs/variables.md

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,18 @@ Enabled by default.
270270
| Data type | Boolean |
271271
| Default | OFF |
272272

273-
Specifies whether to allow multiple writers to update memtables in parallel.
274-
Disabled by default.
273+
#### Enable concurrent memtable writes
274+
275+
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.
276+
277+
#### When to enable
278+
279+
This setting is disabled by default. Consider enabling rocksdb_allow_concurrent_memtable_write in the following situations:
280+
281+
| Condition | Description |
282+
|----------------------------|-------------|
283+
| 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. |
284+
| 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. |
275285

276286
### `rocksdb_allow_to_start_after_corruption`
277287

@@ -1112,11 +1122,27 @@ By default, it is created in the current working directory.
11121122
| Data type | Numeric |
11131123
| Default | 0 |
11141124

1115-
Specifies the maximum size of all memtables used to store writes in MyRocks
1116-
across all column families. When this size is reached, the data is flushed
1117-
to persistent media.
1118-
The default value is `0`.
1119-
The allowed range is up to `18446744073709551615`.
1125+
This option is a direct bridge to RocksDB's `DBOptions::db_write_buffer_size`.
1126+
1127+
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.
1128+
1129+
#### Available values
1130+
1131+
The default value is `0`, which is disabled, and MyRocks does not limit the amount of memory used by memtables.
1132+
1133+
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.
1134+
1135+
The maximum range is `18446744073709551615`.
1136+
1137+
#### When to use
1138+
1139+
This setting is disabled by default. You should consider setting rocksdb_db_write_buffer_size under the following conditions:
1140+
1141+
• Running multiple column families and controlling overall memory usage.
1142+
1143+
• Operating in shared environments or low-memory systems.
1144+
1145+
• Avoiding Out-of-Memory (OOM) issues in write-heavy workloads.
11201146

11211147
### `rocksdb_deadlock_detect`
11221148

@@ -1508,11 +1534,36 @@ The variable was implemented in [Percona Server for MySQL 8.0.20-11](release-not
15081534
| Data type | Boolean |
15091535
| Default | OFF |
15101536

1511-
The variable was implemented in [Percona Server for MySQL 8.0.25-15](release-notes/Percona-Server-8.0.25-15.md).
1537+
#### Version changes
1538+
1539+
The variable was implemented in [Percona Server for MySQL 8.0.25-15](release-notes/Percona-Server-8.0.25-15.md#id1).
1540+
1541+
#### Improving Write Throughput with Pipelined Writes
1542+
1543+
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).
1544+
1545+
1546+
The pipelined write feature in RocksDB is specifically designed to enhance concurrent write throughput, but this feature only functions when the Write-Ahead Log (WAL) is enabled. Write operations normally pass through a shared queue. Each writer appends to the WAL and then updates the memtable in strict sequence. This pattern limits parallelism.
1547+
1548+
With pipelined writes, RocksDB overlaps the WAL and memtable stages across
1549+
writers. As soon as one thread completes its WAL write, the next thread in
1550+
line can begin its own WAL operation—even if the previous thread has not yet
1551+
updated the memtable. This change interleaves write stages, reduces latency,
1552+
and improves overall write throughput.
1553+
1554+
Enabling `rocksdb_enable_pipelined_write` activates this feature. The feature is beneficial with workloads with multiple concurrent writers and in scenarios such as the prepare phase of a two-phase commit.
1555+
1556+
1557+
#### When to enable pipelined writes
15121558

1513-
DBOptions::enable_pipelined_write for RocksDB.
1559+
Pipelined writes are disabled by default. You should consider enabling enable_pipelined_write in MyRocks under the following conditions:
15141560

1515-
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.
1561+
| Condition | Description |
1562+
|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
1563+
| High concurrent write workloads | If your application involves many concurrent writers, pipelined writes, which overlap WAL and memtable writes, can improve throughput. |
1564+
| 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. |
1565+
| Lower latency for transactions | Particularly beneficial in reducing latency during the prepare phase of two-phase commits (2PC), which is critical in transactional workloads. |
1566+
| 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. |
15161567

15171568
### `rocksdb_enable_remove_orphaned_dropped_cfs`
15181569

0 commit comments

Comments
 (0)