Discussion:
Using sendfile with lmdb
James Rouzier
2015-03-31 02:12:01 UTC
Permalink
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.
I accomplished this by creating function to extract get the mmap ptr from
the env so I can calculate the offset of data.

I figured that function might be useful to the bigger community.

If it does not fit in the bigger vision of lmdb it is fine not to include
it.

You will find the diff attached.


Thank you
James
James Rouzier
2015-04-03 02:55:21 UTC
Permalink
Eric thank you I would have never considered that as an issue.
I tried out your code and saw the problem.
You saved me going down a rabbit hole.

Many Thanks
Post by James Rouzier
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
https://git.kernel.org/cgit/docs/man-pages/man-pages.git/patch?id=7b6a3299776b5c1c4f169a591434a855d50c68b4
Loading...