The formula
bill = instances × price/hour × hours + GB × price/GB + billable egress × price/GB
Where it comes from
A cloud bill has three lines charged three different ways: compute per hour switched on, storage per gigabyte-month, and transfer per gigabyte leaving to the internet — the one that surprises people, because inbound is usually free and outbound is not. Adding them up is the easy part; what is hard to see without doing the sum is which line dominates, and for a service serving files or video it is usually the transfer, not the machines.
How to work it out by hand
- Compute: instances times price per hour times hours switched on
- Storage: gigabytes times price per gigabyte-month
- Transfer: subtract the free gigabytes and multiply the rest by its price
- Add the three lines
What is worth knowing
There are two ways to cut the bill and the page shows both. Reserving instances for one or three years usually takes off between a third and a half, but only from compute: storage and transfer cost the same, so the real saving is smaller than the headline percentage. The other is switching off what is not needed overnight and at weekends: a development environment on only in working hours is 220 hours a month instead of 730, 70 % less compute with no commitment at all. Almost nobody does it, and it is the easiest line to trim.