Skip to content
Apkar

Engineering

The real cost of a retry

Retries are cheap in theory and expensive in practice. Here is where the money actually goes.

Omar Haddad · Infrastructure5 min read

Three bills, not one

A retried step bills you three times over: the model tokens it burns again, the tool-side quota it consumes again, and the wall-clock a customer spends waiting again. Most cost dashboards only count the first.

We started attributing all three to the step that caused them. The result reordered our own optimisation list — the most expensive step in our support agent was not the one calling the largest model.

Exponential backoff has a ceiling

Doubling the delay is the correct default and the wrong endpoint. Past three attempts, a failing tool is usually failing for a structural reason that another wait will not fix, and the remaining attempts are pure spend.

Cap attempts, then escalate. A run that pages a human after three tries costs less than one that quietly tries eleven times and fails anyway.