GCP – Compute Engine – Pricing Options

Join Telegram GCP Study Group  

There are multiple ways how you can get discounts while using Compute Engine instances. To get the discounts, it’s important to understand the pricing structure for Google Compute Engine.

  • The billing for Compute Engine instances is done for each resources used in the instance. For example, each vCPU and each GB of memory used in the Compute Engine instance is billed separately.
  • If you use a Machine Type with some memory and vCPU, then you won’t be billed for the machine type, rather you will be billed for the memory and vCPU separately used by the VM instance.
  • If you run a VM instance for less than one minute, then also you will be billed on vCPU, GPU and GB of memory for one minute. Because for the first one minute, the billing happens for one minute minimum. One minute onwards, the billing happens per second of usage.
  • There are some premium images also for which billing applies. For example – 
    • Red Hat Enterprise Linux
    • SUSE Linux Enterprise Server
    • Windows Server
    • SQL Server
  • Resources on the VM instance are charged when the instance is uptime. Instance uptime is calculated since the instance is started and till the instance status becomes Terminated.
  • Even if you are not using the instance but if your instance is in Running state, then also cost will be incurred. 
  • There are three different kinds of discounts which you can get on Compute Engine instances –
    • Sustained Use Discount
    • Committed Use Discount
    • Preemptible VMs usage Discount
  • These discount types can’t be combined. It means that if you are using Preemptible VM instances and getting that discount, you can’t avail Sustained use or Committed use use discount at that time.
 
  • Sustained Use Discount
    • These are automatic discounts that Google cloud provides you for running specific Compute Engine resource for a significant amount of time in a billing month in a region.
    • These discounts are reset at the beginning of each month.
    • When you run a Compute Engine instance for more than 25% of the time in a month, then you get some discount depending on the machine type of the VM instance. If you run the instance for more than 50% of the time, you get even more discount. Similarly, if you use the VM instance for 75% or 100% of the time in a month, the discount get increased. But there is a maximum limit of the discount depending on the machine type of the instance.
    • For general-purpose N1 pre-defined or custom machine type or memory-optimized machine type or shared-core machine type – you get a maximum discount up to 30%.
    • For general-purpose N2 and N2D pre-defined or custom machine type or compute-optimized machine type – you get a maximum discount up to 20%.
    • There is a limitation that Sustained use discounts do not apply to E2 machine type.
 
 
 
 
  • Committed Use Discount
    • If you know the resource requirements of your workload beforehand and you need to run the workload continuously, you can opt for Committed use discount on running Compute Engine instances.
    • You get this discount when you are committed to use your VM instances for longer period of time and you get a contract for committed use. 
    • You can go for 1 year or 3 years committed use discount offers. 3 years committed use offers more discount compared to 1 year committed use.
    • You can purchase a committed use discount for a single project.
    • You can also purchase multiple committed use discounts to be used across multiple projects in a region.
    • Though you purchase a committed use discount beforehand, but you are billed on monthly basis till the duration of the contract. It does not require any upfront cost.
    • You can purchase committed use discount for resources like vCPU, memory, GPU, Local SSD depending on the machine type of the Compute Engine instance.
    • You can’t combine committed use and sustained use discounts on the same resource.
    • Committed use discounts do not apply to Preemptible VM instances and you can’t combine more than one type of discount on the same resource.
    • Committed use discounts do not apply to N1 shared-core machine type or extended memory.
 
  • Preemptible VM Instances
    • This is a Compute Engine instance that you can run at a much lower price than normal VM instance.
    • The drawback is that these instances can be stopped at any point, so the workload which it is processing can be left in between.
    • Because of the above limitation, it is important that you check the workload for which you want to use the Preemptible VM instance.
    • For example, for your batch jobs, this kind of VM instance will be good as it provides very cost-effective solution to process this kind of workload.
    • Preemptible VM instances can run for maximum 24 hours and then it is stopped. But it can be stopped before 24 hours as well.
    • If your preemptible VM is stopped before one minute by the Compute Engine, then you won’t be billed for it.
    • When Compute Engine is about to stop a preemptible VM instance, below steps are taken –
      • Compute Engine sends a preemption notice to the VM instance.
      • You can use the shutdown script to handle the preemptible notice and the cleanup activities before the VM instance is stopped.
      • If the VM instance does not stop after 30 seconds of sending preemptible notice then Compute Engine sends another signal to the operating system.
      • This makes the VM instance to go in Terminated state.
    • You can attach persistent disk with preemptible VM instance and don’t select “Mark for auto-delete”. In that case,  when you VM instance is terminated then also you can access the data from the persistent disk. Just that it will incur cost of storage, until you delete the persistent disk.
    • This is a cost-effective option but there is a trade-off with High Availability. So, it can’t be used for HA solutions.

 

Learn more on Google Cloud Services

Leave a Comment

Your email address will not be published.