[zfs-discuss] SLOG, RAM and zfs_dirty_data_max
Edward Ned Harvey (zfsonlinux)
zfsonlinux at nedharvey.com
Tue Apr 17 08:29:46 EDT 2018
> From: zfs-discuss <zfs-discuss-bounces at list.zfsonlinux.org> On Behalf Of
> BeetRoot ServAdm via zfs-discuss
> As I have read, zfs_dirty_data_max is a buffer located in RAM to quickly
> accomodate writes before they are flushed to disk. How is this working in
> case there is also an SLOG? The buffer is no longer in RAM but only in the
> SLOG? Or is the data first hitting RAM, then SLOG, and then disk? I couln't
> find this answer to this in documentation.
Don't think too hard about it.
When an application writes, it can write sync mode or async mode. If it writes async mode, the write goes into write buffer, which gets flushed every 5 seconds or when zfs_dirty_data_max bytes are in the buffer. If it writes in sync mode, ZFS first writes it to nonvolatile storage (slog device if available) and then handles it just like a regular async write.
By doing this, you get write aggregation. Lots of small writes accumulate in the buffer and then all get flushed to disk in a single larger transaction.
More information about the zfs-discuss