Closed pkamenarsky closed 7 years ago
Not really. If you bypass the kernel buffer, each write is effectively a blocking write. DirectIO is required for AIO, and it can be useful if your application tends to its own caching needs (no need to cache both on the application and on the kernel), but for Tank and other such systems, it makes no real sense to use direct I/O IMO.
I see - so there are no guarantees that a write is going to be persisted to disk in case of a crash, correct?
Tank will periodically (every few ms) will fdatasync() so that writes will persist to disk, and, worse case scenario, you will lose some 100s of ms worth of data if the OS crashes between commits. I think it's a good compromise.
From the core concepts:
Is there performance to be gained by writing directly to disk, without the overhead of a filesystem? Most, if not all of the filesystem features wouldn't be needed anyway.