https://bugs.openldap.org/show_bug.cgi?id=9475
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to leslie from comment #0)
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
Have you tested the performance by simply dd'ing the entire file into memory before running your test? `dd if=data.mdb of=/dev/null` would be sufficient to preload the data into memory.