Chookiex
2009-Aug-05 04:06 UTC
[zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived?
Hi All, You know, ZFS afford a very Big buffer for write IO. So, When we write a file, the first stage is put it to buffer. But, if the file is VERY short-lived? Is it bring IO to disk? or else, it just put the meta data and data to memory, and then removed it? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090804/7e09bf79/attachment.html>
Roch Bourbonnais
2009-Aug-05 07:26 UTC
[zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived?
Le 5 ao?t 09 ? 06:06, Chookiex a ?crit :> Hi All, > You know, ZFS afford a very Big buffer for write IO. > So, When we write a file, the first stage is put it to buffer. > But, if the file is VERY short-lived? Is it bring IO to disk? > or else, it just put the meta data and data to memory, and then > removed it? > >So with a workload of ''creat,write,close,unlink'', I don''t see ZFS or other filesystems issuing I/Os for the files. -r> > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2431 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090805/64492489/attachment.bin>
Bob Friesenhahn
2009-Aug-05 15:25 UTC
[zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived?
On Tue, 4 Aug 2009, Chookiex wrote: You know, ZFS afford a very Big buffer for write IO. So, When we write a file, the first stage is put it to buffer. But, if the file is VERY short-lived? Is it bring IO to disk? or else, it just put the meta data and data to memory, and then removed it? This depends on timing, available memory, and if the writes are synchronous. Synchronous writes are sent to disk immediately. Buffered writes seem to be very well buffered and small created files are not persisted until the next TXG sync interval and if they are immediately deleted it is as if they did not exist at all. This leads to a huge improvement in observed performance. % while true do rm -f crap.dat dd if=/dev/urandom of=crap.dat count=200 rm -f crap.dat sleep 1 done I just verified this by running the above script and running a tool which monitors zfs read and write requests. Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Chookiex
2009-Aug-06 12:49 UTC
[zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived?
Thanks. :) I have tested in my system, it''s great. But, you know, ZIO is pipelined, it means that the IO request may be sent, and when you unlink the file, the IO stage is in progress. so, would it be canceled else? ________________________________ From: Bob Friesenhahn <bfriesen at simple.dallas.tx.us> To: Chookiex <hexcookie at yahoo.com> Cc: zfs-discuss at opensolaris.org Sent: Wednesday, August 5, 2009 11:25:45 PM Subject: Re: [zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived? On Tue, 4 Aug 2009, Chookiex wrote: You know, ZFS afford a very Big buffer for write IO. So, When we write a file, the first stage is put it to buffer. But, if the file is VERY short-lived? Is it bring IO to disk? or else, it just put the meta data and data to memory, and then removed it? This depends on timing, available memory, and if the writes are synchronous. Synchronous writes are sent to disk immediately. Buffered writes seem to be very well buffered and small created files are not persisted until the next TXG sync interval and if they are immediately deleted it is as if they did not exist at all. This leads to a huge improvement in observed performance. % while true do rm -f crap.dat dd if=/dev/urandom of=crap.dat count=200 rm -f crap.dat sleep 1 done I just verified this by running the above script and running a tool which monitors zfs read and write requests. Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090806/515fde8c/attachment.html>
Bob Friesenhahn
2009-Aug-06 15:22 UTC
[zfs-discuss] Would ZFS will bring IO when the file is VERY short-lived?
On Thu, 6 Aug 2009, Chookiex wrote:> But, you know, ZIO is pipelined, it means that the IO request may be > sent, and when you unlink the file, the IO stage is in progress. > so, would it be canceled else?In POSIX filesystems, if a file is still open when it is unlinked, then the file directory entry goes away but the file still exists as long as a process has an open file handle to it. This helps avoid certain problems which otherwise would exist. I doubt that ZFS ever cancels I/O in progress. Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/