News for hackers. Stuff that matters.
Re:LevelDB Benchmarks by ryanpetrich on Wednesday July 27, 2011 @05:15PM (#2814168)
The synchronous writes benchmark is suspect--on a 7200rpm disk it seems impossible to get 2,400 dependent transactions (or even sqlite's 430) with a full disk sync. Is this due to ext3's relaxed notion of fsync?
Re:LevelDB Benchmarks by MichaelGG on Wednesday July 27, 2011 @05:55PM (#2814371)
Well look how SQLite does write ahead logging (assuming I understand it). Transactions can go into the log and commit, without modifying the original data. Now and then, it can "checkpoint" to move those logged transactions into the database. This way, transactions are mainly sequential writes, with a bit of maintenance now and then.

I've used a similar approach for a constant database. The transaction log goes to disk, but also stays in memory. Scanning it linearly isn't that slow. When it grows too large, the log is converted into a disk-optimized format, which is a rather quick process. This way, it can take tons of writes, service reads acceptably, while still being able to store much more data than RAM and offering fast access to on-disk data.

Re:LevelDB Benchmarks by ryanpetrich on Wednesday July 27, 2011 @06:16PM (#2814466)
I understand that to be the case when not using synchronous. The point of synchronous full is that sqlite should only consider a transaction committed when it is fully flushed to disk. Assuming a 7200rpm disk that isn't lying to you, at most 120 dependent transactions a second should be even possible.

(this should apply equally to other databases that have a similar option)

Re:LevelDB Benchmarks by MichaelGG on Thursday July 28, 2011 @12:47AM (#2815429)
Why does the disk need to re-seek to write to the next sector? With things like SQLite WAL, you're just performing sequential writes to disk.
Re:LevelDB Benchmarks by ryanpetrich on Thursday July 28, 2011 @07:59PM (#2819554)
I hadn't thought of that. If the disk can perform some localized remapping, it's possible to get sequential fsynced writes to exceed the rotation speed.
Re:LevelDB Benchmarks by aaronblohowiak on Wednesday July 27, 2011 @06:29PM (#2814514)
" Is this due to ext3's relaxed notion of fsync?" -- I believe so, especially given the warning about ext4 at the bottom.

>The preceding numbers are for an ext3 file system. Synchronous writes are much slower under ext4 (LevelDB drops to ~34 writes / second, TreeDB drops to ~5 writes / second; SQLite3 drops to ~24 writes / second) due to ext4's different handling of fsync / msync calls. Even LevelDB's asynchronous write performance drops somewhat since it spreads its storage across multiple files and issues fsync calls when switching to a new file.