6

A working guide to understanding Google Compute Engine Pricing Options — Part 2

 3 years ago
source link: https://rominirani.com/a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A working guide to understanding Google Compute Engine Pricing Options — Part 2

In the previous part, we took a look at understanding the basics of Sustained Use Discounts (SUD) and Committed Use Discounts (CUD) and how they are related to pricing a Virtual Machine in Google Compute Engine.

In this article, we are going to take a look at one of the biggest differentiators in Google Cloud Platform : Custom Virtual Machine Types.

Before we get to that, let us continue with the Virtual Machine instance type that we used in the previous article i.e. n1-standard-1 , which as per the documentation gives us 1 vCPU and 3.75 GB RAM.

Google Compute Engine gives us a list of standard machine types, which come with a fixed vCPU and RAM combination and you have a variety of them to choose from. Let’s look at the n1-standard series and the different fixed machine types that we can choose from:

1*3Mr6TNmSUZH2gM9M3tmV3A.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8
Reference : https://cloud.google.com/compute/vm-instance-pricing#n1_predefined

This choice is good since your workloads might have varied requirements in terms of the vCPU and RAM that they need.

We need a higher configuration !!!

Now consider a scenario that you have been happily chugging along with our n1-standard-1 configuration and we are hitting limits in terms of performance. You are told to upgrade to more vCPU and RAM. The first thing that you might end up doing is to look at the list above and start matching the machine type that corresponds to the vCPU and Memory that you want. You have 2 options here:

  • If you find a perfect match, you pick the machine type and we are done.
  • If you don’t find the perfect match, you are likely to choose the next higher configuration.

Let’s concentrate on the 2nd option. You end up choosing the next higher configuration, which means that you have made a compromise and gone for a larger capacity in terms of vCPU and RAM. Nothing wrong with it but the first hit when you do that is going to be the cost ($$$) of running that instance.

We are talking about just one VM over here, but think about a medium sized deployment of 10s of VMs and you are likely to end up in this scenario a lot more than you expected, thereby over provisioning a lot more additional vCPU and RAM, and therefore paying a lot more.

Enter Custom Machine Types

Luckily , there is a 3rd option available in Google Cloud Platform and that is Custom Machine Types. What if you could settle for something in the middle in terms of the vCPU and RAM that you need. What this means is that you come as close as possible to what you need and you end up paying less too. You pay less, because logically the configuration you want is now somewhere between the original configuration and the next higher configuration.

There will certain ratios that you need to maintain in terms of vCPU and RAM for Custom Machine configurations and you should check out the documentation for the same.

Let’s work out the details for our example. We have the following scenario:

  • We had our original VM i.e. n1-standard-1 (1 vCPU and 3.75 GB RAM)
  • We want to upgrade to a configuration where we need 6 vCPUs and 24 GB RAM.

Question: Is the 6 vCPU and 24 GB RAM configuration available among the standard n1-standard-* machine types, as per the list below:

1*bDPRzcewmQnlUwm8Y_qo_Q.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

It’s not an exact match and you might be tempted to go to the n1-standard-8 configuration for a start. Nothing wrong in that, but let’s see what happens when we use the GCP Calculator.

Visit the GCP Calculator at https://cloud.google.com/products/calculator and use the following:

First, let’s look at our original pricing for n1-standard-1 for 24 hours a day and 7 days a week, which we did in the earlier article as shown below:

# instances : 1
What for? : Server-1
OS : Free
Series : N1
Machine Type : n1-standard-1
Region : Mumbai

We get the following pricing as shown below:

1*xQ7sh84eadOHDEsnSQVq8g.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

Next, let’s look at the pricing for a n1-standard-8 configuration as shown below:

# instances : 1
What for? : N1-Server2
OS : Free
Series : N1
Machine Type : n1-standard-8
Region : Mumbai

We get the following pricing:

1*XykhsPsNJrYFMHpIOQpatg.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

This is all fine but we would like to now use the option of custom machine types and see what it will cost us for provisioning exactly what we need:

Once again in the GCP Cost Calculator, enter the following to get the pricing for our custom configuration as per the specifications below:

# instances : 1
What for? : N1-CustomServer
OS : Free
Series : N1
Machine Type : <<< How do we select this >>> ???
Region : Mumbai

So, how do we select a custom machine type in the GCP Cost Calculator. In the form, click on the dropdown list for Machine Type and you will see Custom Machine Type right at the top, as shown below:

1*2KdrH0rwLo34ifrrkJvz5w.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

On selecting that, you will see a slider for selecting the vCPU and RAM combination as shown below and we will select the values:

1*A7QjfnCpfBOrJT4Pk4wCuA.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

Once you add this to the estimate, you will see the pricing as shown below:

1*uJbHJqjpSvuN9fhi3Mrk_Q.png?q=20
a-working-guide-to-understanding-google-compute-engine-pricing-options-part-2-78ee7ff783b8

You can see how the pricing dropped from nearly $230/month to $178/month. That is a lot of savings and this is true cloud pricing in terms of provisioning exactly what you want and getting charged for that.

Additional considerations

Like with everything else, it can’t be that simple, isn’t it ? There are additional things that you need to be aware about:

  • There are certain minimum RAM per VCPU expected in different machine types.
  • The RAM that you can allocate needs to be a multiple of a certain amount i.e. 256MB.
  • Each machine type will be constrained in terms of max vCPUs and RAM supported.
  • There is a max vCPU to RAM ratio that can be supported across different machines. So if you need additional RAM , you will need to provision Extended Memory and some caveats are there to that too in terms of you not being able to make use of Committed Use Discounts on Extended Memory.

Whew ! Don’t worry , just familiarize yourself with the documentation.

This concludes the part on Custom Machine Types , a true differentiator available in Google Cloud. Next up, let us discuss Preemptible Virtual Machines.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK