Question: Getting good disk performance often requires amortization of overhead. The idea is simple: if you must incur an overhead of some kind, do as much
In this exercise, we focus on how to amortize seek and rotational costs during the second pass of a two-pass sort. Assume that when the second pass begins, there are N sorted runs on the disk, each of a size that fits within main memory. Our task here is to read in a chunk from each sorted run and merge the results into a final sorted output. Note that a read from one run will incur a seek and rotation, as it is very likely that the last read was from a different run.
a. Assume that you have a disk that can transfer at 100 MB/sec, with an average seek cost of 7 ms, and a rotational rate of 10,000 RPM. Assume further that every time you read from a run, you read 1 MB of data, and that there are 100 runs each of size 1 GB. Also assume that writes (to the final sorted output) take place in large 1 GB chunks. How long will the merge phase take, assuming I/O is the dominant (i.e., only) cost?
b. Now assume that you change the read size from 1 MB to 10 MB. How is the total time to perform the second pass of the sort affected?
c. In both cases, assume that what we wish to maximize is disk efficiency. We compute disk efficiency as the ratio of the time spent transferring data over the total time spent accessing the disk. What is the disk efficiency in each of the scenarios mentioned above?
Step by Step Solution
3.51 Rating (174 Votes )
There are 3 Steps involved in it
a We assume the disk is the bottleneck and that it is kept busy at all times When we read a chunk fr... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
903-C-S-S-A-D (3248).docx
120 KBs Word File
