

























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
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
1 / 65
This page cannot be seen from the preview
Don't miss anything!
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.
Goals:
For an observation, two things matter:
The occurrence of an event can give us the "when".
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.
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)
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 )
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
//// 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
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.
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?
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?
// 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
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?
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. )
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
If we have a single queue obeying certain properties, we can get all kinds of nice metrics. But, it must have those required properties!!
the Demand we've seen before.] Many texts use μ for this. The rate of service is μ = 1/D.