1 / 31

COMP60611 Fundamentals of Parallel and Distributed Systems

COMP60611 Fundamentals of Parallel and Distributed Systems. Lecture 14 Queueing Theory: Part 2 John Gurd, Graham Riley Centre for Novel Computing School of Computer Science University of Manchester. Analysis of M/M/1 Queue. Diagrammatic representation of the queue at any particular time:

lsolis
Download Presentation

COMP60611 Fundamentals of Parallel and Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMP60611Fundamentals of Paralleland Distributed Systems Lecture 14 Queueing Theory: Part 2 John Gurd, Graham Riley Centre for Novel Computing School of Computer Science University of Manchester

  2. Analysis of M/M/1 Queue • Diagrammatic representation of the queue at any particular time: queue service queue service XXXX X - 4 in queue, none in queue,1 being served none being served • We wish to trace the queue behaviour over time and, hopefully, identify long-term steady-state characteristics. • At time t, let N(t) be a random variable that describes the number (of customers) in the system. Q(t) is a related random variable that describes the number in the queue:

  3. Analysis of M/M/1 Queue • N(t) increases by 1 with each arrival and decreases by 1 with each service completion. N(t) 5 4 3 2 1 A1 A2 A3 A4 A5 S1 A6 S2 S3 …… S6 t • This diagram could represent a general G/G/1 queue. • It will represent an M/M/1 queue if the inter-arrival times A2-A1, A3-A2, … and the service times S1-A1, S2-S1, S3-S2, … both satisfy negative exponential distributions.

  4. Analysis of M/M/1 Queue

  5. Analysis of M/M/1 Queue

  6. Analysis of M/M/1 Queue

  7. Analysis of M/M/1 Queue is referred to as the traffic intensity.

  8. Some Interesting Consequences

  9. Some Interesting Consequences

  10. Simple Example • That’s a lot of theory! What does it all mean? • Consider a TV repair shop. TVs arrive for repair at random at an average rate of 4 per day (assume an 8 hour day). A single repair service does the repairs; the average time for repair is 1.5 hours and repair times satisfy a negative exponential distribution. • Arrivals:  = 0.5 (0.5 sets per hour in the 8 hour day) • Service:  = 2/3 (0.667 repairs per working hour – the average repair time is 1/ = 1.5 working hours).

  11. TV Repair Shop Example 0 2 4 6 8 10

  12. TV Repair Shop Characteristics • Hence, traffic intensity ρ = / = 0.5/0.667 = 0.75 (75%). • Expected number of TV sets in system = L = ρ/(1 – ρ) = 0.75/0.25 = 3.00. • Expected number of TV sets in queue = L – ρ = 2.25. • Mean queueing time = /{( – )} = 0.5/{0.67(0.67 – 0.5)} = 0.5/{0.667*0.183} = 4.5 hours. • Mean time in system = 1/( – ) = 1/(0.667 – 0.5) = 6 hours.

  13. TV Repair Shop Characteristics

  14. Analysis of M/M/k Queue • We have shown how to analyse a very simple system: M/M/1 queue • We now consider a more challenging and more concurrent scenario: M/M/k queue Arrival of Customers

  15. System Characteristics • Arrivals: Customers arrive, at random, at a rate ; i.e. random arrivals with inter-arrival time a random variable with a negative exponential distribution with parameter . They form a single queue for the multiple servers. • Service: Served by one of k service points, each having a service time which is a random variable with negative exponential distribution with (the same) parameter . • Assuming that  < k (the arrival rate is less than the cumulative service rate), there exists a steady state solution.

  16. Analysis of M/M/k Queue

  17. Analysis of M/M/k Queue

  18. Analysis of M/M/k Queue

  19. Simple Example • (See Sasieni, Yaspan & Friedman, 1959). An insurance company has two claims adjusters in its branch office. People with claims arrive in Poisson fashion at an average rate of 20 per 8 hour working day. The length of time an adjuster spends with each claimant satisfies a negative exponential distribution with a mean service time of 40 minutes. What is the average time in the queue and what is the average time in the system? How would this vary if the company employed an extra claims adjuster? • Arrivals:  = 2.5 (2.5 claimants per hour in the 8 hour day) • Service:  = 1.5 (1.5 claims per working hour – the average service time is 1/ = 0.667 working hours).

  20. Characteristics

  21. Characteristics

  22. Effect of an Extra Adjuster

  23. Effect of an Extra Adjuster

  24. Discrete Event Simulation • Thus far, our models of queueing systems have been analytical (and simple); in particular, the assumptions about queueing behaviour and service behaviour have been especially simple. • The behaviour of the queue has been described by equations that have been capable of solution, so that we have been able to predict useful quantities, such as mean queueing time, mean queue length, etc. • The models have enabled the solution of “what if” questions, such as “what happens if we increase the number of service points?”

  25. Discrete Event Simulation • Yet, the analysis was already beginning to get unwieldy! • In real life, queueing systems are fundamentally too complicated to be modelled by such relatively simple analytical models. • The only way to capture the behaviour of more complicated, and complex, queueing systems is by means of simulation models. • This means of study has become known as Discrete Event Simulation.

  26. Discrete Event Simulation • Build a (computational) simulation model so that the behaviour of the simulation model replicates the behaviour of the real system as far as the properties being modelled are concerned. • The simulation model includes parameters such as average arrival rate, average service time, number of service points, etc. • Model inter-arrival times according to some suitable probability distribution, and model service times in a similar way – Monte Carlo simulation. • Evolve the simulation system by tracking from one event to the next: • Arrival  if there is an available server, go to be served, else enter queue; • Service completion  leave system and, if queue is not empty, begin new service for the task at the head of the queue.

  27. Discrete Event Simulation • Suppose inter-arrival times satisfy a negative exponential distribution with parameter . • Determine a random number that is uniformly distributed in the range [0,1] and use this to predict the inter-arrival time and, hence, the next arrival (see graph on next slide). • Model service times in a similar way: a negative exponential distribution with parameter .

  28. Pr{arrival in (0,t)} 0 2 4 6 8 10 inter-arrival time

  29. Discrete Event Simulation • Thus, given the first arrival (at time t = 0), we can use the sequence of predicted inter-arrival times to predict all subsequent arrival times. • Each arrival enters an ordered queue. • Customers/tasks are removed from the head of the queue whenever there is an available service point. • The time to complete a service is predicted in a similar fashion to the prediction of inter-arrival times, but with a parameter , rather than . • The same uniform random number generator can be used to drive both predictions (inter-arrival times and service times).

  30. Discrete Event Simulation • Discrete event simulation is used in many contexts. • A typical example is given by one of our current research projects, which is using a discrete event simulation package called SimGrid to model the scheduling of the computational tasks constituting a large concurrent application to some number of heterogeneous parallel processors, as typified by the architecture of a modern HPC (High Performance Computing) system. The concurrent tasks are represented by the nodes of a DAG (directed acyclic graph), and the data dependencies between the tasks are represented by the arcs of the DAG. The objective is to schedule the nodes of the DAG to the heterogeneous processors in such a way as to minimise the overall execution time.

  31. Summary • Queueing systems occur in many different situations in real life, and it is frequently necessary to anticipate the way that such systems will behave in practical scenarios. • We have introduced queueing theory as a useful vehicle for analysing the behaviour of (relatively simple) queueing systems. • We have further introduced Discrete Event Simulation as a means of approaching more complicated queueing systems, where analysis becomes too difficult.

More Related