Queuing framework for process management evaluation
Download
1 / 47

- PowerPoint PPT Presentation


  • 85 Views
  • Updated On :

Queuing Framework for Process Management Evaluation. Lecture 20 Klara Nahrstedt. CS241 Administrative. Read Stallings Chapter 9 No Quizzes this week, the next quiz will be on Monday 3/12 on SMP5. Content of This Lecture. Goals:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '' - persephone


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Cs241 administrative l.jpg
CS241 Administrative

  • Read Stallings Chapter 9

  • No Quizzes this week, the next quiz will be on Monday 3/12 on SMP5


Content of this lecture l.jpg
Content of This Lecture

  • Goals:

    • Introduction to Principles for Reasoning about Process Management/Scheduling

  • Things covered in this lecture

    • Introduction to Queuing Theory



Queuing models and simulation l.jpg
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


Cpu scheduler example l.jpg
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?


Queuing diagram for processes l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes8 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes9 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes10 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes11 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes12 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes13 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes14 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes15 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes16 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes17 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes18 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes19 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queuing diagram for processes20 l.jpg
Queuing Diagram for Processes

Exit

Start

Ready Queue

CPU

Time Slice

Event

Event Queue


Queueing model l.jpg
Queueing Model

  • Random Arrivals and the Poisson Distribution

  • Elements of model


Discussion l.jpg
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?


Discussion23 l.jpg
Discussion

  • What assumption have you made about the bus?


Hamburger problem l.jpg
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

8

7


Hamburger problem25 l.jpg
Hamburger Problem

  • 7 Hamburgers arrive on average every time unit

  • 8 Hamburgers are processed by Joe on average every unit

  • How long is a hamburger waiting to be eaten? (Do they get cold?) Ans = 7/8 time units

  • How many hamburgers are waiting in queue to be serviced? Ans = 49/8

Queue

8

7


Random events l.jpg
Random Events

  • Poisson Distribution

  • Each event independent of other events

  • Mean event rate, SD is same as mean

  • Exponential distribution


Queuing theory l.jpg
Queuing Theory

Single Server Queue

ARRIVAL RATE 

Server

Input Queue

SERVICE RATE


Queueing theory point of interest l.jpg
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

0.5

1

t

Av λ


Analysis of queueing behavior l.jpg
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)


Useful facts from queuing theory l.jpg
Useful Facts From Queuing Theory

  • Wq= mean time a customer spends in the queue

  •  = arrival rate

  • Lq =  Wq 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


Analysis of single server queue l.jpg
Analysis of Single Server Queue

  • Server Utilization:

  • Time in System:

  • Time in Queue:

  • Number in Queue (Little):


Example how busy is the server l.jpg

= 2/3 or 66% Busy

Example: How busy is the server?

μ=3

λ=2


How long is an eater in the system l.jpg
How long is an eater in the system?

μ=3

λ=2

= 1/(3-2)= 1





Interesting fact l.jpg
Interesting Fact

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


Until now we looked at single server single queue theory l.jpg
Until Now We Looked at Single Server, Single Queue Theory

ARRIVAL RATE 

Server

Input Queue

SERVICE RATE


Poisson arrivals sum l.jpg
Poisson Arrivals Sum

ARRIVAL RATE 1

Server

Input Queue

SERVICE RATE

ARRIVAL RATE 2

=1+2


Example l.jpg
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?


Example41 l.jpg
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


As long as it s a poisson distribution l.jpg

Server

Server

As long as it’s a Poisson Distribution...

SERVICE RATE1

ARRIVAL RATE 

Combined=1+2

Input Queue

SERVICE RATE2


Question macdonalds problem l.jpg
Question: MacDonalds Problem

λ

μ

λ

μ

μ

μ

λ

λ

μ

λ

λ

μ

A) Separate Queues per Server

B) Same Queue for Servers

If WA is waiting time for system A, and WB is waiting time for system B, what is WA/WB? Integer answer; WA > WB ?


Queuing diagram for processes44 l.jpg
Queuing Diagram for Processes

Exit

Start

ARRIVAL RATE 

SERVICE RATE 

Time Slice

SERVICE RATE1

ARRIVAL RATE 1

Event Queue


Queuing diagram for processes45 l.jpg
Queuing Diagram for Processes

Create Job

CPU

Ready Queue

I/O request in

Device Queue

I/O

Time Slice

Expired

Update

Accounting

Fork a Child

Create

Child

Interrupt

Occurs

Wait for an

Interrupt


Simulations instead of maths l.jpg

Process Next Event on Queue

Put new events on queue

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


Summary l.jpg
Summary

  • Simulation Models of Scheduling

  • Using Queuing Theory

  • Average response time and variance important

  • Simulation of Scheduling

  • SS: Ch 9[405-422,428-435]


ad