How to Find and Resize GCP Instances with Low CPU Usage

Optimize your GCP resources by monitoring instances with low CPU usage. Learn how to resize them and reduce cloud costs in this guide.

Patrick Londa
Author
Jul 21, 2022
 • 
 min read
Share this post

Matching your investment in computing resources with your engineering and business needs is a constant evolution. As you gather and monitor usage data, you can make iterative adjustments to improve the efficiency of your infrastructure.

For example, one way to optimize your resources in Google Cloud is by looking for GCP instances that are operating at a low usage rate.  

Low CPU usage can be an indicator that you have an opportunity to better size your instance and lower your cloud costs. In this guide, we’ll walk you through the steps to find these low usage instances and make adjustments.

Defining Low CPU Usage

First, CPU usage, or utilization, refers to the computing resources used by a given utility or machine over a period of time. For example, AWS defines low usage to be less than 40% maximum CPU and memory usage over the last four-weeks.

For GCP, there isn’t a universally recommended level, but it’s worth considering any instances whose average CPU utilization is below 35%, and especially if it is below 20%. For the purposes of optimizing your resource allocation, it’s most important to select a benchmark and monitor it consistently.

Blink Automation: Ensure GCP Compute Instances with Low CPU Usage are Reviewed
Blink + GCP
Try This Automation

Locating GCP Instances with Low CPU Usage

In a GCP ecosystem, resizing GCP instances is not only a matter of site reliability engineering but also a business priority. Querying, or identifying, your GCP compute instances with low CPU utilization is a performance management task that should be informed also by your organization's unique engineering and business considerations.

Understanding how your CPU performs across different VM deployments starts with performance monitoring and management. To do this, you need to:

  1. Go to the VM Instances page.
  2. Select the VMs you want to view performance metrics for. This should open the VM instance Details page.
  3. Click the Observability tab to open the Observability Overview page.
  4. On the Overview page, you'll find "CPU Utilization," where you can see the percent of CPU used by the selected VMs.

Resizing Low Usage GCP Instances

Once you've identified which VMs are under-utilized, over-utilized, or used optimally according to your actual needs, you should resize underutilized VMs.

One of the most convenient and cost-effective ways is to change the machine type, but you can only do this for a stopped VM (in TERMINATED state). That means that you should consider which VMs — and therefore which resources — are a priority for your immediate, short-term, and long-term needs and plans.

To change GCP instances, you need to:

  1. Go to the VM Instances page.
  2. Under the Name column, select the name of the VM or VMs you want to resize by changing their type.
  3. From the VM instance details page, continue as follows:
  1. If running, click Stop to stop the selected VM(s).
  2. To edit the VM, click edit Edit.
  3. In the Machine configuration section, select the desired machine type or create a custom machine type.
  4. Click Save to save all changes.

Monitoring Low Usage VMs Automatically with Blink

Resizing GCP instances is not a one-time job, but a process that evolves in response to your changing engineering and business considerations. 

By adopting a CloudOps automation platform, you can ensure that CPU performance monitoring and cost management is not a single task but a seamless operation performed regularly.

Blink is a no-code platform that makes it easy to run checks with automations like this one:

Blink Automation: Ensure Compute Instances with Low CPU Utilization are Reviewed in GCP
Blink Automation: Ensure Compute Instances with Low CPU Utilization are Reviewed in GCP

When this automation runs, it does the following steps:

  1. It runs a check across your GCP account for compute instances with CPU utilization lower than a certain threshold.
  2. It sends a report with this information to a specific email address.

It's a simple automation, and that makes it easy to customize. For example, add an approval step to take action on certain instances or send the report via Slack instead.

You can gather information from your tools fast and make repeatable decisions easily.

Get started with Blink today and see just how easy automation can be.

Expert Tip