#performance of #mmap is bad when it blocks #async #concurrency
on 02024-08-25discussion of #performance in #databases and #mmap; author of #LMDB says read-only mmap and pwrite works well for LMDB. Also pcmulqdq explains where #LevelDB came from from their experience with the Bigtable folks. “Every HDD since the 1980s has guaranteed atomic sector writes.”
on 02023-07-04the #mmap = 💩 #paper #PDF. The problems for #databases are transactional safety (write ordering), I/O stalls (memory access blocks a process), error handling (all you get is SIGBUS, and you can't checksum your data on its way in and out), and #performance: “Specifically, we have identified three key bottlenecks that plague mmap-based file I/O: (1) page table contention, (2) single-threaded page eviction, and (3) TLB shootdowns.” Mentions #LMDB. In the paper they got better performance, even for reads, with O_DIRECT and pread, but I think that doesn't generalize to arbitrary numbers of reader processes.