Pricing
What Luna bills on the Pay as you go plan, the price of each meter in US dollars, and worked examples of a month.
On the Pay as you go plan, you pay for what your app uses, with no monthly fee. Each month starts with $5 of credit, spent before anything is charged.
Prices
Every price is in US dollars.
| Meter | Unit | Pay as you go |
|---|---|---|
requests |
million requests | $0.30 |
messages |
million messages | $0.03 |
streamReads |
million stream reads | $0.03 |
lunaCpuMs |
million CPU-ms | $0.02 |
lunaMemoryMibMs |
million GB-seconds | $12.50 |
isolateCpuMs |
million CPU-ms | $0.02 |
databaseByteHours |
GB-month | $0.20 |
blobByteHours |
GB-month | $0.015 |
codeByteHours |
GB-month | $0.015 |
historyByteHours |
GB-month | Not charged |
egressBytes |
GB | $0.05 |
ingressBytes |
GB | Not charged |
sandboxCpuMs |
vCPU-second | $0.00002 |
sandboxMemoryMibMs |
million GB-seconds | $2.50 |
sandboxDiskByteHours |
GB-month | $0.10 |
| Monthly fee | month | $0 |
| Monthly credit | month | $5 |
A GB here is 1,073,741,824 bytes, which is 1 GiB. A GB-month is 1 GB kept for 730 hours, so 2 GB kept for half a month is also 1 GB-month.
What each meter counts
Luna records each meter by the hour, for every luna type of every tenant. Track usage shows how to read them.
Calls and messages
requestscounts each call and message a luna’s handlers take. That includes calls from your app, calls from other lunas and runs started by a luna’s own schedules.messagescounts each message sent to a connected app, each event of a streamed response, and each batch of events or table changes that a listener runs. A batch tried again counts again.streamReadscounts the stream entries apps read through Luna. An entry read by many apps at once from one shared read counts once.
Compute
lunaCpuMscounts the CPU time a luna’s handlers use. A luna with calls in flight is charged at least its cores for that time.lunaMemoryMibMscounts 128 MiB for each millisecond a luna is awake. One luna awake for one second is 0.125 GB-seconds.isolateCpuMscounts the CPU time of isolate runs, as Run untrusted code shows.
Storage
Luna measures storage every hour.
databaseByteHourscounts the bytes of your tables.blobByteHourscounts the bytes of your files.codeByteHourscounts every deployed version of your code that is kept.historyByteHourscounts the older data kept so you can restore or fork a luna, as Restore to an earlier moment shows. It shows in your usage, and it is not charged.
Data in and out
egressBytescounts bytes leaving Luna: answers to calls, messages to connected apps, and what your code sends out withfetch.ingressBytescounts bytes coming in: request bodies and what your code receives. It shows in your usage, and it is not charged.
Sandboxes
sandboxCpuMscounts the CPUs a sandbox declares, for the time it runs. Run a sandbox shows how to declare them.sandboxMemoryMibMscounts its declared memory for the time it runs.sandboxDiskByteHourscounts the bytes of sandbox disks kept, for each hour they are kept.
Monthly credit and fee
The plan has no monthly fee. Each calendar month, counted in UTC, comes with $5 of credit. Luna spends the credit before it charges anything, and credit left at the end of a month does not carry over.
How a month is priced
Each meter is priced on its own, then the meters are added up and the credit comes off.
meter cost = used ÷ unit size × price
month total = sum of meter costs
to pay = month total − $5, or $0 if the total is $5 or less
The plan includes no free amounts, so every unit used counts. Manage billing shows how to cap the month and set alerts.
Worked examples
A small app
A notes app takes 3 million requests in a month. Its handlers use 6 million CPU-ms, and its lunas are awake for 640,000 seconds in all, about 178 hours. It keeps 2 GB of tables all month and sends out 5 GB.
| Meter | Used | Arithmetic | Cost |
|---|---|---|---|
requests |
3,000,000 | 3 × $0.30 | $0.90 |
lunaCpuMs |
6,000,000 | 6 × $0.02 | $0.12 |
lunaMemoryMibMs |
640,000 s × 0.125 GB = 80,000 GB-seconds | 0.08 × $12.50 | $1.00 |
databaseByteHours |
2 GB-month | 2 × $0.20 | $0.40 |
egressBytes |
5 GB | 5 × $0.05 | $0.25 |
The month comes to $0.90 + $0.12 + $1.00 + $0.40 + $0.25 = $2.67. The $5 credit covers it, so the app pays $0.
A chat app
A chat app takes 10 million requests and sends 40 million messages to connected apps. Its handlers use 30 million CPU-ms, and its lunas are awake for 2,400,000 seconds in all. It keeps 10 GB of tables all month and sends out 50 GB.
| Meter | Used | Arithmetic | Cost |
|---|---|---|---|
requests |
10,000,000 | 10 × $0.30 | $3.00 |
messages |
40,000,000 | 40 × $0.03 | $1.20 |
lunaCpuMs |
30,000,000 | 30 × $0.02 | $0.60 |
lunaMemoryMibMs |
2,400,000 s × 0.125 GB = 300,000 GB-seconds | 0.3 × $12.50 | $3.75 |
databaseByteHours |
10 GB-month | 10 × $0.20 | $2.00 |
egressBytes |
50 GB | 50 × $0.05 | $2.50 |
The month comes to $3.00 + $1.20 + $0.60 + $3.75 + $2.00 + $2.50 = $13.05. After the $5 credit, the app pays $13.05 − $5.00 = $8.05.
A sandbox
A sandbox with 2 CPUs and 4 GiB of memory runs for 100 hours in a month, which is 360,000 seconds. Its 10 GB disk is kept all month. This example counts only the sandbox’s own meters.
| Meter | Used | Arithmetic | Cost |
|---|---|---|---|
sandboxCpuMs |
2 × 360,000 = 720,000 vCPU-seconds | 720,000 × $0.00002 | $14.40 |
sandboxMemoryMibMs |
4 GB × 360,000 s = 1,440,000 GB-seconds | 1.44 × $2.50 | $3.60 |
sandboxDiskByteHours |
10 GB-month | 10 × $0.10 | $1.00 |
The month comes to $14.40 + $3.60 + $1.00 = $19.00. After the $5 credit, it costs $19.00 − $5.00 = $14.00.