From 7c626545347477ea6b184ece22a282aed6d4034d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 15 Jun 2021 12:03:39 -0400 Subject: [PATCH] leveldb tuning --- lbry/wallet/server/storage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/server/storage.py b/lbry/wallet/server/storage.py index 127166204..f22d1c2f4 100644 --- a/lbry/wallet/server/storage.py +++ b/lbry/wallet/server/storage.py @@ -78,10 +78,12 @@ class LevelDB(Storage): cls.module = plyvel def open(self, name, create, lru_cache_size=None): - mof = 10000 + mof = 512 path = os.path.join(self.db_dir, name) # 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.get = self.db.get self.put = self.db.put