https://bugs.openldap.org/show_bug.cgi?id=9475
Issue ID: 9475 Summary: Add support for MAP_POPULATE Product: LMDB Version: unspecified Hardware: All OS: Linux Status: UNCONFIRMED Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: aa531811820@gmail.com Target Milestone: ---
In some case (such as cloud computing platforms), the reading speed of large files is very fast while the small files is very slow, and we have enough memory, so we hope to prefetch the entire LMDB file into the memory during MMAP through the MAP_POPULATE flag . According to our test, this is faster than using readahead flag. Here are some test data:
# mmap with no readahead read one sample: 0.2s total time: 4800s
# mmap with readahead read one sample: 0.0001s~0.03s total time: 95.86s
# mmap with MAP_POPULATE db init: 20s read one sample: 0.0001s total time: 78s