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?
Sign in to answer questions and track your progress
Sign In