WEB · 4 SERVERS · CPU 20%env=prodDEV · ON 24/7env=devweb $—dev $—total $—PRICE LIST$0.10 per server-hourBUDGET $200ALERT 80%— of $2001def cost(n, hours, rate=0.10):2 return round(n * hours * rate, 2)3web = cost(4, 730)4dev = cost(2, 730)5web = cost(2, 730)6dev = cost(2, 220)7web = cost(2, 730, 0.07)8print(web + dev)UNIT COST10,000 orders— per order$$$$$$$$
Back: web servers, test servers and the price listMiddle and front: tags, the bill, the budget, the Python card, unit costCoins: money flowing from switched-on servers into the billA month of cloud bill: four always-on web servers and two always-on test servers cost $438 at an example $0.10 per server-hour. Tags show who owns each cost; rightsizing, switching test servers off outside working hours and a commitment discount cut it to $146.20. A budget alert and a cost per order keep it in check. Coins are money flowing from servers that are switched on into the bill. The $0.10 per server-hour rate, the 30% discount, the CPU figures, the $200 budget and the 10,000 orders are example numbers. Real prices vary by provider, region and machine type; the arithmetic is exact.

How the bill adds up

  1. A cloud bill is a sum of meters, each rate × quantity. Servers are billed per hour while switched on, busy or idle. Storage is billed per GB-month, data sent out per GB. This Python function prices servers.

Find and cut the waste

Keep it in check

What happens

;; step 1/10 · meters
bill = Σ rate × quantity
  servers   $ per server-hour (on = billed)
  storage   $ per GB-month
  egress    $ per GB sent out

def cost(n, hours, rate=0.10):
    return round(n * hours * rate, 2)

The $0.10 per server-hour rate, the 30% discount, the CPU figures, the $200 budget and the 10,000 orders are example numbers. Real prices vary by provider, region and machine type; the arithmetic is exact. A stopped instance has no hourly compute charge, but its attached disks (EBS volumes) are still billed, so scheduled dev servers cost a little more than $44 in real life.