Discussion:
[leveldb] mmap based writing vs. stdio based writing
Flabby
2016-03-18 12:55:23 UTC
Permalink
Hi,
I'm wondering that why leveldb use mmap based writing at first then
replace it with stdio based writing.
According to 1.15 Release Note
<https://groups.google.com/forum/#!searchin/leveldb/stdio$20write/leveldb/VM5nYLvLVME/Ri8MThbM4I0J> .
' Has a minor impact (0.5 microseconds) on microbenchmarks for
asynchronous writes. Synchronous writes speed up from 30ms to 10ms on
linux/ext4.'

1). I think asynchronous or synchronous writes means wether to use
fsync for the write operation, is it that
2). If so, I prefer the mmap version, because asynchronous writes
is much more common for my situation, what's your opion?
Also, I'm new to leveldb benchmark, how can I benchmark this?

Thanks.
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert Escriva
2016-03-18 15:23:19 UTC
Permalink
Hi,
     I'm wondering that why leveldb use mmap based writing at first, then
replace it with stdio based writing.
     According to 1.15 Release Note .  ' Has a   minor impact (0.5
microseconds) on microbenchmarks for asynchronous writes. Synchronous writes
speed up from 30ms to 10ms on linux/ext4.'
     1).  I think asynchronous  or synchronous writes means wether to use fsync
for the write operation, is it that?
     2).  If so,  I prefer the mmap version,  because asynchronous writes is
much more common for my situation, what's your opion?
     Also, I'm new to leveldb benchmark, how can I benchmark this?
     Thanks.
There was a bug on OS X where mmap and fsync did not perform as
expected. This caused problems in bitcoin, leading to their famous
leveldb bug bounty. The solution was to change to purely stdio-based
writing so it works on all platforms without relying on Linux behavior.

Neither version implies the use of fsync unless you set sync=true in the
WriteOptions. You can still do asynchronous writes in the newest
version.

-Robert
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...