-
Notifications
You must be signed in to change notification settings - Fork 975
Expand file tree
/
Copy pathbk_server_rocksdb_rowcache_example.conf
More file actions
39 lines (32 loc) · 1.51 KB
/
bk_server_rocksdb_rowcache_example.conf
File metadata and controls
39 lines (32 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Example configuration for enabling RocksDB row cache in BookKeeper
# This configuration demonstrates how to enable row cache for improved read performance
# Use DbLedgerStorage (required for RocksDB features)
ledgerStorageClass=org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage
# RocksDB Block Cache Configuration
# Block cache caches compressed/uncompressed blocks
# Default: 10% of direct memory / number of ledger directories
# dbStorage_rocksDB_blockCacheSize=536870912 # 512MB
# RocksDB Row Cache Configuration (NEW)
# Row cache stores actual key-value pairs for faster lookups
# This avoids SST file reads for frequently accessed keys
# Default: 0 (disabled)
# Recommended values: 64MB to 512MB depending on available memory
dbStorage_rocksDB_rowCacheSize=268435456 # 256MB
# Memory allocation example for a server with 8GB RAM:
# - Write cache: 25% of direct memory (~2GB)
# - Read-ahead cache: 25% of direct memory (~2GB)
# - Block cache: 10% of direct memory (~800MB)
# - Row cache: 256MB (configured above)
# - Total RocksDB memory usage: ~5GB
# Other RocksDB tuning parameters
dbStorage_rocksDB_writeBufferSizeMB=64
dbStorage_rocksDB_sstSizeInMB=64
dbStorage_rocksDB_blockSize=65536
dbStorage_rocksDB_bloomFilterBitsPerKey=10
# Enable compression for better storage efficiency
dbStorage_rocksDB_lz4CompressionEnabled=true
# Note: Row cache is most effective for:
# - Hot keys that are accessed frequently
# - Small to medium-sized values
# - Read-heavy workloads
# - Low-latency requirements (sub-millisecond reads)