Presentation is loading. Please wait.

Presentation is loading. Please wait.

Single server model Queue Server I/O Controller And device Arrivals.

Similar presentations


Presentation on theme: "Single server model Queue Server I/O Controller And device Arrivals."— Presentation transcript:

1 Single server model Queue Server I/O Controller And device Arrivals

2 Timesys = Timeq + Times

3 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

4 Server Utilization = Arrival Rate x Times

5 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?

6 Solution Time for an I/O request = 5ms =0.005sec
Server utilization = 100 x 0.005 = 0.5

7 Poisson Distribution Probability (k)= (e-k x ak) /k!
a= Rate of events x Elapsed time

8 Variance C2 = (Arithmetic mean time)2

9 Average Residual Service Time
= ½ x weighted mean time x (1+C2)

10 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.

11 Timeq = Lengthq x Times + (Server utilization x Average residual service time ) Suppose: Server utilization = β Average residual = λ service time

12 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 – β)

13 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?

14 Solution (Server utilization )2 Lengthq = (1- Server utilization )

15 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?

16 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 = =22.5ms

17 M/M/m Model of Queuing Theory
Arrival Rate x Time Utilization = Nserver

18 M/M/m Model of Queuing Theory
Lengthq = Arrival Rate x Timeq (Time s x (Ptasks>= Ns)) Timeq = Ns x (1- utilization)

19 M/M/m Model of Queuing Theory
Ns x utilization Probtasks>= Ns = x Prob0task Ns! x (1-utilization)

20 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.

21 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

22 Probability of no tasks in the queue
(2 x utilization)2 Prob0tasks = 2! x (1- utilization) (2 x utilization)n n! -1

23 (2x 0.4) 2 Prob0tasks = 1 + ---------------- + (2 x 0.4) 2! X (1- 0.4)
= ( ) -1 = -1

24 (2 x utilization)2 Prob tasks >=Ns = x Prob0tasks 2! x (1- utilization) (2x 0.4) 2 = x 2! x (1- 0.4) =

25 Time waiting in the queue:
Prob tasks >=Ns Time q = Times x Ns x (1- utilization) = x 0.229/ ( 2 x 0.6) = 3.8msec Average response time = 20msec + 3.8msec = 23.8msec

26 Bench Mark=C: Complex query OLTP
Data Size (GB) = Performance metric = New order transaction per minute Date of 1st result = 1992

27 TPC-C TPC-C is measured In transaction per min (tpm).
In price of system, including hardware, and software.

28 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.

29 Asynchronous I/O Allows the processor to make continuous requests.
Shares the same philosophy as caches in out-of- order CPUs.


Download ppt "Single server model Queue Server I/O Controller And device Arrivals."

Similar presentations


Ads by Google