GCP discounts can help you significantly reduce your cloud spend without unnecessarily compromising performance. Google Cloud offers several discount types for which users can plan their cost optimization strategy. These include:
- Sustained-use discounts – These GCP discounts are automatically applied to running Compute Engine instances
- Committed-use discounts – These GCP discounts are based on a 1-year or 3-year commitment. Naturally, the longer commitment offers the deepest discount.
Committed-use discounts have two types: spend-based (depends on a committed minimum spend) and resource-based (depends on a committed minimum vCPU and memory utilization).
Also, spot instances can deliver drastic savings if you have a fault-tolerant workload. Spot instances are VMs that use shared resources. Therefore, they cost a lot less. However, the drawback is that they can be preempted at any time.
In this article, we’ll take a closer look at GCP discounts so you can develop a cloud cost optimization strategy that works for you.
Executive summary
The table below summarizes five (5) GCP discounts types that will be covered in the article.
Discount type | Description | |
---|---|---|
1 | Sustained-use discounts | Automatically applied to instances running at least 25% of the month. |
2 | Committed-use discounts (CUDs) | The user will commit to either a 1-year or 3-year contract. |
3 | Resource-based committed-use discounts | A type of CUD wherein the user commits to use a minimum amount of resources. |
4 | Spend-based committed-use discounts | A type of CUD wherein the user commits to use a minimum spend. |
5 | Spot instances | VM instances that use shared resources can be preempted at any time. |
Types of GCP Discounts
There are multiple types of GCP discounts that users can leverage. In these sections, we’ll explain each one in detail.
1. Sustained-use discounts
Compute Engine instances that are used for more than 25% of the month will incur a sustained-use discount on vCPU and memory costs. The longer the instance runs, the deeper the discount because it increases incrementally with time. It automatically applies to VMs that fall under Compute Engine and Kubernetes Engine. However, they do not apply to E2, A2, Tau T2D, and Tau T2A machine types.
Discounts reset every first day of the month. So to maximize savings, it is advisable to create VMs on the first day of the month. The discount table is as follows:
Different Usage Levels of Sustained-Use Discounts
Maximum discount | Applicable resources | Usage level (%) | Incremental charge (%) relative to on-demand rate |
---|---|---|---|
30% | General-purpose N1 and custom machine types, memory-optimized machine types, shared-core machine types, and sole-tenant nodes | 0%-25% | 100% |
25%-50% | 80% | ||
50%-75% | 60% | ||
75%-100% | 40% | ||
20% | General-purpose N2 and N2D predefined and custom machine types, and Compute-optimized machine types | 0%-25% | 100% |
25%-50% | 86.78% | ||
50%-75% | 73.3% | ||
75%-100% | 60% |
The incremental change (%) refers to the rate the user will be charged relative to the base rate. For example, if a general-purpose N1 machine is used 25%-50% of the time in a month, the corresponding charge would be 80% of the on-demand rate.
Sample calculation
The discount is calculated by resource. So if, for example, you have an n1-standard-4 instance that has 4 vCPUs and 15 GB of memory that runs for 100% of the month, the calculation is:
vCPU discount = (4 vCPUs x on-demand rate x hours used in the month) x discount rate based on usage
vCPU discount = (4 vCPUs x $0.031611 x 730 hours) x (1-0.3)
vCPU discount = $64.612884
Memory discount = (15 GB x on-demand rate x hours used in the month) x discount rate based on usage
Memory discount = (15 GB x $0.004327 x 730 hours) x (1-0.3)
Memory discount = $33.17
Total discount = vCPU discount + memory discount
Total discount = $64.612884 + $32.476605
Total discount = $97.089489
See the best multi-cloud management solution on the market, and when you book & attend your CloudBolt demo we’ll send you a $75 Amazon Gift Card.
The same principle applies if the user provisions more instances mid-month. Google Cloud will price each set of vCPUs and memory individually and then total everything at the end of the month. These calculations are applied automatically, and users do not need to keep track of these details.
2. Committed-use discounts
These are time-bound contracts that can either last for 1 year or 3 years. The CUDs discussed in this article apply specifically to hardware commitments. Naturally, the latter option provides the deepest discounts. CUDs are good for predictable and consistent workloads. If an environment is slated to use Google Cloud services long-term, these contracts are the ideal way to secure deep discounts. Users can get up to a 57% discount for most machine types and GPUs. Users can get up to a 70% discount for memory-optimized machine types.
Once a CUD is purchased, users are billed every month regardless of whether or not they use the resources.
Additionally, CUDs can synergize with sustained use discounts. Provided the machine type is eligible, resources not covered by the CUD will be covered by sustained-use discounts.
Depending on the Google Cloud service, CUDs are offered as resource-based or spend-based discounts.
3. Resource-based discounts
Users commit to using a certain number of resources with resource-based discounts.
For example, a contract could state that the user will have to use an e2-standard-2 instance for 1-year. That means GCP will bill the user for 2 vCPUs and 8 GB of memory.
The price depends on the machine type. For example, the pricing for N2 machine types is as follows:
Pricing for N2 Machine Types
Item | On-demand price (USD/hour) | 1-year commitment price (USD/hour) | 3-year commitment price (USD/hour) |
---|---|---|---|
Predefined vCPUs | $0.031611 | $0.019915 | $0.014225 |
Predefined memory (GB) | $0.004327 | $0.002669 | $0.001907 |
Check this link for the price tables of the other machine types.
A back-of-the-envelope calculation for an n2-standard-2 instance gives us:
vCPU on-demand price for 3 years of continuous usage = 730 hours x 12 months x 3 years x $0.031611 per vCPU x 2 vCPUs
vCPU on-demand price for 3 years of continuous usage = $1661.74
vCPU 3-year commitment price = 730 hours x 12 months x 3 years x $0.014225 per vCPU x 2 vCPUs
vCPU 3-year commitment price = $747.67
Memory on-demand price for 3 years of continuous usage = 730 hours x 12 months x 3 years x $0.004327 per GB x 8 GB
Memory on-demand price for 3 years of continuous usage = $909.7
Memory 3-year commitment price = 730 hours x 12 months x 3 years x $0.001907 per GB x 8 GB
Memory 3-year commitment price = $400.93
That would give us the following cost table:
N2-standard-2 Instance Costs
Mode | vCPU cost | Memory cost | Total cost |
---|---|---|---|
On-demand | $1661.74 | $909.7 | $2,571.44 |
3-year commitment | $747.67 | $400.93 | $1,148.6 |
The total discount is around 55%.
4. Spend-based discounts
These discounts are measured in terms of dollars spent. They can apply to the following services: Cloud SQL, Cloud Spanner, Google Cloud VMware Engine, Cloud Run, and Google Kubernetes Engine. Compared to resource-based discounts, these contracts are purchased in the context of a Cloud Billing account. The discount is then applicable to any project attached to that account.
If a user uses less than the amount committed, they will not be able to realize the discount fully. On the other hand, if they go over the hours committed, those hours are billed at the on-demand rate.
The price table for Cloud SQL is as follows:
Cloud SQL Costs
Resource | Price (USD per hour) | 1-year commitment (USD per hour) | 3-year commitment (USD per hour) |
---|---|---|---|
vCPU | $0.0413 | $0.03098 | $0.01982 |
Memory | $0.007 | $0.00525 | $0.00336 |
HA vCPU | $0.0826 | $0.06195 | $0.03965 |
HA memory | $0.014 | $0.0105 | $0.00672 |
The total on-demand spend for one of each resource after 3 years is:
vCPU = 730 hours x 12 months x $0.0413
vCPU = $361.79
Memory = 730 hours x 12 months x $0.007
Memory = $61.32
HA = 730 hours x 12 months x $0.0826
HA vCPU = $723.58
HA memory = 730 hours x 12 months x $0.014
HA memory = $122.64
Whereas the total spend for one of each resource on a 3-year commitment would be the following:
vCPU = 730 hours x 12 months x $0.03098
vCPU = $271.38
Memory = 730 hours x 12 months x $0.00525
Memory = $45.99
HA vCPU = 730 hours x 12 months x $0.06195
HA vCPU = $542.68
HA memory = 730 hours x 12 months x $0.0105
HA memory = $91.98
Therefore, the direct comparison is:
Cloud SQL Costs On-demand vs. 3-year
Resource | Total on-demand spend | Total 3-year commitment spend | % difference |
---|---|---|---|
vCPU | $361.788 | $271.3848 | 24% |
Memory | $61.32 | $45.99 | 25% |
HA vCPU | $723.576 | $542.682 | 25% |
HA Memory | $122.64 | $91.98 | 25% |
CUDs apply to compute capacity. It does not apply to storage, backup, and network egress. A 1-year commitment yields a 20% discount, whereas a 3-year commitment yields a 40% discount.
The discount table is as follows:
Google Cloud VMware Engine Discounts
Discount level | Commitment | Invoice schedule |
---|---|---|
24.4% | 1-year | monthly |
42.5% | 1-year | monthly |
30% | 3-year | Paid in full at the start of contract |
50% | 3-year | Paid in full at the start of contract |
It is possible to pay in full at the start of the contract for even deeper discounts.
The discount rules are the same for every region. Both 1-year and 3-year commitments will get a discount of 17%. However, 3-year commitments can be considered 3 consequential 1-year commitments to be billed at the start of every contract.
CUDs apply to CPU, memory, and ephemeral storage only. Note that CUDs for GKE Standard mode will correspond to Compute Engine rates. For GKE Autopilot mode, a 1-year commitment will get a 20% discount. A 3-year commitment will get a 45% discount. The discount rates are the same for all regions.
5. Spot instances
Spot VMs offer 60%-91% discounts for VMs with additional discounts for GPUs, local SSDs, and external IP addresses. The discount rate varies but will always fall in the same range. The main drawback is that these instances can be preempted at any time if the resources need to be used for something else.
Platform
|
Multi Cloud Integrations
|
Cost Management
|
Security & Compliance
|
Provisioning Automation
|
Automated Discovery
|
Infrastructure Testing
|
Collaborative Exchange
|
---|---|---|---|---|---|---|---|
CloudHealth
|
✔
|
✔
|
✔
|
||||
Morpheus
|
✔
|
✔
|
✔
|
||||
CloudBolt
|
✔
|
✔
|
✔
|
✔
|
✔
|
✔
|
✔
|
Recommendations for Optimizing CGP Discounts
Now let’s review some recommendations and best practices for optimizing GCP discounts.
Know GCP Discount Limitations
Sustained use discounts do not apply to App Engine and Dataflow
Though both App Engine and Dataflow are built on VMs, sustained use discounts do not apply to them. Dataflow has its own savings vehicle called Flexible Resource Scheduling (FlexRS). This option combines standard and Spot VMs to lower costs. Users can achieve a discount of around 40%.
CUDs do not apply to non-Compute Engine pricing models.
The following services follow the Compute Engine pricing models: Compute Engine, Google Kubernetes Engine, Dataproc, and Cloud Composer 1. Other services like App Engine, Dataflow, and Cloud Composer 2 do not.
Hence, CUDs cannot apply to them.
Commitments are on a per-region basis
CUDs are not shareable across regions. This makes sense because on-demand pricing is different for every region. Therefore, CUDs’ discount rate also shifts based on the on-demand price per region.
Use the CUD analysis report
A CUD analysis report is a dashboard that tracks the cost-to-usage ratio of a project’s VMs. It contains pertinent information such as the amount of savings being realized and if the commitments are being fully utilized. Users can decide how to proceed based on the data presented in the dashboard. The analysis is doubly useful because discounts are non-refundable. It guides users to select the right discounts and avoid losing money.
Use shared discounts for multiple projects
You can share discounts across multiple projects by enabling CUD sharing. Not only are CUDs shared across all projects, but so are sustained use discounts. In principle, users will rarely pay at the on-demand rate as long as discount sharing is enabled and they use resources for more than 25% of the month.
Users can manage the allocation of discounts using attribution. By default, proportional attribution is used. However, users can switch to prioritized attribution to target heavily-used resources.
Create robust shutdown scripts
Spot VMs will run a shutdown script once it gets a preemption notice. Workloads should be designed to be fault-tolerant and stateless. Shutdown scripts enable them to exit gracefully and provide ways to pick up where they left off efficiently.
Conclusion
GCP discounts include sustained-use discounts and committed-use discounts. The former is applied automatically, and the latter is based on a 1-year or 3-year commitment. Sustained-use discounts are automatically applied to Compute Engine instances as long as it is used for more than 25% of the month. Committed-use discounts have 2 types: resource-based and spend-based. The former is exclusive to Compute Engine instances, whereas the latter can apply to Cloud SQL, Cloud VMware Engine, Cloud Run, and Google Kubernetes Engine.
Spot VMs can also be used for stateless applications as they also offer significant savings. It is ideal for fault-tolerant and stateless workloads due to the unpredictable nature of preemption.
Related Blogs
The New FinOps Paradigm: Maximizing Cloud ROI
Featuring guest presenter Tracy Woo, Principal Analyst at Forrester Research In a world where 98% of enterprises are embracing FinOps,…
Ready to Run Webinar: Achieving Automation Maturity in FinOps
Automation has become essential to keeping up with today’s fast-paced cloud environment. Manual FinOps processes create bottlenecks, delay decisions, and…