Try
↑ ↓ move↵ openesc close
In this lesson · topic 4 of 7
  1. 1. A full server gets worse, not just slower
  2. 2. Four queues and four signals
  3. 3. Overload one server four ways
  4. 4. A queue bound is only as good as its timeout
  5. 5. Deciding who gets shed first
  6. 6. Let the client throttle itself
  7. 7. Reading an overloaded dashboard

Topic 4

A queue bound is only as good as its timeout

6 min read

Each figure here is simulator output with a fixed seed, held in place by a test. Hover one to see how it was produced. The server has four workers, the offered load is 1.5 times capacity, clients wait 10 t, and the bounded queue holds 20.

Goodput under overload

Requests answered in time, as a share of capacity, after a long run:

Policy Goodput Queue delay of served requests
Unbounded FIFO 0%measured 72 tmeasured
Bounded queue, reject 95%measured 5.0 tmeasured
Deadline-aware drop 96%measured 8.2 tmeasured
Adaptive LIFO 94%measured 0.3 tmeasured

The three shedding policies keep goodput close to capacity. They cannot exceed it, and a few percent is lost to requests that finish just late. What differs is who pays. About 35%measured of the arrivals were rejected at the door by the bounded queue, 32%measured were dropped by the deadline policy, and 34%measured expired unserved under LIFO. The server was offered more than it could do, and the excess went somewhere. Shedding chooses where.

Light load shows nothing

At 0.7 times capacity the unbounded queue answered 99%measured of all requests in time. A test at that load would pass every policy. The failure only exists above capacity.

Collapse takes time

At 1.25 times capacity the unbounded queue was still answering 80%measured of capacity after 40 t. After 200 t it was at 0%measured. A short load test of a slightly overloaded system can look fine, because the queue has not yet grown past the timeout. The collapse is a matter of when, not whether. In the sweep chart in the lab, every point past capacity on the unbounded line shows it.

A bound has to be sized

A bounded queue only works if its waiting time is under the client timeout. Two measurements make the point.

  • With a queue of 200 instead of 20, the bounded policy answered 0%measured in time. It was full of requests that expired before reaching a worker.
  • With the queue back at 20 and the client timeout cut from 10 t to 4 t, the bounded policy answered 0%measured. A queue of 20 on four workers makes a wait of about 5 t, longer than the clients will wait.

The deadline-aware policy under that short timeout still answered 96%measured, with no change. It checks each request against its own deadline, so there is no number to get wrong. The cost is the requirement that deadlines reach the server.

What each policy gives up

Bounded queue. Needs a size, and the right size depends on the timeout and the speed, both of which change.

Deadline-aware drop. Needs deadlines passed along on every request, and a drop still costs a queue slot and some bookkeeping. If the client’s timeout is not the real deadline, for example because a caller upstream waits less, the drop test is wrong.

Adaptive LIFO. Serves some requests very fast and others never. Under steady overload the same callers could lose every time. It also assumes requests are independent. If a user’s second request depends on the first, serving the newer one first can be worse than useless.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms