Skip to content
About
Main content

Scale-to-zero: a one-line break-even

Below what duty cycle does elastic capacity win, and why is cold start a billing problem?

Let d be the : the fraction of time you are active. Let k be the premium the elastic rate carries over the provisioned rate. Going elastic wins when

d × k < 1, that is, when d < 1 ÷ k.

the fraction of time you are active
the premium the elastic rate carries over the provisioned rate
k = 2k = 3
Data table
Elastic cost ÷ provisioned cost, by duty cycle
Duty cycle dseriesElastic ÷ provisioned
0.01k = 20.02×
0.022k = 20.045×
0.035k = 20.07×
0.047k = 20.094×
0.06k = 20.119×
0.072k = 20.144×
0.084k = 20.168×
0.097k = 20.193×
0.109k = 20.218×
0.121k = 20.243×
0.134k = 20.268×
0.146k = 20.292×
0.159k = 20.317×
0.171k = 20.342×
0.183k = 20.366×
0.196k = 20.391×
0.208k = 20.416×
0.22k = 20.441×
0.233k = 20.466×
0.245k = 20.49×
0.258k = 20.515×
0.27k = 20.54×
0.282k = 20.565×
0.295k = 20.589×
0.307k = 20.614×
0.319k = 20.639×
0.332k = 20.663×
0.344k = 20.688×
0.356k = 20.713×
0.369k = 20.738×
0.381k = 20.762×
0.394k = 20.787×
0.406k = 20.812×
0.418k = 20.837×
0.431k = 20.861×
0.443k = 20.886×
0.456k = 20.911×
0.468k = 20.936×
0.48k = 20.96×
0.493k = 20.985×
0.505k = 21.01×
0.517k = 21.03×
0.53k = 21.06×
0.542k = 21.08×
0.554k = 21.11×
0.567k = 21.13×
0.579k = 21.16×
0.592k = 21.18×
0.604k = 21.21×
0.616k = 21.23×
0.629k = 21.26×
0.641k = 21.28×
0.653k = 21.31×
0.666k = 21.33×
0.678k = 21.36×
0.691k = 21.38×
0.703k = 21.41×
0.715k = 21.43×
0.728k = 21.46×
0.74k = 21.48×
0.752k = 21.5×
0.765k = 21.53×
0.777k = 21.55×
0.79k = 21.58×
0.802k = 21.6×
0.814k = 21.63×
0.827k = 21.65×
0.839k = 21.68×
0.851k = 21.7×
0.864k = 21.73×
0.876k = 21.75×
0.889k = 21.78×
0.901k = 21.8×
0.913k = 21.83×
0.926k = 21.85×
0.938k = 21.88×
0.95k = 21.9×
0.963k = 21.93×
0.975k = 21.95×
0.988k = 21.98×
1k = 22×
0.01k = 30.03×
0.022k = 30.067×
0.035k = 30.104×
0.047k = 30.141×
0.06k = 30.179×
0.072k = 30.216×
0.084k = 30.253×
0.097k = 30.29×
0.109k = 30.327×
0.121k = 30.364×
0.134k = 30.401×
0.146k = 30.438×
0.159k = 30.476×
0.171k = 30.513×
0.183k = 30.55×
0.196k = 30.587×
0.208k = 30.624×
0.22k = 30.661×
0.233k = 30.698×
0.245k = 30.735×
0.258k = 30.772×
0.27k = 30.81×
0.282k = 30.847×
0.295k = 30.884×
0.307k = 30.921×
0.319k = 30.958×
0.332k = 30.995×
0.344k = 31.03×
0.356k = 31.07×
0.369k = 31.11×
0.381k = 31.14×
0.394k = 31.18×
0.406k = 31.22×
0.418k = 31.26×
0.431k = 31.29×
0.443k = 31.33×
0.456k = 31.37×
0.468k = 31.4×
0.48k = 31.44×
0.493k = 31.48×
0.505k = 31.52×
0.517k = 31.55×
0.53k = 31.59×
0.542k = 31.63×
0.554k = 31.66×
0.567k = 31.7×
0.579k = 31.74×
0.592k = 31.77×
0.604k = 31.81×
0.616k = 31.85×
0.629k = 31.89×
0.641k = 31.92×
0.653k = 31.96×
0.666k = 32×
0.678k = 32.03×
0.691k = 32.07×
0.703k = 32.11×
0.715k = 32.15×
0.728k = 32.18×
0.74k = 32.22×
0.752k = 32.26×
0.765k = 32.29×
0.777k = 32.33×
0.79k = 32.37×
0.802k = 32.41×
0.814k = 32.44×
0.827k = 32.48×
0.839k = 32.52×
0.851k = 32.55×
0.864k = 32.59×
0.876k = 32.63×
0.889k = 32.67×
0.901k = 32.7×
0.913k = 32.74×
0.926k = 32.78×
0.938k = 32.81×
0.95k = 32.85×
0.963k = 32.89×
0.975k = 32.93×
0.988k = 32.96×
1k = 33×

That is the whole decision. It explains why the same architecture is obviously right for a development environment and obviously wrong for a platform with continuous traffic.

Cold start is a billing problem, not only a latency problem

A 30-second start on a 5-second job is not a 30-second delay. The job is billed for (30 + 5) ÷ 5 = 7× the useful time, on top of any minimum increment.

is also not one quantity. It has five parts, with different and different owners.

PartTypical owner
Provisioning the machinevendor
Starting the runtimevendor
Loading dependenciesyou
JIT warm-up (the language runtime compiling hot code)you
Cache warm-up (filling caches with the data you need)you

Only the first two are the vendor's problem. The last one is the dangerous one. A system whose steady-state speed depends on warm caches has a cold-start cost measured in minutes of degraded operation. This is (the state of the past affects the present): the system does not return to normal speed the moment the machine is back. When it fails badly, it looks like a "cold-cache collapse": the backend sees all the traffic the cache used to absorb.

A correction to the standard claim

"You pay nothing when idle" is false wherever state exists. Storage keeps billing, and reactivation keeps billing. The genuinely worst case is neither continuous traffic nor zero traffic. It is sparse traffic: one request every few minutes. Then the system is always cold and never idle. If the idle timeout is shorter than the gap between requests, you pay a warm-up on nearly every request. If it is longer, the system never suspends and you pay for always-on capacity. Either way, gave you nothing. This is exactly Tomás's development warehouse.