@@ -13,6 +13,7 @@ import (
1313 "log"
1414 "os"
1515 "os/signal"
16+ "runtime"
1617 "syscall"
1718 "time"
1819)
@@ -80,19 +81,52 @@ func run() error {
8081 }
8182 log .Printf ("main: Config :\n %v\n " , out )
8283
83- levelOptions := pebble.LevelOptions {
84+ l1Options := pebble.LevelOptions {
85+ BlockRestartInterval : 16 ,
86+ BlockSize : 4096 ,
87+ BlockSizeThreshold : 90 ,
88+ Compression : pebble .NoCompression ,
89+ FilterPolicy : nil ,
90+ FilterType : pebble .TableFilter ,
91+ IndexBlockSize : 4096 ,
92+ TargetFileSize : 268435456 , // 256 MB
93+ }
94+ l2Options := pebble.LevelOptions {
95+ BlockRestartInterval : 16 ,
96+ BlockSize : 4096 ,
97+ BlockSizeThreshold : 90 ,
98+ Compression : pebble .ZstdCompression ,
99+ FilterPolicy : nil ,
100+ FilterType : pebble .TableFilter ,
101+ IndexBlockSize : 4096 ,
102+ TargetFileSize : l1Options .TargetFileSize * 10 , // 2.5 GB
103+ }
104+ l3Options := pebble.LevelOptions {
105+ BlockRestartInterval : 16 ,
106+ BlockSize : 4096 ,
107+ BlockSizeThreshold : 90 ,
108+ Compression : pebble .ZstdCompression ,
109+ FilterPolicy : nil ,
110+ FilterType : pebble .TableFilter ,
111+ IndexBlockSize : 4096 ,
112+ TargetFileSize : l2Options .TargetFileSize * 10 , // 25 GB
113+ }
114+ l4Options := pebble.LevelOptions {
84115 BlockRestartInterval : 16 ,
85116 BlockSize : 4096 ,
86117 BlockSizeThreshold : 90 ,
87118 Compression : pebble .ZstdCompression ,
88119 FilterPolicy : nil ,
89120 FilterType : pebble .TableFilter ,
90121 IndexBlockSize : 4096 ,
91- TargetFileSize : 2097152 ,
122+ TargetFileSize : l3Options . TargetFileSize * 10 , // 250 GB
92123 }
93124
94125 pebbleOptions := pebble.Options {
95- Levels : []pebble.LevelOptions {levelOptions },
126+ Levels : []pebble.LevelOptions {l1Options , l2Options , l3Options , l4Options },
127+ MaxConcurrentCompactions : func () int { return runtime .NumCPU () },
128+ MemTableSize : 268435456 , // 256 MB
129+ EventListener : store .NewPebbleEventListener (),
96130 }
97131
98132 db , err := pebble .Open (cfg .Qubic .StorageFolder , & pebbleOptions )
0 commit comments