leveldb tuning

This commit is contained in:
Jack Robison 2021-06-15 12:03:39 -04:00
parent 962dc1b55b
commit 4a1b2be269
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -78,10 +78,12 @@ class LevelDB(Storage):
cls.module = plyvel cls.module = plyvel
def open(self, name, create, lru_cache_size=None): def open(self, name, create, lru_cache_size=None):
mof = 10000 mof = 512
path = os.path.join(self.db_dir, name) path = os.path.join(self.db_dir, name)
# Use snappy compression (the default) # Use snappy compression (the default)
self.db = self.module.DB(path, create_if_missing=create, max_open_files=mof) self.db = self.module.DB(path, create_if_missing=create, max_open_files=mof, lru_cache_size=4*1024*1024*1024,
write_buffer_size=64*1024*1024, block_size=1024*1024, max_file_size=1024*1024*64,
bloom_filter_bits=32)
self.close = self.db.close self.close = self.db.close
self.get = self.db.get self.get = self.db.get
self.put = self.db.put self.put = self.db.put