DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Tuning I/O resources

The mechanics of a disk transfer

A typical write sequence between a process on the CPU and a hard disk involves many stages. When the buffer flushing daemon, bdflush, flushes the buffer cache to move data to disk, it queues the write request on the appropriate disk controller. Note that a write to the raw disk device queues the request on the disk controller without passing through the buffer cache.

Until now everything that has taken place has been comparatively rapid in its execution (ignoring the scheduled delays in the system). As soon as the disk is physically written to (or read from) we encounter several orders of magnitude reduction in speed. The appropriate disk head needs to seek across the disk to position itself over the correct track. The disk platter rotates so that the head writes to the correct sector.

If the amount of data is larger than a disk block and the blocks for the file to be written to are sufficiently fragmented, the seek/rotate cycle needs to be repeated until the write sequence is complete.

A hard disk's performance is characterized by its access time; this is the sum of the seek time taken by the head to move to the correct track, the rotational latency while the disk rotates until the head is over the desired block, and the transmission time needed to transfer data to or from the block as shown in ``The performance characteristics of a hard disk''.

The performance characteristics of a hard disk

These activities take a finite time to complete and are usually quoted as average figures. The peak transfer rate, which is also commonly quoted as a measure of disk performance, depends directly upon these activities. However, peak transfer rates are unusual, especially on disks which are used close to their maximum capacity. These suffer from greater fragmentation of data than emptier disks. If you have already purchased your disks, then the only use of the above values is in deciding which disks you should use to store your files.

Another factor that you can take into consideration if you know the geometry of your disks is the layout of filesystems across the disk surface. Modern disks often have more blocks per track in the outer cylinders than in the inner tracks. When reading contiguous blocks, data from the outer tracks is transferred faster than from inner tracks. The innermost tracks, however, have lower latency times when reading relatively few blocks.

If the applications on your system access large sequential files, such as database journal logs, graphics images, fonts and PostScript®, you may see a gain in disk performance in putting these files in filesystems on the outer tracks of your disks.

If you intend to use divvy(ADM) to re-arrange the divisions on a disk partition, consult the documentation for your drive to see whether block 0 is at the center or the outside of the disk. Most disk manufacturers place it at the center but this is not necessarily the case for all types of hard disk. You will also need to make backups of any existing filesystems on the disk and restore these after making the changes to the disk layout.


Next topic: Viewing disk and other block I/O activity
Previous topic: Tuning the number of multiphysical buffers

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003