leveldb
leveldb copied to clipboard
Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems
Cherry-picking https://github.com/bitcoin-core/leveldb-subtree/commit/92ae82c78f225de84040c51e07fd0b4a61caed99 and revives https://github.com/google/leveldb/pull/613
i'm confused, maybe there is value in changing the default, but why do we patch leveldb here when it could be set from client code:
// Can be set using EnvPosixTestHelper::SetReadOnlyMMapLimit().
Are you suggesting we revert it in Bitcoin instead?
Ideally yes, looking into it. Sure, upstream leveldb might still want to change this default but i find it hard to argue "why 4096".
Hah i like the commit message:
By default LevelDB will only mmap() up to 1000 ldb files for reading and then fall back
to using file desciptors.
The typical linux system has a 'vm.max_map_count = 65530', so mapping only 1000 files
seems arbitarily small. Increase this value to another arbitrarily small value, 4096.
Okay this turned out so much worse than i hoped, on the upside, maybe we can just drop this patch: bitcoin/bitcoin#32447