George Mason University Department of Computer Science Operating Systems Prof. Daniel A. Menasce' Assignment on Performance Evaluation of Multiprogrammed OSs Consider that a multiprogrammed operating system is used to support an online reservation system. The system has one CPU and two disks. Each airline reservation request uses 0.1 sec of CPU time, accesses disk 1 twice and disk 2 once. Both disks are identical. Their physical characteristics are: 20 msec of average seek time, 8.33 msec of latency time, and 5 MBytes/sec transfer rate. The service time Si for a disk i can be computed as Si = avg. seek + latency + (record_size / transfer_rate) The record size is equal to 2Kbytes on access to disk 1 and 4KBytes on accesses to disk 2. Plot graphs of the average response time and the average throughput as a function of the degree of multiprogramming. What is the bottleneck? How would these graphs change if you changed the system configuration (e.g. upgrading the CPU, adding more disks, etc)? To answer these questions you should use the theory of Mean Value Analysis explained below. For more details on this you can refer to chapter 5 of the book ``Capacity Planning and Performance Modeling: from mainframes to client-server systems'', Menasce, Almeida, and Dowdy, Prentice-Hall, 1994. Let us start by defining some terms and notation. The total time a job (or process) spends at a device (e.g. CPU or disk) receiving service is called the job's service demand and is denoted by Di for the service demand at device i. The service demand does not include any queuing time for the device. It is just service. The service demand is equal to the average number of times a job uses the device multiplied by the average time spent per visit to the device. For example, if a job uses a certain disk three times on the average, and if the job spends 30 msec being served, i.e. using the disk, each of the three times, the job's service demand at the disk is 90 msec. Let us define response time, denoted by R0, as the total time spent by a job in the system. This includes the time spent getting service at each device over all visits to all devices (i.e. the sum of all service demands) plus the time spent in the queues for all devices. Let residence time at device i, Ri, be defined as the total time spent by a job at device i (queuing and getting service) over all visits to that device. Let the system throughput, X0, be defined as the average number of jobs executed per unit time. Let ni be the average number of jobs at device i (this also includes the job that is using the device). The following three equations, known as Mean Value Analysis (MVA) equations, developed by Reiser and Lavenberg in 1980, allow us to obtain the performance of a multiprogrammed computer system. Equation 1: Residence Time Equation Ri (n) = Di [ 1 + ni(n-1)] where Ri (n) is the residence time at device i when the degree of multiprogramming is equal to n, and ni(n-1) is equal to the average number of jobs at device i when the degree of multiprogramming is equal to n-1. Equation 2: Throughput Equation X0 (n) = n/sum_i Ri (n) where X0 (n) is the throughput when the degree of multiprogramming is equal to n. The sum in the denominator is over all devices. Equation 3: Avg. Number of Jobs at a Device Equation ni (n) = X0(n) Ri(n) Note that the notation Ri(n), X0(n), ni(n) is a functional notation. So, Ri(n) means that Ri is a function of the degree of multiprogramming n. Also ni(n-1) stands for the number of jobs at device i when the degree of multiprogramming is equal to n-1. It is clear that when the degree of multiprogramming is equal to zero (n=0) the average number of jobs at any device is also zero. Thus, ni(0) = 0 for every device i. This means that we can compute Ri(1) using equation 1 since Ri(1) depends on ni(0) which we know is zero. So we can compute Ri(1) for all i's. Therefore we can compute Xo(1) using equation 2 as 1/sum_i Ri(1). With X0(1) and Ri(1) we can use equation 3 to compute ni(1) for all i's. With ni(1) we can now go back to equation 1 and compute Ri(2) since we already have ni(1). With the Ri(2) for all i's we compute X0(2) from equation 2, and from equation 3 we obtain ni(2) for all i's. You get the idea now. Write a program that takes as inputs the service demands for the problem described in the assignment and computes the values of Ri(n), X0(n), and ni(n) for n starting from 0 up to a given maximum degree of multiprogramming. Note that the response time R0 (n) is simply R0(n) = \sum_i Ri(n) Instead of writing a program you can also use a spreadsheet. This would be even better since it would allow you to easily plot the results. Include the source code for your program or the spreadsheet as an appendix to your solution.