1 / 21

CSC407: Software Architecture Winter 2007 Performance (II)

CSC407: Software Architecture Winter 2007 Performance (II). Greg Wilson gvwilson@cs.utoronto.ca. Model Revisited. Service Rate μ. FCFS. Arrival Rate λ. Parameters: Service Order (FCFS) Average Arrival Rate ( λ ) Service Requirement (S) Mean Service Time (E[S])

quinn-heath
Download Presentation

CSC407: Software Architecture Winter 2007 Performance (II)

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. CSC407: Software ArchitectureWinter 2007Performance (II) Greg Wilson gvwilson@cs.utoronto.ca

  2. Model Revisited Service Rate μ FCFS Arrival Rate λ • Parameters: • Service Order (FCFS) • Average Arrival Rate (λ) • Service Requirement (S) • Mean Service Time (E[S]) • Average Service Rate (μ = 1/E[S]) • For single server model, we require λ≤μ Queue Server

  3. Performance Metrics Busy Period: B Server Busy Ns Nq Jobs Completed: C λ μ Total Time: T Tw Ts • Response Time, Time in System (Ts) • Waiting Time (Tw) • Number of jobs in System (Ns) • Number of jobs in Queue (Nq) • Utilization (Ui): Ui = Bi/Ti • Throughput (Xi): Xi = Ci/Ti = μi Ui • Utilization Law:Ui = Xi. E[S]

  4. Exponential Distribution • Let q(t) be the probability that nothing happens in time interval t • If x represents the waiting time to the first event, then by definition P{x>t} = q(t) • If the system is memoryless, then: q(t1)q(t2) = q(t1 + t2) • Only solution is q(t) = e-λt • So Fx(t) = P{x≤t} = 1-q(t) = 1-e-λt

  5. Another View • Let s and t be time intervals ≥ 0 • Probability of something happening is independent of whatever has (or hasn’t) happened before) • Note: mean and standard deviation are both 1/λ • λ is often called the rate

  6. How Many? • If interarrival times are exponentially distributed, then P{k events in [0,t]} = λte-λt/k! • A Poisson distribution with parameter λ • So: if the arrival and service times are both memoryless, what is the system’s performance? • I.e., if jobs arrive independently, and the times required to process jobs are independent, how quickly can we do them? • And how long will the queue get?

  7. M/M/1 Queue 0 1 1 2 3 4 5 6 λ λ λ λ λ λ • Memoryless property: If the last job arrived t0 time ago, no job will arrive for time t with the probability P0(t) = e-λt. • For small Δt, • P0(Δt) = 1 - λ Δt • P1(Δt) = λ Δt • Pk(Δt) = 0 for k > 1 • The arrival process can be viewed as an infinite state machine where each state is the number of jobs in the queue

  8. …M/M/1 Queue • Service time also follows exponential distribution. • So the departure process can be viewed as: 0 1 1 2 3 4 5 6 μ μ μ μ μ μ

  9. …M/M/1 Queue μ μ μ μ μ μ 1 2 λ 0 1 3 4 5 6 λ λ λ λ λ • The M/M/1 queue can be viewed as: • The “M” means “Markovian” • Or “memoryless” • The “1” means “a single server” • So what’s the probabiliyt of being in state N?

  10. Markov Models • A way to translate transition probabilities into occupation times • Among other things 0.4 0.6 A B 0.2 0.1 0.8 0.3 0.2 C D 0.2 0.7 0.5

  11. …Markov Models • Under-determined • But PA + PB + PC + PD = 1.0

  12. Using the Model • Data center has M machines •  fail per hour • Takes h hours to repair, so  = 1/h • How often are all machines running? • How often are fewer than half machines running? • Often written into Service Level Agreements (SLAs) • If halving the failure rate costs $F/machine, and halving the repair time costs $R, which is the better investment?

  13. Generalized Birth-Death Models • A restricted class of Markov models 1 2 3 0 0 1 2 3 … 1 2 3 0

  14. After a Little Algebra…

  15. M/M/1 System: Steady State μ μ μ μ μ μ 1 2 λ 0 1 3 4 5 6 λ λ λ λ λ

  16. …M/M/1 System: Steady State

  17. …M/M/1 System – Steady State Let

  18. Utilization: U = 1 – π0 =  = λ/μ Conventional to use  for utilization instead of U Number of customers in whole system: …M/M/1 System – Performance Measures

  19. Mean Response Time: Little’s Law: E[Ns] = λ E[Ts] …M/M/1 System – Performance Measures • Remember: μ≥λ • Hm… what if μ = λ ?

  20. Mean Wait Time in queue (Tw = TQ): Number of jobs waiting in queue Nw: Using Little’s Law: E[Nw] =  E[Tw] = 2 / (1 - ) …M/M/1 System – Performance Measures

  21. Example • File server: 30 requests/sec, 15 msec/request • What is the average response time? • What would it be if the arrival rate doubled? • Assume requests are independent (must verify) • Utilization  = E[S] = 0.45 • So average response time is E[S]/(1 - ) = 0.027 sec • At 60 requests/sec, response time is 0.15 sec • Doubling request rate increased response time by 5.6!

More Related