Works on this device
Request Timeout Calculator
Choose timeouts that fit together. Split a total time budget over the calls your service makes, see the worst-case time of a chain of calls with retries, and check that a client waits longer than the server it calls.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what you want: split a budget, the worst case of a chain, or a client timeout above a server one.
- Add one row for each call. Type its share of the budget or its timeout per try, its number of retries, the first wait between tries and the factor by which each wait grows.
- Choose the unit of the times above the rows (ms, s or min).
- Choose Calculate. The table shows every call; the steps show the arithmetic.
The formulas
- Waits between tries: the wait before retry k = first wait × factor^(k − 1). A factor of 1 keeps the wait fixed.
- Budget of a call = (total budget − time for your own work) × its share ÷ the sum of the shares.
- Timeout per try = (budget of the call − the sum of its waits) ÷ (retries + 1).
- Worst case of a call = (retries + 1) × timeout per try + the sum of its waits. Calls one after another add up.
- Nested calls: a call should fit inside one try of its caller, so its worst case should be at most the caller's timeout per try. The requests that reach the last call can be as many as the product of the tries of all calls.
- Client timeout ≥ server time limit + network round trip + margin.
Worked example
A request has a budget of 5 s and keeps 200 ms for its own work, so 4,800 ms are left for three calls with shares 1, 2 and 3. The auth service gets 800 ms; with 1 retry and a 50 ms wait, each try may take (800 − 50) ÷ 2 = 375 ms. The orders database gets 1,600 ms; with 2 retries and waits of 100 and 200 ms, each try may take (1,600 − 300) ÷ 3 = 433.3 ms. The payment API gets 2,400 ms and each of its 2 tries may take 1,100 ms.
In a nested chain, a mobile app waits 10,000 ms per try with 1 retry and a 500 ms wait: its worst case is 2 × 10,000 + 500 = 20,500 ms. The gateway behind it waits 3,000 ms per try with 2 retries (waits 100 and 200 ms): its worst case of 9,300 ms fits in one 10,000 ms try. The database call behind that, 800 ms with 1 retry and a 50 ms wait, takes at most 1,650 ms and fits in 3,000 ms. In the worst case 2 × 3 × 2 = 12 requests reach the database for one tap in the app.
A server may work for 30 s. With a network round trip of 150 ms and a margin of 500 ms, the client should wait at least 30.65 s. A client timeout of exactly 30 s is too short by 0.65 s.
Limits you should know
- The tool does the arithmetic of timeouts that you plan. It does not send requests, measure your services or check certificates or DNS.
- Waits are worked out without jitter. With full or equal jitter the real waits are the same or shorter, so the timeouts here stay safe. For capped and jittered waits, use the Retry Backoff Calculator.
- Set each timeout above the time a call takes when it is slow but healthy, for example its 99th percentile from the API Latency Percentile Calculator. A timeout below that turns slow answers into failures and retries.
- Libraries and proxies count timeouts in different ways (connect, read, idle, whole request). Use the timeout that covers the whole try.