How does (or does) ZFS maintain sequentiality of the blocks of a file. If I mkfile on a clean UFS, I likely will get contiguous blocks for my file, right? A customer I talked to recently has a desire to access large volumes of sequential data. They were concerned about maintaining this file as a string of sequential blocks on disk (for performance reasons) as they update it. This brought up the second part of the question - how does ZFS deal with things that look and feel like directio? When processes update blocks "in place", like a database might do, are new blocks allocated, or the existing blocks left alone? If they are left in place, doesn''t that screw around with the transactional nature of ZFS? Is this question at all clear? --SCott
Robert Milkowski
2006-May-24 22:01 UTC
[zfs-discuss] Sequentiality & direct access to a file
Hello Scott, Wednesday, May 24, 2006, 9:42:06 PM, you wrote: SD> How does (or does) ZFS maintain sequentiality of the blocks of a file. SD> If I mkfile on a clean UFS, I likely will get contiguous blocks for my SD> file, right? A customer I talked to recently has a desire to access SD> large volumes of sequential data. They were concerned about maintaining SD> this file as a string of sequential blocks on disk (for performance SD> reasons) as they update it. SD> This brought up the second part of the question - how does ZFS deal with SD> things that look and feel like directio? When processes update blocks SD> "in place", like a database might do, are new blocks allocated, or the SD> existing blocks left alone? If they are left in place, doesn''t that SD> screw around with the transactional nature of ZFS? SD> Is this question at all clear? "updated" blocks will be actually written to new place - so if you update random blocks in a file then reading this file sequentially will not be that sequential. -- Best regards, Robert mailto:rmilkowski at task.gda.pl http://milek.blogspot.com
Jonathan Adams
2006-May-24 22:54 UTC
[zfs-discuss] Sequentiality & direct access to a file
On Thu, May 25, 2006 at 12:01:18AM +0200, Robert Milkowski wrote:> Hello Scott, > > Wednesday, May 24, 2006, 9:42:06 PM, you wrote: > > SD> How does (or does) ZFS maintain sequentiality of the blocks of a file. > SD> If I mkfile on a clean UFS, I likely will get contiguous blocks for my > SD> file, right? A customer I talked to recently has a desire to access > SD> large volumes of sequential data. They were concerned about maintaining > SD> this file as a string of sequential blocks on disk (for performance > SD> reasons) as they update it. > > SD> This brought up the second part of the question - how does ZFS deal with > SD> things that look and feel like directio? When processes update blocks > SD> "in place", like a database might do, are new blocks allocated, or the > SD> existing blocks left alone? If they are left in place, doesn''t that > SD> screw around with the transactional nature of ZFS? > > SD> Is this question at all clear? > > "updated" blocks will be actually written to new place - so if you > update random blocks in a file then reading this file sequentially > will not be that sequential.On the other hand, if you are reading the file sequentially, ZFS has very good read-ahead algorithms. Cheers, - jonathan -- Jonathan Adams, Solaris Kernel Development
Roch Bourbonnais - Performance Engineering
2006-May-26 17:34 UTC
[zfs-discuss] Sequentiality & direct access to a file
Scott Dickson writes: > How does (or does) ZFS maintain sequentiality of the blocks of a file. > If I mkfile on a clean UFS, I likely will get contiguous blocks for my > file, right? A customer I talked to recently has a desire to access you would get up to maxcontig worth of sequential block. But only inasmuch as there is a single thread in the system doing the allocating writes. When more threads compete for blocks we end up with less contiguity. With ZFS, i believe that as part of a transaction group (a big sync every 5 second) dirtied blocks of a file are reordered by offsets then sent to disk in that order. It would be interesting to see if it truly works that way but basically ZFS may reduce the randomness as part of the sync. -r > > --SCott > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss