Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the main problem with mmap'd writes is that they're blocking and synchronous.

I presume most database record writes are smaller than a page. In that case, other methods (unless you're using O_DIRECT, which ads its own difficulties) still have the kernel read a whole page of memory into the page cache before writing the selected bytes. So, unless you're using O_DIRECT for your writes, you're still triggering the exact same read-modify-write, it's just that with the file APIs you can use async I/O or use select/poll/epoll/kqueue, etc. to avoid these necessary reads from blocking your writer thread.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: