logoalt Hacker News

merbyesterday at 7:34 PM6 repliesview on HN

> 3.4 Lazy fsync by Default

Why? Why do some databases do that? To have better performance in benchmarks? It’s not like that it’s ok to do that if you have a better default or at least write a lot about it. But especially when you run stuff in a small cluster you get bitten by stuff like that.


Replies

aaronbwebberyesterday at 8:25 PM

It's not just better performance on latency benchmarks, it likely improves throughput as well because the writes will be batched together.

Many applications do not require true durability and it is likely that many applications benefit from lazy fsync. Whether it should be the default is a lot more questionable though.

show 3 replies
millipedeyesterday at 8:12 PM

I always wondered why the fsync has to be lazy. It seems like the fsync's can be bundled up together, and the notification messages held for a few millis while the write completes. Similar to TCP corking. There doesn't need to be one fsync per consensus.

show 3 replies
mrkeenyesterday at 9:19 PM

One of the perks of being distributed, I guess.

The kind of failure that a system can tolerate with strict fsync but can't tolerate with lazy fsync (i.e. the software 'confirms' a write to its caller but then crashes) is probably not the kind of failure you'd expect to encounter on a majority of your nodes all at the same time.

show 1 reply
thinkharderdevyesterday at 7:43 PM

> To have better performance in benchmarks

Yes, exactly.

cnlwsuyesterday at 11:00 PM

durability through replication and distribution and better throughput to build up more within the window on a lazy fsync

dilyevskyyesterday at 8:54 PM

Massively improves benchmark performance. Like 5-10x

show 1 reply