CS 241 Spring 2007 System Programming 1 Queuing Framework for Process Management Evaluation Lecture 20 Klara Nahrstedt.

Slides:



Advertisements
Similar presentations
Lecture 5 This lecture is about: Introduction to Queuing Theory Queuing Theory Notation Bertsekas/Gallager: Section 3.3 Kleinrock (Book I) Basics of Markov.
Advertisements

Lecture 10 Queueing Theory. There are a few basic elements common to almost all queueing theory application. Customers arrive, they wait for service in.
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Model Antrian By : Render, ect. Outline  Characteristics of a Waiting-Line System.  Arrival characteristics.  Waiting-Line characteristics.  Service.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 19 Performance of Computer Systems.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
1 Performance Evaluation of Computer Networks Objectives  Introduction to Queuing Theory  Little’s Theorem  Standard Notation of Queuing Systems  Poisson.
1 Queuing Theory 2 Queuing theory is the study of waiting in lines or queues. Server Pool of potential customers Rear of queue Front of queue Line (or.
To accompany Quantitative Analysis for Management, 8e by Render/Stair/Hanna 14-1 © 2003 by Prentice Hall, Inc. Upper Saddle River, NJ Chapter 14.
Data Communication and Networks Lecture 13 Performance December 9, 2004 Joseph Conron Computer Science Department New York University
1 Queueing Theory H Plan: –Introduce basics of Queueing Theory –Define notation and terminology used –Discuss properties of queuing models –Show examples.
Management of Waiting Lines
Performance Evaluation
Queuing. Elements of Waiting Lines  Population –Source of customers Infinite or finite.
7/3/2015© 2007 Raymond P. Jefferis III1 Queuing Systems.
To accompany Quantitative Analysis for Management, 9e by Render/Stair/Hanna 14-1 © 2003 by Prentice Hall, Inc. Upper Saddle River, NJ Chapter 14.
Queuing Theory. Queuing theory is the study of waiting in lines or queues. Server Pool of potential customers Rear of queue Front of queue Line (or queue)
Introduction to Queuing Theory. 2 Queuing theory definitions  (Kleinrock) “We study the phenomena of standing, waiting, and serving, and we call this.
Chapter 9: Queuing Models

Queuing Models and Capacity Planning
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Queueing Systems.
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Queuing Theory Basic properties, Markovian models, Networks of queues, General service time distributions, Finite source models, Multiserver queues Chapter.
IE 429, Parisay, January 2010 What you need to know from Probability and Statistics: Experiment outcome: constant, random variable Random variable: discrete,
1 Queuing Models Dr. Mahmoud Alrefaei 2 Introduction Each one of us has spent a great deal of time waiting in lines. One example in the Cafeteria. Other.
Waiting Lines and Queuing Models. Queuing Theory  The study of the behavior of waiting lines Importance to business There is a tradeoff between faster.
1 Queuing Systems (2). Queueing Models (Henry C. Co)2 Queuing Analysis Cost of service capacity Cost of customers waiting Cost Service capacity Total.
1 Chapters 8 Overview of Queuing Analysis. Chapter 8 Overview of Queuing Analysis 2 Projected vs. Actual Response Time.
Machine interference problem: introduction
CSCI1600: Embedded and Real Time Software Lecture 19: Queuing Theory Steven Reiss, Fall 2015.
Waiting Lines and Queuing Theory Models
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Dr. Anis Koubâa CS433 Modeling and Simulation
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Queueing Systems.
1 1 Slide Chapter 12 Waiting Line Models n The Structure of a Waiting Line System n Queuing Systems n Queuing System Input Characteristics n Queuing System.
Operating Systems CPU Scheduling Algorithms
Queuing Models.
Simple Queueing Theory: Page 5.1 CPE Systems Modelling & Simulation Techniques Topic 5: Simple Queueing Theory  Queueing Models  Kendall notation.
Queuing Theory Simulation & Modeling.
Scheduling.
OPERATING SYSTEMS CS 3502 Fall 2017
WAITING LINES AND SIMULATION
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
Prepared by Lloyd R. Jaisingh
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Management of Waiting Lines
Queuing Theory Queuing Theory.
Chapter 9: Queuing Models
HW1 and Synchronization & Queuing
Internet Queuing Delay Introduction
CSCI1600: Embedded and Real Time Software
Chapter 6: CPU Scheduling
Queuing models Basic definitions, assumptions, and identities
Queuing models Basic definitions, assumptions, and identities
Variability 8/24/04 Paul A. Jensen
Lecture 2 Part 3 CPU Scheduling
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
Single server model Queue Server I/O Controller And device Arrivals.
Lecture 18 Syed Mansoor Sarwar
Uniprocessor scheduling
Waiting Line Models Waiting takes place in virtually every productive process or service. Since the time spent by people and things waiting in line is.
Queuing Models J. Mercy Arokia Rani Assistant Professor
VIRTUE MARYLEE MUGURACHANI QUEING THEORY BIRTH and DEATH.
Presentation transcript:

CS 241 Spring 2007 System Programming 1 Queuing Framework for Process Management Evaluation Lecture 20 Klara Nahrstedt

2 CS241 Administrative  Read Stallings Chapter 9  No Quizzes this week, the next quiz will be on Monday 3/12 on SMP5

3 Content of This Lecture Goals: Introduction to Principles for Reasoning about Process Management/Scheduling Things covered in this lecture Introduction to Queuing Theory

4 Process States Finite State Diagram

5 Queuing Models and Simulation Problem – How do we size the ready queue, size any queue? decide how many jobs should be accepted? analyze scheduling algorithms? Decide how long we should wait for a job? Goals Simple arithmetic (‘back of envelope calculation’) to calculate system behavior Basis for more complex analysis Approach to study systems too complex to produce simple mathematical model

6 CPU Scheduler Example Which is better: Round Robin or FIFO? How long does A take to go thru system? How big should be the ready queue? Mean, Mode, Variance?

7 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

8 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

9 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

10 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

11 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

12 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

13 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

14 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

15 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

16 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

17 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

18 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

19 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

20 Queuing Diagram for Processes Start Ready Queue Event Queue Event Exit Time Slice CPU

21 Queueing Model Random Arrivals and the Poisson Distribution Elements of model

22 Discussion If a bus arrives at a bus stop every 15 minutes, how long do you have to wait at the bus stop assuming you start to wait at a random time?

23 Discussion What assumption have you made about the bus?

24 Hamburger Problem 7 Hamburgers arrive on average every time unit 8 Hamburgers are processed by Joe on average every unit 1) Av. time hamburger waiting to be eaten? (Do they get cold?) Ans = ???? 2) Av number of hamburgers waiting in queue to be eaten? Ans = ???? Queue 7 8

25 Hamburger Problem 7 Hamburgers arrive on average every time unit 8 Hamburgers are processed by Joe on average every unit 1) How long is a hamburger waiting to be eaten? (Do they get cold?) Ans = 7/8 time units 2) How many hamburgers are waiting in queue to be serviced? Ans = 49/8 Queue 7 8

26 Random Events Poisson Distribution Each event independent of other events Mean event rate, SD is same as mean Exponential distribution

27 Queuing Theory ARRIVAL RATE ARRIVAL RATE SERVICE RATE  Input Queue Server Single Server Queue

28 Queueing Theory (Point of Interest) Steady state Poisson arrival with constant arrival rate (customers per unit time) each arrival is independent. P(  t ) = 1- e – t 0 1 t Av λ 0.5

29 Analysis of Queueing Behavior Probability n customers arrive in time interval t is: e – t  t  n / n! Assume random service times (also Poisson):  constant service rate (customers per unit time)

30 Useful Facts From Queuing Theory W q = mean time a customer spends in the queue = arrival rate L q = W q number of customers in queue W = mean time a customer spends in the system L = W ( Little's theorem) number of customers in the system In words – average length of queue is arrival rate times average waiting time

31 Analysis of Single Server Queue Server Utilization: Time in System: Time in Queue: Number in Queue (Little):

32 Example: How busy is the server? λ =2 μ=3 = 2/3 or 66% Busy

33 How long is an eater in the system? λ =2 μ=3 = 1/(3-2)= 1

34 How long is someone in the queue? λ =2 μ=3

35 How many people in queue? λ =2 μ=3

36 How many people in queue? λ =2 μ=2

37 Interesting Fact If Arrival Rate = Service Rate, the queue length become infinitely large the longer you run the model.

38 Until Now We Looked at Single Server, Single Queue Theory ARRIVAL RATE ARRIVAL RATE SERVICE RATE  Input Queue Server

39 Poisson Arrivals Sum ARRIVAL RATE 1 SERVICE RATE  Input Queue Server ARRIVAL RATE 2 = 1+ 2 = 1+ 2

40 Example Arrival 1 jobs/sec from Start Arrival 2 jobs/sec from Event queue Service 4 jobs/sec Utilization? Time in system? Time in queue ? Length of queue?

41 Example Arrival 1 jobs/sec from Start Arrival 2 jobs/sec from Event queue Service 4 jobs/sec –Utilization=ρ=λ/μ=1+2/4=.75 –Time in system=1/(μ-λ)=1 –Time in queue=ρ/(μ-λ)=.75 –Length of queue=ρ*ρ/(1-ρ)=2.25

42 As long as it’s a Poisson Distribution... ARRIVAL RATE ARRIVAL RATE SERVICE RATE  1 Input Queue Server Server SERVICE RATE  2 Combined  =  1+  2

43 Question: MacDonalds Problem μ μ μ μ μ μ λ λ λ λ λ λ A) Separate Queues per Server B) Same Queue for Servers If W is waiting time for system A, and W is waiting time for system B, what is W/W B ? Integer answer; W A > W B ? If W A is waiting time for system A, and W B is waiting time for system B, what is W A /W B ? Integer answer; W A > W B ?

44 Queuing Diagram for Processes Start Event Queue Exit Time Slice ARRIVAL RATE ARRIVAL RATE SERVICE RATE  SERVICE RATE  1 ARRIVAL RATE 1

45 Queuing Diagram for Processes Ready Queue I/O request in Device Queue Time Slice Expired Fork a Child Wait for an InterruptInterruptOccurs CreateChild CPU I/O UpdateAccounting Create Job

46 Simulations – instead of maths Complicated logic and conditions about events- Write program that simulates events While not end Advance Clock to Next Event Print results Process Next Event on Queue Put new events on queue

47 Summary Simulation Models of Scheduling Using Queuing Theory Average response time and variance important Simulation of Scheduling SS: Ch 9[ , ]