Optimizing Performance and Cost Efficiency with Google Cloud Compute Engine’s Custom Sizes

Introduction

In the cloud, having the ability to fine-tune your compute infrastructure to meet workload-specifc needs is key. In fact, it is one of the primary reasons why customers migrate to the Cloud. Within compute choices (AWS EC2, Azure VMs, Google Cloud Platform’s Compute Engine, Digital Ocean’s Droplets, etc.) Google Cloud Compute Engine stands unique with its offering of custom sizes.

This is a rather unique offering since other Cloud service providers such as AWS and MS Azure do not have an equivalent offering but offer a large number standard sized ‘instances’. Among several cloud customers, especially ISVs and Digital Native (e.g. SaaS) customers, this is an interesting proposition to optimize compute costs in a manner that is not possible on other Cloud service providers.

Google Cloud Compute Engine:

Google Cloud Compute Engine, an Infrastructure-as-a-Service (IaaS) platform from Google Cloud, allows users to create and manage virtual machines (VMs) in the cloud. This service delivers a scalable and reliable environment suitable for a wide range of applications, from basic web servers to data-intensive workloads.

Custom Sizes: Tailoring VMs to Fit Your Needs

Custom Sizes is a feature that empowers users to design VM instances with precisely the CPU and memory specifications they require. Instead of being limited to predefined machine types, this flexibility allows businesses to finely adjust their cloud infrastructure. For example, a general purpose N2 instance with (2 vCPUs, 6 GB RAM) would be possible on Google Cloud Platform, but currently not on AWS and Azure as a direct service offering.

Caveat:
This however does not mean that any ratio of vCPU:mem can be provisioned. Google Cloud still enforces an acceptable ratio (e.g. 0.5 GB RAM per 1 vCPU for General purpose custom sizes).

When are Custom Sizes useful?

Performance Tuning: Custom Sizes enable customers to create VMs that strike the perfect balance between CPU power and memory capacity. For example, we had a SaaS customer who had a fleet of K8s nodes that didn’t require the RAM being provisioned in each node as a general purpose instance (in this case 1:4 ratio of vCPU:MEM). Their performance sweet-spot was in between 1:2 and 1:4 and either one of the two were sub-optimal. The ability to spin up E2 general purpose instances for K8s using 1:3 ratio (e.g. 2 vCPUs, 6 GB RAM) would mean that their infrastructure is tuned to the right size for the performance required. Similarly for another customer, memory-intensive database could be allocated more memory without unnecessary CPU resources, ultimately enhancing overall performance.

Cost Efficiency: The ability to choose custom E2 instances meant sizeable savings for the above customers’s compute (given that E2 instances on GCP are among the cheapest compute engine options!). Standard machine types come with predetermined configurations, which may include more resources than necessary. Custom Sizes enable users to avoid overprovisioning, leading to cost savings.
PS 1: Please note that on-demand prices for custom machine types include a 5% premium over the on-demand prices for standard machine types.
PS 2: Presumably, this is also the reason Google Cloud’s SKU list has entries for a single core running a particular region and a single GB RAM running in a particular region PER each instance series! These building blocks are priced like legos and each VM you provision just gets charged based on the unit price of vCPU and RAM for that machine type/region. (Further complicated by 1 yr CUDs, 3 yr CUDs, Pre-emptibles etc. but more on that later!)

Scalability: vCPU and Mem requirements of certain workloads could be dynamic, and custom sizes ensure that VMs can adapt as needs change. One can easily adjust VM sizes to accommodate shifting workloads or seasonal spikes, reducing resource waste and cost overruns.

Application-Specific Optimization: Certain applications require unique configurations that do not fit standard machine types. Custom Sizes grant you the freedom to design VMs tailored to one’s specific application needs. This could significantly enhance application performance.

How to Create Custom Sizes VMs

Creating Custom Sizes VMs in Google Cloud Compute Engine is a straightforward process:

Access the Google Cloud Console.

Navigate to Compute Engine and select “VM instances.”

Click “Create” to begin configuring your custom VM instance.

In the “Machine configuration” section, choose “Custom” and specify the desired number of vCPUs and memory.

Continue with the remaining configuration settings as needed, then click “Create” to launch your Custom Sizes VM.

Takeaways:

Google Cloud Compute Engine’s Custom Sizes feature offers users the ability to create VM instances that precisely match their workload requirements. Interestingly, the latest generation (as of Nov 2023) of GCP’s General Purpose C3 instances DO NOT support custom machine types. The Tau T2D series do not support them too.

One of the common mistakes is to consider compute alone as a deciding factor in your cloud solution architecture driven by its lion’s share of the monthly charges. You other services such as disks, storage and databases (and other GCP services too) are equally important that should decide your choice of cloud service provider. It just might be so that the %age of savings that you achieve by tuning your compute with custom sizes are wiped out by the lack of a feature in another service – say Memorystore for Redis / Cloud SQL that might be available in another cloud option. Hence, evaluate all the elements of your technical architecture in the cloud-to-be and see the costs – of migration, of porting and rewriting functionality where some features are not present and then consider the pros and cons of switching. Nevertheless, in a world where adaptability and cost control are critical, custom sizes provide a valuable lever to cloud computing that can unlock significant savings and performance.

Posted by Avinash – CloudRunr.