[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Using sendfile with lmdb



James Rouzier <rouzier@gmail.com> wrote:
> Hey Guys,
> 
> I am working on a proof of concept of a simple key value store service
> using lmdb as the back end.
> I am using sendfile to avoid an extra copy.

Be careful if you're overwriting any data in LMDB.

zero-copy sendfile means any data queued up in the kernel will be
subject to modifications as the underlying file is updated, so your
client may se data it was not intended to see.

I wanted to do the same thing as you last year but ended up writing a
patch to the sendfile manpage instead:

https://git.kernel.org/cgit/docs/man-pages/man-pages.git/patch?id=7b6a3299776b5c1c4f169a591434a855d50c68b4