Vitaly Zuevsky wrote:
Hi
MAP_LOCK flag to mmap() on LMDB readers should populate page cache from the file being mapped and preclude those pages from eviction. I was wondering if that was ever tested, especially with frequent writes to the underlying file. And is there a standard way (a compile option) to include that flag without modifying source code directly? I see quite a few major faults with perf stat, and I am looking if they could be avoided.
I am new to LMDB and I guess this discussion may have taken place before, if you could point me out to the right place..
No. In general it's a bad idea to interfere with the OS's paging decisions. In particular, on a machine with plenty of RAM, pageouts aren't an issue anyway. On a system where memory is tight, page faults will be unavoidable, so the question is what other memory are you going to lose if you force the LMDB pages to stay locked in?
Thank you.
Vitaly