Skip to content
Ameen Abozaid
SRC-005

Performance modeling

  • 6 Lessons
  • 4 h practice (estimate)
On this page 9 topics

Overview

Topics

  • Latency budgets
  • Little's Law
  • bottleneck analysis
  • queuing

Learn first

4 h of practice (estimate)

Learning outcomes

  1. Allocate an end-to-end latency budget across components and calls.
  2. Apply Little's Law to relate throughput, latency, and concurrency (threads, connections, consumers).
  3. Explain queueing behavior near saturation and why latency explodes at high utilization.
  4. Identify the bottleneck resource from a model and confirm it experimentally.

Lessons

  1. 01Latency budgets
  2. 02Little's Law
  3. 03Queueing and utilization
  4. 04Tail latency and fan-out
  5. 05Finding the bottleneck on paper
  6. 06Demo: predicting pool sizes with Little's Law, then measuring

Lab and exercises

Lab

SRC-005-LAB1 · Checkout latency budget

Outcomes: 1–4 · Time: ~2.5 h

  1. Allocate a p99 budget for checkout across the services and calls on the critical path.
  2. Model required HTTP threads, DB connections, and Kafka consumers with Little's Law at the 10× load.
  3. Compute utilization per resource on paper and name the predicted bottleneck.
  4. Verify with a load test; compare model and measurement.

Acceptance: model within 20% of measurement or discrepancy explained.

Exercises (modeling problem set; six exercises)

IDOutcomeTask
SRC-005-EX011Allocate a 900 ms p99 budget over a path with gateway, order, two parallel calls (inventory, pricing), then payment, then DB write.
SRC-005-EX022800 requests/s at 150 ms: how many in flight? A pool has 60 connections: what is the maximum throughput at 30 ms per query?
SRC-005-EX033Explain why a service at 90% utilization shows much higher p99 than at 60%, and propose two protections.
SRC-005-EX043Latency of a downstream call rises from 50 ms to 500 ms at constant arrival rate. What happens to threads in flight?
SRC-005-EX054From a table of resource demand and capacity, identify the bottleneck and design an experiment to confirm it.
SRC-005-EX061A page calls 20 services in parallel, each with p99 100 ms and p50 10 ms. Estimate how often the page sees a slow call and suggest a fix.
Show solutions
  • EX01 Parallel calls count as the maximum: gateway 20, order 100, parallel max(150, 80) = 150, payment 350, DB 100, margin 70 ms = 790 ms plus reserve; state timeouts per call.
  • EX02 800 x 0.15 = 120 in flight. Pool throughput = 60 / 0.03 = 2,000 queries/s.
  • EX03 Queueing delay grows steeply near saturation; protections: bounded queues with load shedding, autoscaling or capacity headroom, timeouts.
  • EX04 In flight = rate x latency, so concurrency grows ten times; pools exhaust and requests queue unless timeouts and limits cap it.
  • EX05 Highest utilization resource (for example DB pool at 92%) is the candidate; raise load stepwise, watch pool wait time and CPU, then change pool size and see whether the knee moves.
  • EX06 1 - 0.99^20 is about 18% of pages see a slow call; fix with fewer calls, caching, timeouts with degraded fallback, hedged requests.

Workplace evidence: a performance target you set or met using a model rather than trial and error.

Quiz

Outcomes: O1 latency budgets · O2 Little's Law · O3 queueing near saturation · O4 finding the bottleneck.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1Sequential calls in a budget:O1
  2. 2Parallel calls contribute to latency as:O1
  3. 3A budget should be based on:O1
  4. 4Little's Law is:O2
  5. 5400 requests/s at 0.25 s each means about how many in flight?O2
  6. 6Near saturation, waiting time:O3
  7. 7A protection against queue-driven latency:O3
  8. 8With 10 parallel calls each slow 1% of the time, requests hitting a slow call are about:O3
  9. 9The bottleneck candidate on paper is the resource with:O4
  10. 10After a model predicts a bottleneck, you should:O4

Practical part

Six modeling problems SRC-005-EX01 to EX06 plus the lab. Pass: quiz at least 8/10, at least five problems correct, and a model within 20% of the load-test measurement or an explained discrepancy.

Common mistakes

Budgets based on averages; ignoring fan-out amplification of tail latency.

Assessment

Modeling problem set.

Workplace evidence

A performance target you set or met using a model rather than trial and error.

Career relevance

Performance engineering (SRC-016).

Type to search levels, phases, modules and lessons.