Romin Irani Profile picture
13 Apr, 25 tweets, 9 min read
A long thread on understanding Google Cloud Platform Compute Engine pricing and how to utilize the various pricing levers at your disposal via the Google Cloud Cost Calculator. Let’s go. (contd)

#GoogleCloudPlatform #ComputeEngine #Pricing #GCPCostCalculator
Google Compute Engine provides a core infrastructure component : Virtual Machines (VM) that are classified into diff families (general, memory optimized, compute optimized) & each family has various machine types. See this guide on how to choose :cloud.google.com/compute/docs/m… (contd)
Each of the machine types (e.g. N1 general purpose) will have several *fixed* or *pre-defined* configurations (instance types) of VPU and RAM. You can choose the appropriate instance types. A set of instance types for N1 is shown below: (contd)
An important thing to consider when you choose a machine type is whether it is available in the GCP Region (actually zone) since VMs are zonal resources. Check out the list of GCP regions and availability of machine types. cloud.google.com/compute/docs/r… (contd)
VM is a rented resource and hence you are charged for the time that you use the Virtual VM. Let’s qualify that. You are charged for the amount of time that you keep a VM in running state. If a VM is stopped, you are not charged for it. cloud.google.com/compute/vm-ins… (contd)
Is there any minimum charge? Is it charged by second/minute/hour? Here you go:
- All vCPUs, GPUs, and GB of memory are charged a minimum of 1 minute.
- After 1 minute, instances are charged in 1 second increments. (contd)
Each VM instance type has a pricing associated with it i.e. per hour pricing. Higher the vCPU/RAM, the pricing inches upwards. Example: pricing for N1 instance types (cloud.google.com/compute/vm-ins…). *Remember* the prices are not the same in each region. (contd)
The pricing is classified into On-demand price, Preemptible price, 1 year commitment price and 3-year commitment price. This can be confusing but let’s understand it with an example that we shall work through with the help of the GCP Cost Calculator. (contd)
First up, we will finalize that we are interested in provisioning a Compute Engine VM instance type (n1-standard-1), which has the following configuration:
- vCPU : 1
- RAM (GB) : 3.75 GB
- Region : Mumbai
- OS : Free (Linux)
(contd)
Remember, I mentioned that GCP charges you for duration that you keep the VM running. So you run it 24 x 7 i.e. 7 days a week and for 24 hours a day i.e. you keep the VM running. GCP charges you by the rate for that instance type. But not everything needs to run 24 x 7.
(contd)
I could have development , test and production environments. The production environments run 24 x 7 but my dev/test environment might only run for 5 days a week (Mon-Fri) and 8 hours a day (9:00AM - 5:00 PM). So I should be charged less right ? Correct. (contd)
First up, we will use the GCP Cost Calculator available at (cloud.google.com/products/calcu…) and see what it costs to run this VM. Visit the URL and enter the values as:
- # instances : 1
- OS : Free
- Series : N1
- Machine Type : n1-standard-1
- Region : Mumbai
(contd)
Ensure that you select 24 hours per day and 7 days per week as shown below. Click on “Add to Estimate”. This will show the pricing to you on the right side:
(contd)
Note:
- The pricing is for the full month : 730 hours per month i.e. your VM is in running state throughout the month
- You can change the currency
- You can email this estimate or even click on Save Estimate to get a URL to share and keep collaborating on the pricing.
(contd)
Notice one of the entries in the billing details “Sustained Use Discount : 30%” . What is going on here? Google Cloud provides an automatic discount (upto a certain %) off the list price, when you use the VM for more time , in our case the entire amount.
(contd)
The more you use, the more discount you get. Check this graph out. If you use it for just 15 days a month, we still give you a % discount. This is Sustained Use Discount (SUD) and it is covered here: cloud.google.com/compute/docs/s…
(contd)
That’s great , isn’t it ? No need to do complex calculations -- we pass on the discount as per your usage. Next up, remember the dev and test environments? What if you wanted to run this for the following:
5 days a week
8 hours a day
(contd)
Let’s click on the Edit button for the pricing as shown below. This will populate the entries in the form of the GCP Calculator, where you can then tweak any settings.
(contd)
Now go ahead and change the values as shown below:
8 hours per day
5 days per week

And click on “Add to Estimate” again.
(contd)
This will bring up the revised pricing as shown below:
(contd)
Good discount , isnt it ? So always plan out your different environments (Production, Development , Testing) and how long the VMs need to be running. Don’t pay for resources that are idle and you are not using. Best Practice : cloud.google.com/compute/docs/i… (contd)
Now, what let’s come to Committed Use Discounts (CUD). If you are willing to commit to running these instances all the time for a period of 1 yr or 3 yr, Google Cloud can give additional discounts. Read about CUD here (cloud.google.com/compute/docs/i… ) (contd)
Let’s see how to do that in the calculator. Let’s edit the previous entry back to running it 24x7 , so that the total is shown as below. This time, we will also label this line item as : SUD Server. (contd)
Next up, make 2 VM entries, one with :
- # instances : 1
- What for : CUD-1yr
- OS : Free
- Series : N1
- Machine Type : n1-standard-1
- Region : Mumbai
- Committed Use Discount : 1 yr

and another similar one but :
- What for : CUD-1yr
- Committed Use Discount : 1 yr.
(contd)
You can see how it is beneficial to go for CUD pricing, if you plan to commit to GCP.
Hope this was useful. I plan to cover more some nuances next on Compute Engine pricing vis-a-vis Custom Machine Types and Pre-emptible in another thread. Cheers. (end)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Romin Irani

Romin Irani Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @iRomin

12 Apr
Excellent article by @janakiramm that clearly calls out both the issue & the opportunity. (...contd) forbes.com/sites/janakira…
The challenge that I am seeing is teams not able to understand if they are building an application or a platform. Another challenge is to win the argument of using a higher level abstraction on top of Kubernetes, within the organization. (...contd)
We need to equip the teams to handle objections, when they tell decision makers about why they should use a higher level abstraction, why it makes more sense, why it still utilizes the power of K8s underneath and so on. (...contd)
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!