A database fsyncs the write ahead log on every commit and an fsync takes 8 ms. Compute the maximum commit rate with 64 concurrent clients under group commit, contrast it with a single threaded client, and state what disabling the fsync actually changes about the guarantee.
A database fsyncs the write ahead log on every commit and an fsync takes 8 ms. Compute the maximum commit rate with 64 concurrent clients under group commit, contrast it with a single threaded client, and state what disabling the fsync actually changes about the guarantee.
Approach: Turn the fsync latency into a throughput ceiling for one client, then ask how many pending commits a single flush can make durable when clients arrive concurrently.
8,000 per second. A single threaded client serialises commit and flush, so it reaches at most 1 / 0.008 = 125 commits per second however fast the CPU is, because the fsync latency is the entire round trip. Group commit breaks that coupling: transactions arriving while a flush is in progress are appended to the write ahead log buffer and made durable by the next flush, so one 8 ms fsync settles all 64 in flight commits and the ceiling becomes 64 divided by 0.008, which is 8,000 per second. Throughput then scales with concurrency while per commit latency stays near 8 ms and reaches 16 ms for a transaction that just missed a flush. Disabling the fsync raises the rate to whatever the CPU allows and changes the durability guarantee: the log then sits in the operating system page cache, so a process crash is still survivable while a machine power loss discards every commit acknowledged since the last flush, typically tens of milliseconds of work. A middle setting that flushes once per fixed interval bounds that loss window explicitly, and synchronous replication to a second machine gives durability without the local disk round trip at the price of a network round trip.
Follow-up: How does the ceiling change on a device whose fsync latency is 0.05 ms but which loses one write in 10^15?
Key concepts: write ahead log, group commit, fsync latency, durability.