Discussion: Week 8 - Disk Systems - Solutions
Disk Transfer Rate
Suppose a hard disk drive has the following characteristics:
- 2 platters (4 heads = 4 tracks/cylinder)
- 16383 cylinders
- 64 sectors/track
- 512 bytes/sector
- Rotational speed = 7200 rpm = 120 rps
- Average seek time: 10ms
- Adjacent cylinder seek time: 1ms
- Head switch time: 0.1ms
How much data can this disk hold?
b = 16383 * 4 * 64 * 512 = 2,147,352,576 bytes = 1.9999GB
Calculate the sustained transfer rate (no initial seek, sequential
access across entire disk).
For every track, the disk must spin twice - once to line up the data
and once to seek to the next track. The disk spins once every 8.3ms,
and sectors go by in 0.13ms. That means that even with only a head
switch, the first sector on the next track will already be past after
the head switch and we need the rest of the rotational delay anyway.
Transfer time T = (16383*(4+4)*Tr) = 1092.2 sec
Transfer rate RS = b/T = 1,966,080 bytes/sec = 1.875MB/sec
Now suppose that the last sector on each track is left blank, so in
essence we now have 63 sectors per track with a one-sector gap at the
end of the track. How much data can this new disk hold?
Calculate the sustained transfer rate for this 63-sector/track disk.
Now a head switch can occur during the time it takes to traverse the gap,
eliminating the rotational delay due to head switching. A full rotational
delay is still necessary for adjacent cylinder seeks.
Transfer time T = 16384*(4+1)*Tr = 682.625 sec.
Transfer rate RS = b/T = 3,145,728 bytes/sec = 3MB/sec
RAID
Here is a summary of the different RAID levels for your convenience:
- Data striped across n disks, no redundancy
- RAID 0 + mirrors (n extra disks)
- RAID 0 + error-correcting codes (log n extra disks)
- RAID 0 + parity (1 extra disk)
- RAID 3 with large strips (block-level parity, 1 extra disk)
- RAID 4 with parity strips distributed among all disks (1 extra disk)
- RAID 5 with dual parity (2 extra disks)
What RAID level would you use for the following applications and why?
There are many answers to this question. These are what I would use.
- Streaming media internet server
RAID 4 - Fast for multiple connections, good availability,
and we don't care about the write cost.
- Bank record database server
RAID 6 - Fast for multiple transactions, best failure
tolerance, doesn't have RAID 1's complete synchronizion
requirement for writing.
- Small business video editing box
RAID 0 - Low cost, high performance for one application,
data loss is inconvenient but not catastrophic, as the video
exists elsewhere, such as on DV cameras.
Suppose disk 2 goes down in a 5-disk RAID 3 array. The contents of the
remaining disks are:
X0(i) = 11001001
X1(i) = 10101010
X3(i) = 11111111
X4(i) = 00000000
Reconstruct X2(i).
11001001
10101010
11111111 (remember XOR is associative and commutative, like +)
XOR 00000000
------------
10011100
Disk Scheduling
Schedule the following sequence of requests using FCFS, SSTF and SCAN:
(Assume the starting position is 100 in the "up" direction)
| FCFS
| SSTF
| SCAN
|
---|
110 | 110 | 110 | 110
| 5 | 5 | 57 | 176
| 32 | 32 | 48 | 205
| 205 | 205 | 32 | 57
| 176 | 176 | 23 | 48
| 3 | 3 | 5 | 32
| 1 | 1 | 3 | 23
| 57 | 57 | 1 | 5
| 23 | 23 | 176 | 3
| 48 | 48 | 205 | 1
| total seek length: | 634 | 323 | 309
|
|