Re: sequential writing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First thing: if you're writing to the device (like /dev/sdX), then you'll get sequential writes at the device. If that device is a spinning disk, then you'll get the best possible performance of laying down blocks one after another. If the device is a SSD, then they'll tend towards filling erase-block size chunks, but you won't have any idea of physical location.

If you're writing to files on a filesystem, however, the answer is less straightforward. Most filesystems will attempt to translate sequential file writes to mostly-sequential writes to the underlying disk. There will be metadata updates in there and whatnot that shake things up a bit. If the filesystem is copy-on-write, like ZFS, and it's been used a lot (has lots of holes), then there's no telling.

Finally, if the device is a RAID, SAN box, or whatever, then that can be very different than a raw disk device.

Best regards,
Josh

On Jan 26, 2015, at 5:56 AM, telecolega . <telecolega@xxxxxxxxx> wrote:

> Hi guys,
> 
> In the last days I tried to investigate how fio writes sequentially
> when using the libaio engine. As far as I understood, the key here is
> controlling the offset variable in the iocb struct (iocb->u.c.offset)
> so that the new block is written right next to the previous block.
> 
> Now a question comes to my mind. Even if fio is writing sequentially
> on a file or block, that does not guarantee that we are writing
> sequentially on the hard disk, right? I guess the linux kernel will be
> the one eventually deciding if that data is written sequentially or
> randomly across the disk. Nevertheless, I assume that when FIO writes
> sequentially to a file or block, the likelyhood that the data is
> written sequentially is increased. Is this correct?
> 
> Do you know if there is a way from the user space (e.g. fio) to
> "force" the kernel to write sequentially?
> 
> Thanks ofr your help!
> --
> To unsubscribe from this list: send the line "unsubscribe fio" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux