reth icon indicating copy to clipboard operation
reth copied to clipboard

Make `mmap` size requested by `libmdbx` configurable

Open guidanoli opened this issue 1 year ago • 2 comments

Describe the feature

I would like there to be a configuration for changing the amount of memory requested upfront by libmdbx through mmap. It is 4TB as of now.

Additional context

Currently, reth requests 4TB of memory with mmap, which fails in Linux environments compiled with no4lvl boot argument. I can see why that would be necessary for production, but I only need to run reth in dev mode, and wouldn't require as much memory.

My use case is running reth in a deterministic RISC-V virtual machine. The application name is Bug Buster.

guidanoli avatar Aug 28 '24 00:08 guidanoli

This issue is stale because it has been open for 21 days with no activity.

github-actions[bot] avatar Sep 21 '24 01:09 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Sep 29 '24 02:09 github-actions[bot]

@shekhirin Hey! It would be good if the step was also configurable. From what I understand from the code base, it's at 4 GB. https://github.com/paradigmxyz/reth/blob/756a47e4e2a8ab350cfc12d6621981312e12f715/crates/storage/db/src/implementation/mdbx/mod.rs#L281-L289

guidanoli avatar Oct 16 '24 19:10 guidanoli

I'm running reth in a really constrained environment. In my use case, I would set the total size to something like 8 MB, and the growth step to something like 4 KB.

guidanoli avatar Oct 16 '24 19:10 guidanoli

I think we can make this work, sorry for not bumping prio on this.

need to track a few other things for this first before we can expose via cli

mattsse avatar Oct 16 '24 22:10 mattsse

marking this as completed because this can now be configured

mattsse avatar Nov 13 '24 18:11 mattsse