Single server model Queue Server I/O Controller And device Arrivals
Timesys = Timeq + Times
Times = Average time to server task Timeq = Average time per task in the queue Timesys= Aver time /task Arrival Rate = λ = Average number of arriving tasks Lengths = Average number of task in service Lengthq = Average length of queue Lengthsys= Lengths +Lengthq
Server Utilization = Arrival Rate x Times
Example#1 Problem Statement Suppose an I/O system with a single disk gets on average 100 I/O requests/second. Assume that average time for a disk to service an I/O request is 5ms. What is the utilization of the I/O system?
Solution Time for an I/O request = 5ms =0.005sec Server utilization = 100 x 0.005 = 0.5
Poisson Distribution Probability (k)= (e-k x ak) /k! a= Rate of events x Elapsed time
Variance C2 = (Arithmetic mean time)2
Average Residual Service Time = ½ x weighted mean time x (1+C2)
All the tasks in the queue ahead of the new task must be completed. Each task takes on average Times. A task on server takes average residual service time to complete. The chance that the server will be busy is called server utilization.
Timeq = Lengthq x Times + (Server utilization x Average residual service time ) Suppose: Server utilization = β Average residual = λ service time
Timeq = server utilization x times + (Arrival time x Time q) x Times Timeq = β x Times + (Arrival time x Timeq) x Times Timeq = (Times x β ) / (1 – β)
Example#2 For the system of previous example having server utilization of 0.5, what is the mean number of I/O requests in the queue?
Solution (Server utilization )2 Lengthq = (1- Server utilization )
Example#3 Suppose a processor sends 10 disk I/O per second, these requests are exponentially distributed, and the average service time of an older disk is 10ms. Answer the following questions: What is the number of requests in the queue? What is the average time a spent in the queue? What is the average response time for a disk request?
Solution Average number of arriving tasks/second = 20 Average disk time = 10ms = 0.01sec Sever utilization = 20 x 0.01=0.2 Timeq = 10ms x 0.2/(1-0.2) = 2.5ms Average response time = 2.5+10=22.5ms
M/M/m Model of Queuing Theory Arrival Rate x Time Utilization = Nserver
M/M/m Model of Queuing Theory Lengthq = Arrival Rate x Timeq (Time s x (Ptasks>= Ns)) Timeq = Ns x (1- utilization)
M/M/m Model of Queuing Theory Ns x utilization Probtasks>= Ns = x Prob0task Ns! x (1-utilization)
Example#4 Suppose instead of a new, faster disk, we add a second slow disk, and duplicate the data so that read can be serviced by either disk. Let’s assume that the requests are all reads. Recalculate the answers to the earlier questions, this time using an M/M/m queue.
Solution The average utilization of the two disks is given as; Arrival rate x Times Server utilization = ---------------------------- Ns = (40 x 0.02) / 2 = 0.4
Probability of no tasks in the queue (2 x utilization)2 Prob0tasks = 1 + ------------------------- 2! x (1- utilization) (2 x utilization)n + --------------------- n! -1
(2x 0.4) 2 Prob0tasks = 1 + ---------------- + (2 x 0.4) 2! X (1- 0.4) = (1 + 0.533 + 0.800 ) -1 = 2.333-1 -1
(2 x utilization)2 Prob tasks >=Ns = ------------------------- x Prob0tasks 2! x (1- utilization) (2x 0.4) 2 = ---------------- x 2.333-1 2! x (1- 0.4) = 0.229
Time waiting in the queue: Prob tasks >=Ns Time q = Times x ---------------------------- Ns x (1- utilization) = 0.020 x 0.229/ ( 2 x 0.6) = 3.8msec Average response time = 20msec + 3.8msec = 23.8msec
Bench Mark=C: Complex query OLTP Data Size (GB) = 100-3000 Performance metric = New order transaction per minute Date of 1st result = 1992
TPC-C TPC-C is measured In transaction per min (tpm). In price of system, including hardware, and software.
Synchronous I/O The operating system requests the data Then switches to another process When requested data arrives, then operating switches back to the requesting process.
Asynchronous I/O Allows the processor to make continuous requests. Shares the same philosophy as caches in out-of- order CPUs.