This homework is based on the ZCAV tool: see ZCAV documentation here.
Background
Given constant rotational speed
(constant angular velocity, CAV) of a magnetic disk, the head can cover larger
distance on the outer tracks in the same time, compared to the inner
tracks.
If the sector density on all tracks is same, this would cause space
wastage on the outer tracks (as their density would be limited by the inner
tracks).
To deal with this situation, modern disks divide their tracks into
zones. The inner zones have lower angular sector density, while the outer
zones have higher angular sector density. Effectively, this means that the disk
throughput at the outer zones is higher. This is also called
zoned constant angular velocity (ZCAV).
To take advantage of this, the disk controllers usually map the
lower sector numbers (starting from sector number zero) on the outer
tracks, while the higher sector numbers are mapped to inner tracks. The
thinking being that the lower sector numbers are likely to have higher
frequency of access. Notice that this is just an assumption and may not
be true!
ZCAV program measures the disk throughput at different sector
numbers. To do this, it reads/writes 256MB (default) worth of data starting
at sector X
, where X
is varied from 0 to disk-size.
You can see the results of running ZCAV on some disk configurations
here.
Turn in
Run ZCAV using the following command for the following types of disks:
Report all results as graphs as at this URL. Feel free to use the GNUPlot scripts available
at this URL (e.g., command.gnuplot.zcav).
In particular, how many zones do you find? What is the mapping between
sector numbers and physical disk layout? What are the corresponding
disk bandwidths? Anything else you notice?
Finally, explain the different behaviour in different environments.
Tips
- Downloading and Installing: download this tarball, and type the following commands:
- Running:
sudo ./zcav /dev/sda
(replace sda
with sdb
, hda
, etc. depending on the disk being tested).
- You only need to test the read performance (not write).
- You may first want to setup the experiment on your private machine
before experimenting on GCL. Note that one experiment can take hours to
complete, so plan in advance on accessing the GCL machine.
- While zcav is running, you may want to check that your CPU is not
bottlenecked (i.e., utilization is below 100\%) using
top
.
Also, you may want to check that no other IO-intensive operation is running
using iotop
.
Fun
This part is optional. If you do these, feel free to submit your results.
- Can you modify the ZCAV program to estimate the seek and latency of
the magnetic disk? How? What were your results?
- Try the same experiments for writes (instead of reads). Do your results
differ? For which environments? Why? Warning: writes will overwrite your
filesystem and can potentially make the FS unusable. So any write
experiments should not be done on the disk containing the current FS.
- Try the same experiments on filesystems (instead of raw
disks as above). Here, you would need to create a large file, and then
use the command:
./zcav filename
.
- Try for different filesystems and different FS options: in particular,
try for ext4 ordered mode vs. ext4 default mode.