logo

Exponential Backoff

Exponential backoff is a retry strategy where the wait time between attempts grows exponentially. Instead of retrying at fixed intervals, each subsequent attempt waits longer — giving the failing service time to recover.

How It Works

Attempt 1: wait 1 second
Attempt 2: wait 2 seconds
Attempt 3: wait 4 seconds
Attempt 4: wait 8 seconds
Attempt 5: wait 16 seconds

The general formula is: delay = base * 2^attempt

Why Exponential Backoff?

Fixed-interval retries can create a “thundering herd” effect — when a service recovers, all waiting clients retry at once and overwhelm it again. Exponential backoff spreads attempts over time, giving the service breathing room.

With Jitter

Adding randomness (jitter) to the backoff prevents multiple clients from retrying at exactly the same moment:

delay = base * 2^attempt + random(0, base)

Exponential Backoff in AsyncQueue

AsyncQueue uses exponential backoff by default for webhook retries and task execution failures. You can configure:

  • Max retries: Maximum number of retry attempts
  • Initial delay: Base delay for the first retry
  • Backoff multiplier: Factor by which delay increases (default: 2)
  • Max delay: Cap on the maximum wait time between retries