How AWS Lambda does it
AWS Lambda is a well-known example of this model. It bills the duration of each run in GB-seconds, based on the memory set for the function. Lambda allocates CPU power in proportion to the memory you configure. CPU has no separate charge. At 1,769 MB, a function has the equivalent of one vCPU.
What it means for a sandbox
A memory-only price ties CPU to memory. If you need more CPU, you must also choose more memory and pay for it. The charge depends on the memory and the run time, not on how much CPU the code uses. A vCPU-hour price works differently, because it prices CPU on its own. Compare two prices only when you know how much CPU each memory size gives.
What to check
- The unit: per GiB-second, per GiB-hour, or per GB-hour. See GiB-hour.
- How much CPU each memory size gives.
- Whether the price includes disk and network traffic.