Routing
Cheapest-first routing
ComputeSDK team · Published
With the cheapest strategy, the router ranks ComputeSDK-managed providers by hourly price for the size you ask for, on every request. It tries the cheapest first; if that create fails, it tries the next.
How one request is ranked
- Keep the providers that sell the size. A request for a size only goes to providers that list it.
- Apply your rules. Allowed and excluded providers, and any per-request
onlyorignore, narrow the list. - Sort by hourly price. Lowest first, using the same prices the sandbox is billed at.
- Walk the list. The first provider that creates the sandbox runs it.
Worked example: a medium sandbox for 30 minutes
22 of 26 providers sell medium right now. These are the first three the router would try, at live prices:
| Try | Provider | Resources | Per hour | 30 min |
|---|---|---|---|---|
| 1 | Agent37 | 2 vCPU · 4 GB | $0.00604 | $0.0030 |
| 2 | Mosaic | 2 vCPU · 4 GB | $0.05 | $0.03 |
| 3 | Sandbox0 | 2 vCPU · 4 GB | $0.06 | $0.03 |
If Agent37 creates the sandbox, it runs there and is billed at its price. If the create fails, Mosaic is tried, and so on. Try other sizes and runtimes in the routing calculator, or see every price on the pricing page.
Good to know
Providers describe sizes differently, so compare the resources listed for each size, not only the price.
Cheapest applies to ComputeSDK's accounts. If you add your own provider keys, they are tried first or as a fallback, and the provider bills you for those sandboxes directly.