Open asdacap opened 10 months ago
There seems to be an attempt at rocksdb binding library to bundle jemalloc https://github.com/curiosity-ai/rocksdb-sharp/commit/dee0d243c7aa3b219cfc0282a979756a7de5cf73
The allocator contention is very bad during Old Receipts on Windows (enough to push block processing over 24secs)
MALLOC_ARENA_MAX
to something like 4. The default is core count * 8 on 64 bit system.malloc_trim
every 5 minuteWhich basically mean, jemalloc is the end goal. However, I've no idea how to deploy this in a cross platform manner.
Adjusting malloc parameters comes with tradeoff of either lock contention (reduced arena count) or higher system CPU usage (MMAP_THRESHOLD and friends).
It is possible to change the malloc config via
mallopts
call at runtime, however it does not work for limiting num of arena as the arena would have already been created by .net runtime by the time managed code start running.Using
mallopts
for limitingMALLOC_MMAP_THRESHOLD
seems promising, but it does not work as well as just limiting arena count to 32.Graph is (jemalloc, default, max arena 32, jemalloc, default, call trim every 5 minute)![Screenshot_2023-09-19_16-34-21](https://github.com/NethermindEth/nethermind/assets/1841324/971679b6-e581-4cc6-88e4-da179ddb512d)