[comp.unix.xenix.misc] UNIX Disk I/O Performance

andy@piziali.lonestar.org (Andy Piziali) (02/22/91)

I was measuring some of the performance parameters of a new hard disk on my IBM
PC-AT last night and trying to weight the plusses and minuses of various disk
configurations and how they would affect file system performance under the
Xenix operating system.  First I'll report the disk performance in various
configurations and then discuss how they might affect UNIX file system
performance.  I'd like this base article to spawn a discussion about UNIX file
system tuning on both small and large systems.

The new disk is a Seagate ST251-1, 40 MB, 28 ms average access time.  The peak
data transfer rate off the disk is 510 Kb/s (17 sect/track * 512 byte/sect *
3,600 rev/min * 1 track/rev * 1/60 min/sec).  The measured track-to-track seek
time is 9 ms and the measured average seek time is 28 ms.  At various sector
interleaves the data transfer rates from disk surface to physical memory for
full track reads are:
                                        Effective Transfer
                        Interleave      Rate (KB/sec)

                        1:1             256
                        2:1             254
                        3:1             170
                        4:1             128
                        5:1             102
                        6:1              85

Single sector reads have the following transfer rates as a function of sector
interleave:
                                        Effective Transfer
                        Interleave      Rate (KB/sec)

                        1:1              28
                        2:1              71
                        3:1             170

Note that the full track read and sector read effective transfer rates are the
same at a 3:1 interleave.  It is also interesting that the transfer rate is
only marginally increased changing from a 2:1 to a 1:1 sector interleave.

The IBM Xenix 1.0 "mkfs" program requires "gap" and "block" parameters to build
a file system on a disk.  To the best of my understanding, "gap" refers to the
number of sectors between consecutive disk blocks (512 bytes on this system)
and "block" refers to the number of disk blocks in a cylinder (102).  These
parameters allow mkfs to maximize the data transfer rate off the disk by
allocating disk blocks in an optimum fashion but what is optimum depends on the
frequency of access of small and large files and the fragmentation of the file
system.

If the files usually accessed are one or two disk blocks in size or the file
system is quite fragmented (consecutive file disk blocks are not arranged on
consecutive disk sectors) the sector interleave should be chosen to maximize
data transfer rates of random sector reads and the mkfs gap selected to match
this interleave.  For the disk described above, a 3:1 interleave and gap of 2
would be chosen.

If the files usually access are always larger than a disk block and the file
system is not fragmented the sector interleave should be chosen to maximize
data transfer rates of full track reads and the mkfs gap selected to match this
interleave.  Again, the disk above would be formatted with a 1:1 interleave and
the mkfs gap chosen to be zero.
-- 
Home:	           andy@piziali.lonestar.org                |
{convex,egsner,frontier,laczko}!piziali!andy  ________------+------________
Office:                   piziali@convex.com               / \     
           {sun,texsun,uunet}!convex!piziali              *---*

marz@cbnewsb.cb.att.com (martin.zam) (03/01/91)

>I was measuring some of the performance parameters of a new hard disk on my IBM
>PC-AT last night and trying to weight the plusses and minuses of various disk
>configurations and how they would affect file system performance under the
>Xenix operating system.  First I'll report the disk performance in various
>configurations and then discuss how they might affect UNIX file system
>performance.  I'd like this base article to spawn a discussion about UNIX file
>system tuning on both small and large systems.
>
>The new disk is a Seagate ST251-1, 40 MB, 28 ms average access time.  The peak
>data transfer rate off the disk is 510 Kb/s (17 sect/track * 512 byte/sect *
>3,600 rev/min * 1 track/rev * 1/60 min/sec).  The measured track-to-track seek
>time is 9 ms and the measured average seek time is 28 ms.  At various sector
>interleaves the data transfer rates from disk surface to physical memory for
>full track reads are:
>                                        Effective Transfer
>                        Interleave      Rate (KB/sec)
>
>                        1:1             256
>                        2:1             254
>                        3:1             170
>                        4:1             128
>                        5:1             102
>                        6:1              85
>
>Single sector reads have the following transfer rates as a function of sector
>interleave:
>                                        Effective Transfer
>                        Interleave      Rate (KB/sec)
>
>                        1:1              28
>                        2:1              71
>                        3:1             170
>
>Note that the full track read and sector read effective transfer rates are the
>same at a 3:1 interleave.  It is also interesting that the transfer rate is
>only marginally increased changing from a 2:1 to a 1:1 sector interleave.
>
>The IBM Xenix 1.0 "mkfs" program requires "gap" and "block" parameters to build
>a file system on a disk.  To the best of my understanding, "gap" refers to the
>number of sectors between consecutive disk blocks (512 bytes on this system)
>and "block" refers to the number of disk blocks in a cylinder (102).  These
>parameters allow mkfs to maximize the data transfer rate off the disk by
>allocating disk blocks in an optimum fashion but what is optimum depends on the
>frequency of access of small and large files and the fragmentation of the file
>system.
>
>If the files usually accessed are one or two disk blocks in size or the file
>system is quite fragmented (consecutive file disk blocks are not arranged on
>consecutive disk sectors) the sector interleave should be chosen to maximize
>data transfer rates of random sector reads and the mkfs gap selected to match
>this interleave.  For the disk described above, a 3:1 interleave and gap of 2
>would be chosen.
>
>If the files usually access are always larger than a disk block and the file
>system is not fragmented the sector interleave should be chosen to maximize
>data transfer rates of full track reads and the mkfs gap selected to match this
>interleave.  Again, the disk above would be formatted with a 1:1 interleave and
>the mkfs gap chosen to be zero.
>-- 
>Home:	           andy@piziali.lonestar.org                |
>{convex,egsner,frontier,laczko}!piziali!andy  ________------+------________
>Office:                   piziali@convex.com               / \     
>           {sun,texsun,uunet}!convex!piziali              *---*
>
>
If Xenix is the same as SYS V UNIX, then "gap" for "mkfs" is NOT a
sector interleave figure.  Gap for mkfs is the number of sectors to
delay the start of the next cylinder on the disk.  Sector interleave is
a function of low level formatting the drive, while mkfs equates to a DOS
high level format.

If the amount of time it takes to move the heads from one cylinder to the
next (i.e., reading a file larger than one cylinder) allows 4.5 sectors
to pass by, a rotational "gap" of 5 would allow the fastest possible
reading of the next cylinder's data.  Conversely a rotational "gap" of 4
would force the system to wait for nearly one full revolution to start
reading the cylinder's data.

This is mostly, but not entirely separate from inter sector gap.  The
inter sector gap, or interleave, is the spacing of sectors within a
single track that allows the fastest reading of that track as a whole.
Your CPU/Controller/Drive combination determines the best interleave
value for your drive, while the chosen interleave just may influence the
optimal value of rotational "gap" for this drive.  There is no guarantee
that what works well on one drive will work well on another.  Only in
actual testing can you be sure.

Both of these items are critical in squeezing the most from your system.

If anyone is interested, I have some small programs written that test for
optimal rotational gap on a given drive.  These make a new filesystem with
"mkfs" on the drive and are guaranteed to be destructive tests.


						Hope this helps,
						Martin Zam
						(201)564-2554