1 / 54

Queuing Theory

Queuing Theory. A brief review of probability. Continuous Random Variables. Random Variable X F(x)=Pr(X x) is distribution function f(x)=d/dx F(x) is density function E(X)= =is mean or average E(X 2 ) second moment Var(X)=E(X 2 )-  2. Probability. X is the max of two dice

ori-meadows
Download Presentation

Queuing Theory

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. Queuing Theory

  2. A brief review of probability

  3. Continuous Random Variables • Random Variable X • F(x)=Pr(Xx) is distribution function • f(x)=d/dx F(x) is density function • E(X)= =is mean or average • E(X2) second moment • Var(X)=E(X2)- 2

  4. Probability • X is the max of two dice • E[X] = 1(1/36) + 2(3/36) + 3(5/36) + 4(7/36) + 5(9/36) + 6(11/36) = 161/36 = 4.5 • E[X^2] = 1(1/36) + 4(3/36) + 9(5/36) + 16(7/36) + 25(9/36) + 36(11/36) = 791/36 = 22 • Var[X] = E[X2] - E[X]2 = 1.75 • StdDev[X] = sqrt(Var[X]) = 1.3

  5. Approaches • Try new configuration and observe results • Scale up from prior results • Arrival rate .5, mean 43, max 627 • Arrival rate .95, mean 1859, max 4285 • Arrival rate .99, mean 2583, max 5068 • Develop queuing theoretic model • Run a simulation

  6. Predicting response

  7. Queue Model

  8. Queue Statistics • Arrival rate = load - Poisson - • Packet length Distribution - exponential • E(m) expected value (mean) of random variable • Ts=Mean service time, Tq=Mean queue time • Standard Deviation of service time • Link utilization

  9. Practical Example Tw =Tr =Ts

  10. Kendall Notation • A/S/NS/B/K/SD • A,S=Interarrival time, service time distribution • M = Exponential • Ek = Erlang • Hk = Hyperexponential • D = Deterministic • NS=Number of servers • B=Number of Buffers • K=Population size

  11. Kendall Notation • SD=Service Discipline • FCFS,FCLS… • Defaults B= , K= SD=FCFS • M/M/1 = M/M/1/ / /FCFS

  12. Multiserver queue

  13. Multiple Single-server queues

  14. Standard Deviation impact

  15. Queuing Time

  16. Fixed Packets • Average transmission time • = average packets serviced/sec = capacity n Buffer Arriving Packets Departing Packets

  17. Exponential Distributions • Probability Distribution Function • mean time to next arrival = • starting at time zero • Probability Density Function

  18. Exponential Distribution • The cumulative distribution function F(x) and probability density function f(x) are: • In queuing theory, we often assume the service time follows an exponential distribution. • The service time corresponds to the packet transmission time and is proportional to the packet length.

  19. Poisson Distribution It can be shown that for Poisson arrival process, the sequence of interarrival times Tn are independent identically distributed exponential random variables having mean 1/λ

  20. M/M/1 queue

  21. Markov Models • n+1 • n • n-1 departure Buffer Occupancy • n arrival 0 1 ... n-1 n n+1

  22. Probability of being in state n one arrived and one departed None arrived or departed None arrived, one departed one arrived, none departed

  23. 0 1 ... n-1 n n+1 Markov Chains

  24. Substituting Utilization

  25. Substituting P1 • Higher states have decreasing probability • Higher utilization causes higher probability • of higher states

  26. What about P0 Queue determined by

  27. E(n), Average Queue Size

  28. Selecting Buffers For large utilization, buffers grow exponentially

  29. Little’s Law • Applies to systems where no jobs are lost or created • Arrival rate = arrivals/total time=N/Tt • Mean time in system = J/N • Mean number in system=

  30. J is the shaded areaExamine time up to D6=19 T1=3 T2=7 T3=10 T4=6 T5=6 T6=6 J=38 Arrival Rate = N/Tt=6/19=.31 Mean Time in system = J/N = 38/6=6.3 Mean number in system = J/Tt=38/19=2 = (J/N)*(N/Tt)=6.3*.31=2 =Tq

  31. Throughput • Throughput=utilization/service time • =/Ts • For =.5 and Ts=1ms • Throughput is 500 packets/sec

  32. Applying Little’s Law

  33. Probability of overflow

  34. With N Fixed Buffers

  35. Single Server Ts=0 (Ts)/Ts=1 (Ts)/Ts>>1

  36. Example • Given • Arrival rate of 1000 packets/sec • Service capacity of 1100 packets/sec • Find • Utilization • Probability of having 4 buffers filled

  37. Example

  38. M/G/1 queues

  39. M/D/1 queues

  40. Examples • LAN with 100 PCs and 1 server. • Service time .6sec and = (exponential) • What is average response time at 20 queries/min=1q/3sec? • Use M/M/1 model • =Ts=(1/3)(.6)=0.2 • Tq=Ts/(1-)=.6/.8=.75sec • If 1.5 seconds is too long, what utilization is allowable (90% of responses are less than 1.5sec) • mTr(r)=Tr*ln(100/(100-r)) • mTr(90)=Tr*ln(10)=[Ts/(1-)]*2.3=1.5 sec • 2.3 Ts=(1-)1.5 sec, 1.5  = 1.5-2.3*.6 , =.08 • The utilization must actually be reduced

  41. Multiprocessor System • five processors (5 M/M/1), Running state average= 0.1 sec. • Assume that the standard deviation of service time is observed to be 0.094 sec (exponential service time). • processes at Ready state=40 per second. • Single-Server Approach • If processes are evenly distributed among the processors, then the load for each processor is • 40/5 = 8 processes per second. Thus, • r = l Ts= 8 ´ 0.1 = 0.8 • The residence time is then easily calculated: • tr= Ts/(1- r)=.1/.2=.5 seconds

  42. Single Queue • (M/M/5) aggregate arrival rate of 40 processes per second. Utilization is still r=(l Ts /5) = 0.8 • To calculate the residence time first calculate Erlang C function, table lookup, r=0.8 for 5 servers C = 0.554 • tr= (C/N)(Ts/(1- r))+ Ts= ((0.544)(0.1))/(5(1- 0.8))+ (0.1) = 0.1544 • So the use of multiserver queue has reduced average residence time from 0.5 sec down to 0.1544 sec, which is greater than a factor of 3. If we look at just the waiting time, the single queue case is 0.0544 seconds compared to 0.4 seconds, for multiple queues which is a factor of 7.

  43. Another Example • Arrival rate • Service rate • Gateway utilization • Probability • of n packets in gateway • Mean time spent in gateway • Probability of buffer overflow • which is about 15 packets per billion packets • To limit the probability of loss to less than • We need about 10 buffers.

  44. Analysis • If traffic flow is Poisson and service times are exponential • Sum arrival rates and delays • Jackson’s Theorem • Queuing network with m nodes • Poisson arrival rate • Items transition immediately to another node • Mean delays are summed, but stddev, variance are unknown • Flaw in that service distributions are not independent because a packet flows through several queues.

  45. Network of Queues 10/sec 8/sec S1 8/sec 2/sec 4/sec 19/sec 7/sec 11/sec S2 D1 9/sec

  46. More Statistics

  47. Examples   1-P Ts P

More Related