diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 00b070c0e..51020831c 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -568,8 +568,18 @@ struct DBOptions { // (i.e. the ones that are causing all the space amplification). If set to 0 // (default), we will dynamically choose the WAL size limit to be // [sum of all write_buffer_size * max_write_buffer_number] * 4 - // This option takes effect only when there are more than one column family as - // otherwise the wal size is dictated by the write_buffer_size. + // + // For example, with 15 column families, each with + // write_buffer_size = 128 MB + // max_write_buffer_number = 6 + // max_total_wal_size will be calculated to be [15 * 128MB * 6] * 4 = 45GB + // + // The RocksDB wiki has some discussion about how the WAL interacts + // with memtables and flushing of column families. + // https://github.com/facebook/rocksdb/wiki/Column-Families + // + // This option takes effect only when there are more than one column + // family as otherwise the wal size is dictated by the write_buffer_size. // // Default: 0 // diff --git a/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java b/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java index a3e23d4b3..385eecad1 100644 --- a/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java +++ b/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java @@ -202,12 +202,24 @@ public interface MutableDBOptionsInterfaceOnce write-ahead logs exceed this size, we will start forcing the - * flush of column families whose memtables are backed by the oldest live - * WAL file (i.e. the ones that are causing all the space amplification). + *

Set the max total write-ahead log size. Once write-ahead logs exceed this size, we will + * start forcing the flush of column families whose memtables are backed by the oldest live WAL + * file *

+ *

The oldest WAL files are the ones that are causing all the space amplification. + *

+ * For example, with 15 column families, each with + * write_buffer_size = 128 MB + * max_write_buffer_number = 6 + * max_total_wal_size will be calculated to be [15 * 128MB * 6] * 4 = + * 45GB + *

+ * The RocksDB wiki has some discussion about how the WAL interacts + * with memtables and flushing of column families, at + * ... + *

*

If set to 0 (default), we will dynamically choose the WAL size limit to - * be [sum of all write_buffer_size * max_write_buffer_number] * 2

+ * be [sum of all write_buffer_size * max_write_buffer_number] * 4

*

This option takes effect only when there are more than one column family as * otherwise the wal size is dictated by the write_buffer_size.

*

Default: 0

@@ -218,13 +230,30 @@ public interface MutableDBOptionsInterfaceReturns the max total wal size. Once write-ahead logs exceed this size, + *

Returns the max total write-ahead log size. Once write-ahead logs exceed this size, * we will start forcing the flush of column families whose memtables are - * backed by the oldest live WAL file (i.e. the ones that are causing all - * the space amplification).

+ * backed by the oldest live WAL file.

+ *

The oldest WAL files are the ones that are causing all the space amplification. + *

+ * For example, with 15 column families, each with + * write_buffer_size = 128 MB + * max_write_buffer_number = 6 + * max_total_wal_size will be calculated to be [15 * 128MB * 6] * 4 = + * 45GB + *

+ * The RocksDB wiki has some discussion about how the WAL interacts + * with memtables and flushing of column families, at + * ... + *

+ *

If set to 0 (default), we will dynamically choose the WAL size limit to + * be [sum of all write_buffer_size * max_write_buffer_number] * 4

+ *

This option takes effect only when there are more than one column family as + * otherwise the wal size is dictated by the write_buffer_size.

+ *

Default: 0

+ * * *

If set to 0 (default), we will dynamically choose the WAL size limit - * to be [sum of all write_buffer_size * max_write_buffer_number] * 2 + * to be [sum of all write_buffer_size * max_write_buffer_number] * 4 *

* * @return max total wal size