DEV Community

Cover image for Comparing clouds: Billing for stopped machines
Chris Psaltis for Mist.io

Posted on • Updated on • Originally published at blog.mist.io

Comparing clouds: Billing for stopped machines

Public clouds have grown considerably in size, complexity and sheer number of features. This makes it hard to answer even simple questions, especially when you are trying to compare clouds.

At Mist.io we hear such questions daily so we decided to do something about it. This is the first in a series of posts that compare clouds on a number of practical issues.

One of the questions we hear very often is some variation of the following:

Does my cloud bill me for stopped machines, aka instances, linodes, droplets etc?

The reasoning behind this question is quite simple. If I stop a machine, it means I’m not using it so I assume my cloud will not bill me for it. After all, public clouds are all about elasticity. If this is the case, then I could save a lot of money by stopping machines when they are not needed.

Unfortunately, things are not very straightforward.

Let’s go over, in alphabetical order, what is happening.

Service Bills for stopped machines? Notes
Alibaba ECS Yes (by default) Instances are billed per second.

You could avoid billing for stopped instances connected to a VPC and which don’t have local disks. User action is required for that.

If you turn this feature on and stop an instance, you will be billed for any of the following that apply:

a) attached block storage
b) associated elastic IPs
c) bandwidth
d) images

For more details, check the official documentation for PAYG pricing here and specifically for stopped instances here.
Amazon EC2 No Linux instances are billed per second with 60 seconds minimum. All others are billed per hour.

When you stop an instance, you will be billed for any of the following that apply:

a) attached block storage
b) associated elastic IPs

For more details, check the official documentation here and “Billing and purchase options” in this FAQ.
Digital Ocean Yes Droplets are billed per hour.

Check the relevant answers in their pricing FAQ.
Google Compute Engine No Instances are billed per second with 60 seconds minimum. Some premium images follow a different model.

When you stop an instance, you will be billed for any of the following that apply:

a) persistent storage attached
b) local SSDs
c) associated static IPs

For more details, check the official documentation here.
IBM Cloud No Public Virtual Servers and billed per hour.

IBM offers “Suspended Billing”. Servers after Nov 1st 2018 include suspended billing. Most servers created before this date don’t offer it.

If suspended billing is available and you stop a server, then you will be charged for any of the following that apply:

a) storage
b) secondary public IP address

For more details, check the official documentation here.
Linode Yes Linodes are billed per hour.

Check the relevant answers in their pricing FAQ.
Microsoft Azure Maybe Virtual Machines are billed per second and for the full number of minutes the machine was running. The documentation specifically mentions that if a machine was running for 6min and 45sec you will be charged for 6min.

If the machine status is “Stopped Deallocated”, you are not billed. If it is “Stopped” or “Stopped Allocated”, you are billed for allocated virtual cores but not for software licenses. Full details on virtual machine states are available here.

In order to get to "Stopped Deallocated" state, you have to stop the machine from within Azure's management portal or over the API using a specific deallocation parameter. If you stop the machine from within the OS it will go into “Stop Allocated” state.

If you manage to get to "Stopped Deallocated" state, please keep in mind that you are still billed for any of the following that apply:

a) attached Premium (SSD based) disks
b) Attached Standard (HDD based) disks
c) In ARM deployment model, you are billed for static public IP address unless it is part of the first five in the region. Read more regarding IPs under the FAQ section at the bottom of this page.

For even more details, check the FAQ at the bottom of this page. The URL ends with /linux but you will also find the same FAQ under /windows…
Vultr Yes Vultr cloud instances are billed per hour.

Check the relevant answers in their pricing FAQ.

For easier reference, you can also view the table above in Google Docs.

The comparison includes only services that offer cloud machines. There are also a number of services that offer dedicated hosts and/or bare metals. We didn’t include such services above because they are inherently different and, as expected, they charge you regardless of machine state.

Also, please keep in mind that the comparison refers to pay-as-you-go (PAYG) pricing. Alibaba, Amazon, Google, IBM and Microsoft offer reserved and spot pricing as well. In the case of reserved pricing, you will be billed even if you don’t use your reserved capacity. In spot, stopping a machine will usually release it and return it to the pool. Billing stops at that point, but you can no longer use the machine. This happens in Amazon, Google and Azure. In Alibaba and IBM, stopping a spot will not release it, but you will continue to incur charges until they either claim it back or you release it yourself.

If things were not complicated enough, you also need to take special usage discounts into account. Such discounts are:

  • Alibaba subscriptions
  • Amazon saving plans
  • Google committed-use and sustained-use discount

In the case of Alibaba subscriptions, things are rather simple. When you buy a subscription you pay a discounted price upfront for the entire billing cycle. Changing the status of the machine won't save you anything.

With Amazon saving plans, things are simple too. You commit to certain usage over 1yr or 3yr term and get a discount. If you use it, you’re good. If you don’t use it, you still pay for it.

Google’s committed-use discounts are very similar to Amazon saving plans.

Google’s sustained-use discounts are more complicated. First of all, Google follows an approach which they call resource-based pricing. In this model, the base price of a machine is tied to the underlying resources it is using (vCPUs and memory). If during your billing cycle you continue to run the same total amount of resources, then you gradually earn a discount that’s increasing over time. This is the sustained-use discount. The discount is irrelevant to the actual machines you run, it ties only into the total amount of resources used. This discount doesn’t increase linearly over time. To understand it better we strongly recommend reading the documentation pages linked above.

Having said all of the above, let’s restate the initial question:

Will I save money if I stop my cloud machines when they are not in use?

The answer depends on a number of factors. To get to the bottom of this you need to:

  1. Check if your service will charge you for stopped machines and how.
  2. Check your reservations and long term commitments.
  3. Don’t take spot into account.
  4. If you are using Google Compute Engine, do the math for the sustained-use discount.

All these might sound disheartening, but you could potentially save a lot of money. Just to get a sense of ROI, one of our customers was recently able to reduce a 5-digit monthly bill for dev infrastructure by 50%. They did it by automatically tagging machines upon provisioning and then setting a schedule to stop them during off business hours.

Bottomline, the effort is well justified. Do your research and good luck!

Top comments (0)