The Cost of Disk Accesses


The following two cases give studies of the cost of disk accesses:
  1. Sequential Accesses Assume that
    • files are stored in a disk sector by sector in sequence,
    • there are 512 bytes per sector, and
    • there are 170 sectors per track.
    Calculate the time to read a 8704-kilobyte file:

        Time for finding and reading a track
    = Average seek time + Rotational delay + Time for reading a track
    = 8 msec + 3 msec + 6 msec = 17 msec

    Total time = [8704000 / (512 × 170)] × 17 = 1700 msec = 1.7 seconds


  2. Random Accesses Rather than being able to read one sector right after another, this question assumes that we have to access the records in an order that requires jumping from track to track every time we read a new cluster. Again, the following assumptions are needed:
    • A cluster has 8 sectors, which contains 4096 bytes.
    • The file is divided into 34000 256-byte records.
    • Each cluster contains one record of the file.
    Calculate the time to read a 8704-kilobyte file:

        Time for finding and reading a cluster
    = Average seek time + Rotational delay + Time for reading a cluster
    = 8 msec + 3 msec + [8 × (1/170) × 6 msec] = 11.28 msec

    Total time = 34000 × 11.28 = 383520 msec = 383.5 seconds
If we can get to the right location on the disk and read a lot of information sequentially, we are clearly much better off than if we have to jump around, seeking every time we need a new record.