Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
    • Latency, Throughput and Bandwidth
    • Little's Law
    • Outstanding Transactions
    • Tags and IDs
    • In-Order or Out-of-Order
    • Reorder Buffers
    • Interleaving
    • Split Completions
    • Protocol Efficiency
    • Peak and Sustained Bandwidth
    • Queueing Intuition
    • Tail Latency
    • Buffers That Hide Latency
    • Virtual Output Queues
    • Performance Modelling
    • Protocols Compared: Concurrency and Performance
    • Drills: Concurrency and Performance
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 6: Concurrency and Performance
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 6: Concurrency and Performance
  4. Queueing Intuition

Part 6 · Concurrency and Performance · Senior (S)

Queueing Intuition

Latency against load has a knee: as utilisation approaches 100%, waiting time grows without bound. Where the knee comes from, how to estimate it, and why links and memories are not run at 95%.

On this page

    Note

    Level: Senior (S) · Answers: How many requests can be in flight?

    Before this: Little's Law

    An interconnect link runs at 50% utilisation and its average latency is 20 ns. Traffic grows to 90% and latency becomes 100 ns. Grow it to 95% and latency doubles again. Nothing changed in the link; the extra load was less than doubled. Latency did not rise in proportion to load. It rose like a wall.

    Why does latency explode near full load, and how close to full can a resource be run?

    The obvious answer, and why it breaks

    The obvious expectation is that a resource with spare capacity adds no delay: at 90% busy, there is still 10% free, so requests should get through. That would be true if requests arrived evenly spaced. They do not. They arrive in clumps, and a clump that arrives while the resource is busy waits. The busier the resource, the more likely each request finds a queue in front of it, and the longer that queue.

    The idea: waiting grows as 1 / (1 − load)

    For a single server with random arrivals and random service times, the average time in the system (waiting plus service), measured in service times, is:

    T=1−ρ1​,ρ=service ratearrival rate​(utilisation)

    Other arrival and service patterns change the constant but not the shape: smoother traffic and more regular service lower the curve, burstier traffic raises it, and every curve turns upwards sharply as ρ approaches 1. The knee is where waiting starts to dominate service, usually somewhere between 70% and 85% utilisation.

    Build it: a single-queue simulator

    The model sends 200,000 requests with random (exponential) gaps through one server with random (exponential) service times of mean 1, at several loads, and compares the measured average latency with the formula.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    """Latency against load for a single queue (random arrivals, random service).
    
    Requests arrive at random (exponential gaps) at rate rho per unit time and are
    served one at a time, each taking a random time with mean 1 (exponential). The
    model measures the average time a request spends waiting plus being served, and
    compares it with the formula for this queue, 1 / (1 - rho).
    """
    import random
    
    
    def mean_latency(rho, n=200000):
        random.seed(3)
        t = free_at = total = 0.0
        for _ in range(n):
            t += random.expovariate(rho)             # next arrival
            start = max(t, free_at)
            free_at = start + random.expovariate(1.0)
            total += free_at - t
        return total / n
    
    
    loads = [0.1, 0.3, 0.5, 0.7, 0.8, 0.9, 0.95]
    print("load:     " + " ".join(f"{r:6.2f}" for r in loads))
    meas = [mean_latency(r) for r in loads]
    print("measured: " + " ".join(f"{m:6.2f}" for m in meas))
    print("formula:  " + " ".join(f"{1 / (1 - r):6.2f}" for r in loads))
    for r, m in zip(loads, meas):
        assert abs(m - 1 / (1 - r)) / (1 / (1 - r)) < 0.12
    print("PASS: latency is about 1/(1-load): double at 50%, 10x at 90%, 20x at 95%")

    It prints:

    Diagram
    load:       0.10   0.30   0.50   0.70   0.80   0.90   0.95
    measured:   1.11   1.43   2.00   3.35   5.06  10.23  19.82
    formula:    1.11   1.43   2.00   3.33   5.00  10.00  20.00
    PASS: latency is about 1/(1-load): double at 50%, 10x at 90%, 20x at 95%
    The model's numbers: latency doubles by 50% load, reaches 5 times at 80%, 10 times at 90% and 20 times at 95%.

    At 50% load a request already spends as long waiting as being served. From 80% to 95% load, a 19% increase in traffic quadruples the latency. That is the wall in the opening story.

    What this means for design

    Decision

    Rule of thumb

    Target utilisation of a shared link or memory

    Plan for the workload's peak to stay below the knee (often 70–80%), not below 100%

    Buffer sizes

    Queues near full load are long; buffers sized for the average will overflow or back-pressure under bursts

    Latency budgets

    Quote latency at the expected load, never at idle

    Reducing latency at high load

    Add capacity, or make traffic smoother (pacing, rate limits, lesson 4.10), or prioritise urgent traffic (Part 8)

    What breaks

    A memory subsystem (illustrative) was sized so the average bandwidth demand was 92% of sustained capacity, "leaving 8% headroom". Average latency was several times the idle figure, and every burst of traffic pushed it higher. A latency-sensitive display engine sharing the memory underflowed its buffer during bursts. Adding a second channel brought utilisation to about 46% and latency close to idle.

    Why this matters

    Senior lens. Utilisation is not free headroom. Ask at what load each shared resource will run at peak demand, and read latency off the curve, not off the idle figure. A design that needs a resource at 90%+ utilisation to meet throughput will miss its latency targets; either add capacity or show that the traffic is smooth enough to sit lower on the curve.

    Interview

    Asked: "Why does latency explode near full load?"

    Weak answer: Because the link is full.

    Strong answer: Because requests arrive in clumps, not evenly. A request that arrives while the server is busy waits, and the busier it is, the more likely and longer the queue. For random arrivals and service, average time in the system is 1 / (1 − utilisation) service times: 2× at 50%, 10× at 90%, 20× at 95%. So shared links and memories are planned to stay below the knee, around 70–80%, and latency is quoted at load, not idle.

    Follow-ups: (1) What changes the height of the curve? (2) How would you lower latency without lowering load?

    Check yourself A link's service time is 4 ns. Using the formula, what is the average latency at 75% load?

    4 ns × 1 / (1 − 0.75) = 16 ns.

    Check yourself Why does more regular traffic lower the curve?

    Fewer clumps: requests are less likely to arrive while the server is still busy with the previous one, so queues are shorter at the same average load.

    Key takeaways

    • Random arrivals make queues form well before full load; latency grows as 1 / (1 − load) for a simple queue.

    • The knee, typically 70–85% utilisation, is where waiting starts to dominate.

    • Plan shared resources below the knee and quote latency at load.

    Keep going

    Next: Lesson 6.12, Tail Latency. Averages hide the slow requests. Why architects specify the 99th percentile.

    Related topics

    • Part 6 overview: Concurrency and Performance

    Previous

    97 / 234

    Next: Tail Latency

    Up next

    Up nextTail Latency

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Latency, Throughput and Bandwidth
    • Little's Law
    • Outstanding Transactions