Speeding up live cd boot through optimizing file layout
plougher
phillip.lougher at gmail.com
Tue May 30 00:25:18 BST 2006
Matt Zimmerman wrote:
>Optimizations like this are rarely so simple, and certainly not in this
>case. The advantage of the outer edges is in throughput, not latency.
>Placing a file there, away from most other files, requires that the drive
>seek a long way to get at it. Meanwhile, caching means that files which
are
>accessed very frequently will be held in memory anyway, so this could even
>be a net loss in performance.
By and large this is correct. However, there are a couple of reasons why
moving files accessed together at start-up to the edge of the disk works
well on Squashfs. Squashfs stores its metadata (inodes and directories) at
the end of the filesystem. This was largely done due to how the filesystem
is generated (the metadata indexes are generated after the files are written
to disk), but it works well for file sorting. Placing files accessed
sequentially at the edge of disk, places them at the fastest part of the
disk, clusters them together which minimises seek time, but it also places
them closest to the metadata, which minimises the seeking from the file
inode to the file data. On other filesystems which put their metadata at
the start of the disk, putting files at the edge of the disk effectively
maximises the seek time required to move from the metadata to the file data.
In these filesystems, it is more difficult to determine if this does speed
accesses.
In general, the best way to minimise seek time in Squashfs is to place files
accessed at the same time in the same directory. Normally nothing has to be
done to achieve this, as file accesses generally exhibit this characteristic
(this is usually called the "locality of reference" principle). For
Squashfs, not only are file data in the same directory placed together on
disk, but it is likely the file inodes are in the same compressed inode
block.
Of course, placing a file at the edge of the disk, when the files accessed
before the file, and the files accessed after the file are not placed at the
edge of the disk is generally counter productive. In this case, as the sort
list is capturing the files accessed sequentially at start-up and sorting
them together to the edge of disk, this doesn't apply.
Regards
Phillip Lougher
--
View this message in context: http://www.nabble.com/Speeding+up+live+cd+boot+through+optimizing+file+layout-t1696577.html#a4618816
Sent from the ubuntu-devel forum at Nabble.com.
More information about the ubuntu-devel
mailing list