Four Ways To Sleep

Four retry sleep policies, all with the same base and cap:

# A
sleep = min(cap, base * 2 ** attempt)

# B
sleep = random.uniform(0, min(cap, base * 2 ** attempt))

# C
temp  = min(cap, base * 2 ** attempt)
sleep = temp / 2 + random.uniform(0, temp / 2)

# D
sleep = min(cap, random.uniform(base, sleep * 3))

AWS simulated 100 clients contending on the same row with optimistic concurrency control. Which policy did the least total client work, and what did removing randomness cost?

A

A did the least work, because it makes the fewest calls per client by construction, and jitter trades extra calls for lower completion time

B

B did the least work. A was worst on both axes: capped exponential backoff alone still leaves clients clustered into synchronized rounds, so it took more calls and more wall-clock time than any jittered policy

C

C did the least work, because keeping half of the computed backoff prevents the very short sleeps that B allows and therefore keeps more clients out of each round

D

D did the least work, because growing the sleep bound from the previous random value spreads clients the most aggressively of the four