I want to disable write cache on the disk drives in our J4200 JBODs so that fsync() actually writes to disk, not just to the cache on the drive. I did this using ''format -e'', but it displays a warning about the drive being part of a zpool and also it says that the change is not permanent. Is ''format -e'' the right way to do this with ZFS? Is there no way to make it permanent? -- Todd E. Moore Sun Microsystems Incorporated 443.516.4002 AIM: toddmoore72462 _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Richard Elling
2008-Aug-02 05:00 UTC
[zfs-discuss] Disabling disks'' write-cache in J4200 with ZFS?
Todd E. Moore wrote:> > I want to disable write cache on the disk drives in our J4200 JBODs so > that fsync() actually writes to disk, not just to the cache on the drive. >ZFS will do this for you, via the way the ZIL works. Neil explains it pretty well at http://blogs.sun.com/perrin/entry/the_lumberjack> I did this using ''format -e'', but it displays a warning about the > drive being part of a zpool and also it says that the change is not > permanent. > > Is ''format -e'' the right way to do this with ZFS? Is there no way to > make it permanent?In general, you don''t need to do this. ZFS will send the cache flush command to the disks as needed. -- richard
I''m working with a group that wants to commit all the way to disk every single write - flushing or bypassing all the caches each time. The fsync() call will flush the ZIL. As for the disk''s cache, if given the entire disk, ZFS enables its cache by default. Rather than ZFS having to issue the flush command to the disk we want to disable this cache and avoid the step altogether Richard Elling wrote: Todd E. Moore wrote: I want to disable write cache on the disk drives in our J4200 JBODs so that fsync() actually writes to disk, not just to the cache on the drive. ZFS will do this for you, via the way the ZIL works. Neil explains it pretty well at http://blogs.sun.com/perrin/entry/the_lumberjack I did this using ''format -e'', but it displays a warning about the drive being part of a zpool and also it says that the change is not permanent. Is ''format -e'' the right way to do this with ZFS? Is there no way to make it permanent? In general, you don''t need to do this. ZFS will send the cache flush command to the disks as needed. -- richard -- Todd E. Moore Sun Microsystems Incorporated 443.516.4002 AIM: toddmoore72462 _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Carson Gaspar
2008-Aug-02 17:12 UTC
[zfs-discuss] Disabling disks'' write-cache in J4200 with ZFS?
Todd E. Moore wrote:> I''m working with a group that wants to commit all the way to disk every > single write - flushing or bypassing all the caches each time. The > fsync() call will flush the ZIL. As for the disk''s cache, if given the > entire disk, ZFS enables its cache by default. Rather than ZFS having to > issue the flush command to the disk we want to disable this cache and > avoid the step altogetherThen tell your (in my opinion insane) group to pass O_SYNC to open(). That will guarantee writes go to disk without being cached (except by non-volatile cache in a raid controller). If you don''t want the ZIL involved, don''t configure one for your storage. -- Carson
Neil Perrin
2008-Aug-03 00:47 UTC
[zfs-discuss] Disabling disks'' write-cache in J4200 with ZFS?
Carson Gaspar wrote:> Todd E. Moore wrote: >> I''m working with a group that wants to commit all the way to disk every >> single write - flushing or bypassing all the caches each time. The >> fsync() call will flush the ZIL. As for the disk''s cache, if given the >> entire disk, ZFS enables its cache by default. Rather than ZFS having to >> issue the flush command to the disk we want to disable this cache and >> avoid the step altogether > > Then tell your (in my opinion insane) group to pass O_SYNC to open(). > That will guarantee writes go to disk without being cached (except by > non-volatile cache in a raid controller). If you don''t want the ZIL > involved, don''t configure one for your storage.I think there''s some confusion here. For a description of the ZIL and separate log devices see: http://blogs.sun.com/perrin/entry/the_lumberjack http://blogs.sun.com/perrin/entry/slog_blog_or_blogging_on If you don''t configure a separate log device - I assume this is what you meant by "ZIL" above), then the intent log is embedded in the main pool. It''s not advisable to disable the ZIL code as this actually handles fsync/O_[D]SYNC. Without it those synchronous requests are ignored, which is the opposite of what Todd wants. Neil.
Richard Elling
2008-Aug-03 19:36 UTC
[zfs-discuss] Disabling disks'' write-cache in J4200 with ZFS?
Todd E. Moore wrote:> I''m working with a group that wants to commit all the way to disk > every single write - flushing or bypassing all the caches each time. > The fsync() call will flush the ZIL. As for the disk''s cache, if > given the entire disk, ZFS enables its cache by default. Rather than > ZFS having to issue the flush command to the disk we want to disable > this cache and avoid the step altogetherActually, it will flush to the ZIL. If you don''t want the disk''s cache enabled by default, then use a slice. None of this is difficult. -- richard