ethdb/leveldb: use larger table files to decrease filesys load

This commit is contained in:
Péter Szilágyi 2019-05-20 16:48:34 +03:00
parent a54142987c
commit 18b41bdd42
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -95,6 +95,8 @@ func New(file string, cache int, handles int, namespace string) (*Database, erro
BlockCacheCapacity: cache / 2 * opt.MiB, BlockCacheCapacity: cache / 2 * opt.MiB,
WriteBuffer: cache / 4 * opt.MiB, // Two of these are used internally WriteBuffer: cache / 4 * opt.MiB, // Two of these are used internally
Filter: filter.NewBloomFilter(10), Filter: filter.NewBloomFilter(10),
CompactionTableSize: 4 * opt.MiB,
CompactionTableSizeMultiplierPerLevel: []float64{1, 2, 4, 8, 8, 8, 8}, // Cap at 32MB files, higher explodes disk IO
}) })
if _, corrupted := err.(*errors.ErrCorrupted); corrupted { if _, corrupted := err.(*errors.ErrCorrupted); corrupted {
db, err = leveldb.RecoverFile(file, nil) db, err = leveldb.RecoverFile(file, nil)