#Intro


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.

 

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.

 

#Comparison
Let’s go over a summary of what is happening with each cloud, in alphabetical order.

 

| Service                | Bills for stopped machines? |
|------------------------|----------------------------:|
| Alibaba ECS            |            Yes (by default) |
| Amazon EC2             |                          No |
| Digital Ocean          |                         Yes |
| Google Compute Engine  |                          No |
| IBM Cloud              |                          No |
| Linode                 |                         Yes |
| Microsoft Azure        |                       Maybe |
| Vultr                  |                         Yes |

 

This is a very high level picture. For more details keep on reading or go [here](https://blog.mist.io/post/611039713030193152/billing-for-stopped-machines) for a more condensed view.  

 

**Alibaba ECS**


ECS 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:


*  attached block storage
*  associated elastic IPs
*  bandwidth
*  images


For more details, check the official documentation for PAYG pricing [here](https://www.alibabacloud.com/help/doc-detail/40653.htm) and specifically for stopped instances [here](https://www.alibabacloud.com/help/doc-detail/63353.htm?spm=a2c63.p38356.b99.17.418a7470ZwN0bN).

 

**Amazon EC2**


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:



*  attached block storage
*  associated elastic IPs


For more details, check the official documentation [here](https://aws.amazon.com/ec2/pricing/on-demand/) and “Billing and purchase options” in this [FAQ](https://aws.amazon.com/ec2/faqs/).

 

**Digital Ocean**


Droplets are billed per hour even if they are stopped. Check the relevant answers in their pricing [FAQ](https://www.digitalocean.com/pricing/#FAQs).

 

**Google Compute Engine**


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:


*  persistent storage attached
*  local SSDs
*  associated static IPs


For more details, check the official documentation [here](https://cloud.google.com/compute/all-pricing).

 

**IBM Cloud**


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:


*  storage
*  secondary public IP address


For more details, check the official documentation [here](https://cloud.ibm.com/docs/vsi?topic=virtual-servers-requirements).

 

**Linode**


Linodes are billed per hour even if they are stopped. Check the relevant answers in their pricing [FAQ](https://www.linode.com/pricing/#row--faqs).

 

**Microsoft Azure**


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](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/states-lifecycle).



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:


*  attached Premium (SSD based) disks
*  Attached Standard (HDD based) disks
*  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](https://azure.microsoft.com/en-us/pricing/details/ip-addresses/).

For even more details, check the FAQ at the bottom of this [page](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/). The URL ends with /linux but you will also find the same FAQ under /windows…

 

**Vultr**


Vultr cloud instances are billed per hour even if they are stopped. Check the relevant answers in their pricing [FAQ](https://www.vultr.com/resources/faq/).

 

#Other parameters


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](https://www.alibabacloud.com/help/doc-detail/56220.htm?spm=a2c63.p38356.b99.15.25cc166bYXiesi), 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](https://aws.amazon.com/savingsplans/), 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](https://cloud.google.com/compute/docs/instances/signing-up-committed-use-discounts) are very similar to Amazon saving plans.

 

[Google’s sustained-use discounts](https://cloud.google.com/compute/docs/sustained-use-discounts) are more complicated. First of all, Google follows an approach which they call [resource-based pricing](https://cloud.google.com/compute/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.

 

#Conclusion


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!

 

We'd love to hear your feedback on other comparisons that will be useful.
Thanks for the detailed analysis. We've been thinking about something like this ourselves. Whatand tools did these guys use?