From f46d9330b0809d8b06f13053ac7f60d3d849323a Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 9 Oct 2021 14:32:30 -0400 Subject: [PATCH] smaller caches --- lbry/wallet/server/daemon.py | 2 +- lbry/wallet/server/leveldb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/server/daemon.py b/lbry/wallet/server/daemon.py index 123f17f3b..c487de0c7 100644 --- a/lbry/wallet/server/daemon.py +++ b/lbry/wallet/server/daemon.py @@ -55,7 +55,7 @@ class Daemon: self.available_rpcs = {} self.connector = aiohttp.TCPConnector() self._block_hash_cache = LRUCacheWithMetrics(100000) - self._block_cache = LRUCacheWithMetrics(2 ** 16, metric_name='block', namespace=NAMESPACE) + self._block_cache = LRUCacheWithMetrics(2 ** 13, metric_name='block', namespace=NAMESPACE) async def close(self): if self.connector: diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index 44b38fced..53fbe21e3 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -112,7 +112,7 @@ class LevelDB: self.merkle = Merkle() self.header_mc = MerkleCache(self.merkle, self.fs_block_hashes) - self._tx_and_merkle_cache = LRUCacheWithMetrics(2 ** 17, metric_name='tx_and_merkle', namespace="wallet_server") + self._tx_and_merkle_cache = LRUCacheWithMetrics(2 ** 16, metric_name='tx_and_merkle', namespace="wallet_server") self.claim_to_txo: Dict[bytes, ClaimToTXOValue] = {} self.txo_to_claim: DefaultDict[int, Dict[int, bytes]] = defaultdict(dict)