From 5af7d3feac568f28245bc7a20ac425bed3bdc8c5 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Mon, 28 Nov 2016 15:54:51 -0800 Subject: [PATCH] Added DbLedgerStorage configuration keys with default values in bookkeeper.conf (#123) --- conf/bookkeeper.conf | 54 ++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/conf/bookkeeper.conf b/conf/bookkeeper.conf index 63d181f2d116b..cd2fa28212738 100644 --- a/conf/bookkeeper.conf +++ b/conf/bookkeeper.conf @@ -1,18 +1,18 @@ # # Copyright 2016 Yahoo Inc. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# +# ## Bookie settings @@ -43,7 +43,7 @@ journalDirectory=data/bookkeeper/journal # could define multi directories to store snapshots, separated by ',' # For example: # ledgerDirectories=/tmp/bk1-data,/tmp/bk2-data -# +# # Ideally ledger dirs and journal dir are each in a differet device, # which reduce the contention between random i/o and sequential write. # It is possible to run with a single disk, but performance will be significantly lower. @@ -78,7 +78,7 @@ ledgerStorageClass=org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage # minorCompactionThreshold=0.2 # Interval to run minor compaction, in seconds -# If it is set to less than zero, the minor compaction is disabled. +# If it is set to less than zero, the minor compaction is disabled. # minorCompactionInterval=3600 # Threshold of major compaction @@ -90,8 +90,8 @@ ledgerStorageClass=org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage majorCompactionThreshold=0.5 # Interval to run major compaction, in seconds -# If it is set to less than zero, the major compaction is disabled. -# majorCompactionInterval=86400 +# If it is set to less than zero, the major compaction is disabled. +# majorCompactionInterval=86400 # Set the maximum number of entries which can be compacted without flushing. # When compacting, the entries are written to the entrylog and the new offsets @@ -106,7 +106,7 @@ majorCompactionThreshold=0.5 # Set the rate at which compaction will readd entries. The unit is adds per second. #compactionRate=1000 -# Throttle compaction by bytes or by entries. +# Throttle compaction by bytes or by entries. #isThrottleByBytes=false # Set the rate at which compaction will readd entries. The unit is adds per second. @@ -247,7 +247,7 @@ readOnlyModeEnabled=true #be written to that partition. If all ledger dir partions are full, then bookie #will turn to readonly mode if 'readOnlyModeEnabled=true' is set, else it will #shutdown. -#Valid values should be in between 0 and 1 (exclusive). +#Valid values should be in between 0 and 1 (exclusive). #diskUsageThreshold=0.95 #Disk check interval in milli seconds, interval to check the ledger dirs usage. @@ -296,10 +296,36 @@ readBufferSizeBytes=4096 # Stats Provider Class #statsProviderClass=org.apache.bookkeeper.stats.CodahaleMetricsProvider +#codahaleStatsJmxEndpoint=metrics -dbStorage_readAheadCacheBatchSize=1000 -dbStorage_rocksDBEnabled=true -dbStorage_writeCacheMaxSizeMb=256 + +## DB Ledger storage configuration + +# Size of Write Cache. Memory is allocated from JVM direct memory. +# Write cache is used to buffer entries before flushing into the entry log +# For good performance, it should be big enough to hold a sub +dbStorage_writeCacheMaxSizeMb=512 + +# Size of Read cache. Memory is allocated from JVM direct memory. +# This read cache is pre-filled doing read-ahead whenever a cache miss happens dbStorage_readAheadCacheMaxSizeMb=256 -codahaleStatsJmxEndpoint=metrics +# How many entries to pre-fill in cache after a read cache miss +dbStorage_readAheadCacheBatchSize=1000 + +## RocksDB specific configurations +## DbLedgerStorage uses RocksDB to store the indexes from +## (ledgerId, entryId) -> (entryLog, offset) + +# Size of RocksDB block-cache. For best performance, this cache +# should be big enough to hold a significant portion of the index +# database which can reach ~2GB in some cases +# dbStorage_rocksDB_blockCacheSize=268435456 # 256 MBytes + +# dbStorage_rocksDB_writeBufferSizeMB=64 +# dbStorage_rocksDB_sstSizeInMB=64 +# dbStorage_rocksDB_blockSize=65536 +# dbStorage_rocksDB_bloomFilterBitsPerKey=10 +# dbStorage_rocksDB_numLevels=-1 +# dbStorage_rocksDB_numFilesInLevel0=4 +# dbStorage_rocksDB_maxSizeInLevel1MB=256