Congrats! This is the final chapter.
Question 1
Exercise 8.
Q) Suppose the daytime processing load consists of 60% CPU activity and 40% disk activity. Your customers are complaining that the system is slow. After doing some research, you learn that you can upgrade your disks for $8,000 to make them 2.5 times as fast as they are currently. You have also learned that you can upgrade your CPU to make it 1.4 times as fast for $5,000.
So then, before answering the following questions let's go ahead and do some number crunching!
What we need to know here is the formula for Amdahl's Law. Remember, the overall performance of a system is a result of the interaction of all of its components. System performance is most effectively improved when the performance of the most heavily used components is improved.
With that in mind, we have this formula:
S = 1 / ((1 - f) + (f / k))
Where S is the overall speedup
f is the fraction of work performed by a faster component
k is the speedup of the faster component
Now then, let's go ahead and run this formula by both the CPU and Disk upgrades!
CPU Upgrade
Let f be 0.6 for the CPU is active 60% of the time.
Let k be 1.4 for the CPU upgrade is 1.4 times faster than the old CPU.
S = 1 / ((1 - f) + (f / k))
= 1 / (0.4 + (3/7))
= 1 / (29/35)
= 35/29
= ~1.2069
This means that we have a ~20.69% speed up for the CPU upgrade!
In this case, how much does it cost us for every 1% improvement in speed from the upgrade?
$5,000 / 20.69 = $241.66. So, every 1% improvement costs us $241.66 moneys!
Disk Upgrade
Let f be 0.4 for the disk is active 40% of the time.
Let k be 2.5 for the disk upgrade is 2.5 times faster than the old disk.
S = 1 / ((1 - f) + (f / k))
= 1/ (0.6 + 0.16)
= 1 / 0.76
= ~1.3158
This means that we have a ~30.58% speed up for the disk upgrade!
In this case, how much does it cost us for every 1% improvement in speed from the upgrade?
$8,000 / 30.58 = $253.32. So, every 1% improvement costs us $253.32 moneys!
Answers
Now armed with our calculations, we can wrap this up!
a) Which would you choose to yield the best performance improvement for the least amount of money?
Answer: CPU Upgrade. The reason is that $241.66 < $253.32. We get more bang for our buck since the CPU is technically cheaper per 1% of improvement.
b) Which option would you choose if you don't care about the money, but want a faster system?
Answer: Disk Upgrade. Reason being that a 31.58% improvement is > a 20.69% improvement. Since money is no issue, we can spring for the that extra ~10% of speed!
c) What is the break-even point for the upgrades? That is, what price would we need to charge for the CPU (or the disk —change only one) so the result was the same cost per 1% increase for both?
We can do a little bit of algebra to solve this! Let the numerator be the overall speedup from the upgrade and the denominator be the cost for the upgrade.
20.69 / a = 31.58 / 8000 =>
31.58a = 165520 =>
a = 5241.29
We need to charge $5241.29 for the CPU upgrade to break even!
Question 2
Exercise 48.
a) Which of the RAID (Redundant Array of Independent Disks) systems described in this chapter cannot tolerate a single disk failure:
Answer: Raid Level 0. It has no redundancy so if any of the disks fail then it's YOU DIED! At least it's fast....
b) Which can tolerate more than one simultaneous disk failure?
This question was one I was rather confused by. In the very least, the professor gave me full credit on the lab so rest easy that the following are correct.
Raid Level 6, 2, 1, and Raid DP.
Level 6 and DP are rather similar. Just note that they both are equiped to handle 2 disks failing at the same time.
Level 1 is interesting for it can handle multiple disk failures so long as it does not involve a disk and its mirror image. The idea of level 1 is that we keep an exact copy of each disk so if it just so happens that all the disks are destroyed except for their mirror image, then all is well!
Level 2... This one I don't quite understand why it works. I need to do some additional research. However, it too can handle multiple simultaneous disk failures.