Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Queueing Lingo - Computer Systems Performance Evaluation - Lecture Slides, Slides of Computer Science

Some concept of Computer Systems Performance Evaluation are Measurement and Statistics, Performance Evaluation, Performance Metrics, Queueing Lingo, Software Performance Engineering. Main points of this lecture are: Queueing Lingo, Queueing Lingo, Queueing, Analytical Models, Operational Laws, Mean Value Analysis, Goal, Complicated, Understand, Value Measured

Typology: Slides

2012/2013

Uploaded on 04/27/2013

divyaa
divyaa 🇮🇳

4.4

(59)

71 documents

1 / 65

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Performance
Engineering
QUEUEING
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41

Partial preview of the text

Download Queueing Lingo - Computer Systems Performance Evaluation - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Performance

Engineering

QUEUEING

WHAT WE ARE DOING HERE

We are about to embark on:

Queueing Lingo - all the definitions you’ll ever need!

Queueing - especially the Single Queue in DETAIL

Analytical Models - how to solve a number of complex problems using the equations we already know and love. Works especially well for open models.

Operational Laws - drawing conclusions about limits - what to do when we can’t solve the math exactly.

Mean Value Analysis - Using the equations in an iterative fashion to solve closed models.

Queueing Lingo

Goals:

  • To understand the random/statistical nature of computer data. We will emphasize the non-deterministic.
  • To understand distributions for simulation purposes.
  • To impress your friends.

For an observation, two things matter:

  • The value measured.
  • When measured.

The occurrence of an event can give us the "when".

Queueing Lingo

A STOCHASTIC PROCESS is a mechanism that produces a collection of measurements which all occur, randomly, in the same range of values. It applies to the VALUE measured for an observation. The dictionary says, "random, statistical".

Stochastic processes are well behaved phenomena which don't do things which are unpredictable or unplanned for.

Examples:

Throwing 2 dice always gives numbers in the range 2 - 12.

Actions of people are unpredictable ( unless the range of values is made very large.) Someone can always respond in a way you haven't predicted.

Queueing Lingo

Exponential Curve

0

1

0 0.5 1 1.5 2 2.5 3 t

F(t)

(^) F(t)

This is a simple exponential curve. What properties can you identify from it?

F(t) = exp(-t)

Queueing Lingo

Example of the Poisson Probability Density Function.

Poisson Probability Density Function

0

0 2 4 6 8 10 12 k

F(k)^ F(k)

F(k) = ( 5 / k! ) exp( -5 )

Lab - You Get To See It Happen Before

Your Very Eyes!

Segment (^) How Many Samples 0 – 9 10 – 19 20 - 29 30 - 39 40 - 49 50 - 59 60 - 69 70 - 79 80 - 89 90 - 99

Column I Numbers falling in each segment.

Column II Number of segments containing N samples

Column III Number of instances of intervals between samples.

N Number of Segments 0 1 2 3 4 5 6 7 8 9

Interval Number of Instances 0 2 4 6 8 10 12 14 16 18

Lab - You Get To See It Happen Before

Your Very Eyes!

//// Generate Poisson.This program generates random numbers, puts them into buckets, //// and calculates the distance between numbers. //// Inputs:N - number of samples to generate

#include#define <time.h>MAX_DATA_VALUE 100 #define#define MAX_BUCKETSMAX_DATA 1000100

//int compare (const void * a, const void * b) { Compare routine used in sorting

}return ( (int)a - (int)b );

int (^) intmain( int argc, char argv[]) Data[MAX_DATA]; { intint Bucket[MAX_BUCKETS];NumberOfSamples; intint NumberOfBuckets = 10;LargestBucketFill = 0; int Index, Temp, i; if ( argc <2 )printf( "Usage: { GeneratePoisson <number_of_samples>\n"); } exit(0); NumberOfSamples = atoi( argv[1] );srand((unsigned)time(NULL)); for ( Index = 0; Index < NumberOfBuckets; Index++ )Bucket[Index] = 0; for ( Index = 0; Index < NumberOfSamples; Index++ )Data[Index] = rand() % MAX_DATA_VALUE; { Temp = (NumberOfBucketsData[Index])/MAX_DATA_VALUE;Bucket[Temp]++; if ( Bucket[Temp] > LargestBucketFill )LargestBucketFill = Bucket[Temp]; }

printf("\nfor ( Index = 0; Index < NumberOfSamples; Index++ ) Raw Random Numbers\n"); printf("\n");printf( "%d ", Data[Index] ); qsort (Data, NumberOfSamples, sizeof(int), compare);printf( "\n Sorted Random Numbers\n"); for ( Index = 0; Index < NumberOfSamples; Index++ )printf( "%d ", Data[Index] ); printf("\n");printf( "\n Range Number\n"); printf( "for ( Index = 0; Index < NumberOfBuckets; Index++ ) in Range\n"); Index),printf( "%2d - %2d,^ %d\n", (MAX_DATA_VALUE/NumberOfBuckets * Bucket[Index] ); (MAX_DATA_VALUE/NumberOfBuckets * (Index+1)) - 1, // Calculate distribution of items in each bucketprintf("\n"); for ( Index = 0; Index < LargestBucketFill; Index++ )Temp = 0; { for ( i = 0; i <NumberOfBuckets; i++ )if ( Bucket[i] == Index ) Temp++; } printf( "Number of buckets with %d items, %d\n", Index, Temp ); // Determine the distance between the random items.for ( Index = 0; Index < MAX_BUCKETS; Index++ ) Bucket[Index] = 0; LargestBucketFill = 0;for ( Index = 0; Index < NumberOfSamples - 1; Index++ ) { Temp = Data[Index+1] - Data[Index];Bucket[Temp]++; if ( Temp > LargestBucketFill )LargestBucketFill = Temp; }printf( "\n Distance Number\n"); printf( " Betweenprintf( " Samples with this\n");distance\n"); for ( Index = 0; Index <= LargestBucketFill; Index++ )printf( "%2d, %d\n", Index, Bucket[Index] ); } Code is here so it doesn’t get lost!! Docsity.com

Queueing Lingo

Examples:

Suppose that a piece of software has an expected lifetime of 5 years, and that the average bug rate for this type of product is one bug/year.

  • What is the bug expectation rate per year at the start of the five years, assuming this code is "average"?
  • After two years, four bugs have been found. The code is still considered "average". How many bugs/year can be expected for the remaining three years?

Queueing Lingo

MEMORYLESS means that the probability of an event doesn't depend on its past. The above case highlights an example where the past does matter.

Examples: Which depend on the past, and which don't?

  • Throwing dice?
  • A disk seek distance?
  • The address of an instruction execution?
  • The measurement of the length of a table?

Prepare to Have Your Mind Bent In An Unexpected Way!!

Example: Consider a bus stop where the time between bus arrivals is exponentially distributed with a rate L. Thus the bus arrivals form a Poisson process. If you walk up to the bus stop, how long do you have to wait until the next bus arrives?

Queueing Lingo

// GenerateRandomBusArrivals #include#define <time.h>MAX_DATA 1000 //#define Hours in a week MAX_DATA_VALUE 168

//int compare (const void * a, const void * b) { Compare routine used in sorting

}return ( (int)a - (int)b ); int (^) *intmain( int argc, char argv[]) Data[MAX_DATA]; { intint NumberOfSamples = 14;Index; printf( "This program generates 1 week's worth of bus arrivals.\n");printf( "We assume that the average bus arrival rate is every 12 hours,\n"); printf( "The arrival rate is 1/12 per hour.printf( "of arrivals - we will assume that there are 14 arrivals in a week \n"); We'll take 1 week's worth\n"); printf( "- that's how we set the average arrival rate.\n");printf( "Oh - and we assume the buses arrive on the hour (it's simpler that way).\n"); srand((unsigned)time(NULL));for ( Index = 0; Index < NumberOfSamples; Index++ ) { } Data[Index] = rand() % MAX_DATA_VALUE; qsort (Data, NumberOfSamples, sizeof(int), compare);printf( "\n Sorted Random Numbers\n"); for ( Index = 0; Index < NumberOfSamples; Index++ )printf( "%d ", Data[Index] );

} printf("\n");

This program generates 1 week's worth of bus arrivals. We assume that the average bus arrival rate is every 12 hours, The arrival rate is 1/12 per hour. We'll take 1 week's worth of arrivals - we will assume that there are 14 arrivals in a week

  • that's how we set the average arrival rate. Oh - and we assume the buses arrive on the hour (it's simpler that way).

Sorted Random Numbers 2 5 73 81 100 100 102 109 134 136 145 148 152 154 So given these actual bus arrivals, how long on average must you wait for a bus?

Queueing Lingo

Types of Stochastic Processes Type Event Counting Value Time Between Events

Example

Stochastic Arbitrary - any new state is possible given the current state.

Arbitrary Cars on a highway (highly interactive.) Random Walk Next state may depend on current & previous states.

Arbitrary Monopoly Game.

Markov Future states depend only on current state, not on previous state.

Arbitrary Monopoly Game.

Birth-Death (^) Next state depends only on current state.

Memoryless Event driven scheduler.

Poisson Memoryless Memoryless Bus problem above.

Arrival rates are often Poisson.

Service times are often exponential.

( In other words, they're both random. )

PROPERTIES OF QUEUES

How do we describe a queue? These are the important aspects:

Arrival process:

Service Time Distribution:

Number of Servers:

System Capacity:

Population Size:

Service Discipline:

The shorthand for queue description is thus A / S / m / B / K / SD.

The inter-arrival and service times are typically of the following types:

M Exponential – Memoryless, the distribution we’ve just been talking about. D Deterministic – the times are constant and there is no variance. G General –distribution is not specified and the results are valid for all distributions

THE SINGLE QUEUE

If we have a single queue obeying certain properties, we can get all kinds of nice metrics. But, it must have those required properties!!

REQUIRED PROPERTIES:
  • Arrivals are random with a rate of X per time. ( Poisson – when we say this, we mean the inter-arrival time is exponentially distributed. ) [ Note that in steady state, throughput = arrival rate.] Many texts use λ for this.
  • Service times are random with a value of D. (Exponential ) [ Note this is

the Demand we've seen before.] Many texts use μ for this. The rate of service is μ = 1/D.

  • There's the possibility of an infinite number of customers.
  • There's a single server. [ So the derivation we’re about to do doesn't work for a multiprocessor CPU.]