pokt-network / poktroll

The official Shannon upgrade implementation of the Pocket Network Protocol implemented using Rollkit.dev
MIT License
15 stars 6 forks source link

[Relay Miner] Address high memory usage #551

Open okdas opened 1 month ago

okdas commented 1 month ago

Objective

RelayMiner processes relays but consumes a large amount of RAM, often leading to the process getting killed due to OOM if resource constrained. RelayMiner should be able to handle a larger amount of requests without saturating memory.

Origin Document

As a part of our load testing plan on TestNet, we've discovered this behavior as we send larger amounts of relays than we usually do on smaller networks.

Pprof heap snapshot suggests most of the memory is reserved by BadgerDB:

Screenshot 2024-05-24 at 9 52 34 AM

Goals

Deliverables

Non-goals / Non-deliverables

General deliverables


Creator: @okdas Co-Owners: TBD

okdas commented 1 month ago

Synched with @Olshansk on this - I'll do a first pass to investigate if there are low-hanging fruits in badger configuration before we dig deeper into the code/smt changes.

Olshansk commented 1 month ago

Things to consider: