GCP Compute Engine Cost Optimization Guide
GCP Compute Engine Cost Optimization Guide

Published July 25, 2024

By Kirti

A Compute Engine virtual machine is easy to create and easy to forget. It takes a minute to launch, and then it runs, and bills, until someone changes it. Over time, a team ends up with machines whose size and hours were set once and never revisited.

This guide explains where Compute Engine cost comes from, why teams misjudge it, and what to do about it, with a focus on GCP Compute Engine scheduling. The first sections are general Google Cloud knowledge, and pricing details change, so check current documentation. The last section covers only what Bigbell provides.

What Compute Engine Cost Actually Means

A virtual machine's bill has several parts. The main one is compute: the virtual CPUs and memory, charged while the machine runs. Persistent disks are charged for the space provisioned, whether or not the machine is on. Static external addresses, snapshots, and network traffic add their own charges.

Two decisions drive most of the compute cost. The first is size, meaning the machine type. A larger type costs more for every hour it runs. The second is hours, meaning how long the machine runs. A server that is only needed on weekdays still bills on weekends if nobody stops it.

That is why cost work on Compute Engine usually comes down to three questions. Is the machine the right size? Does it need to run all the time? Is there anything attached to it, such as disks or addresses, that nobody uses?

Google Cloud also offers pricing options such as committed use discounts and Spot VMs. These change the price per hour rather than the number of hours or the size, and they suit different workloads. Spot VMs, for example, can be stopped by Google Cloud when it needs the capacity, so they fit work that can be interrupted.

Why It's Often Misunderstood

The first misunderstanding is that a stopped machine costs nothing. Compute charges generally stop when a VM is stopped, but its disks and any reserved addresses continue to be billed.

The second is about the word "terminated." In Compute Engine, a stopped VM is shown with the status TERMINATED. This does not mean it has been deleted, although it does confuse people who see it for the first time.

The third is believing that resizing is a live change. Changing the machine type of a VM requires it to be stopped, so a resize means a short outage.

The fourth is sizing by guess. Teams pick a type once, and because nothing fails, they never check whether it is oversized. Low average usage is a hint, not proof, since a machine may need its size for a short peak.

Practical Implications for DevOps Teams

Start with an inventory. List every VM, its zone, machine type, and owner.

Find machines that do not need to run all day, such as development and test servers, and decide their working hours. Google Cloud has its own instance scheduling features, and external tools and scripts can do the same.

Review usage before resizing. Look at CPU and memory over a few weeks, including your busiest period. Resize in small steps and measure the effect.

When stopping machines, check the boot disk settings. A disk configured to be deleted with the instance behaves differently from one that is kept, so confirm what will happen before you automate anything. Check also that applications start correctly after a reboot and that nothing depends on a changing external address.

Look at the extras. Unused disks, old snapshots, and reserved addresses that are not attached to anything keep costing money.

How Bigbell Helps

Bigbell supports scheduling for Google Cloud virtual machines in Resource Lifecycle Management. You add your Google Cloud project to Bigbell with its credentials, then create schedules for a VM. Each schedule has an action, either start, stop, or modify, and a cron expression for when it runs. Bigbell shows the expression in plain English. A typical working hours pattern uses two schedules, one to start the VM and one to stop it. Bigbell finds the zone of the VM from the region you give it, and you can edit or delete schedules at any time.

For a modify action, you enter the new machine type, such as a type name Google Cloud recognizes. Bigbell stops the VM if it is running, changes the machine type, and starts it again. If the VM is already stopped, it proceeds with the change and then starts it. The VM is running afterwards, and there is downtime in between. Bigbell's AI chat can also create and manage schedules.

For safety checks, the Cloud Security Scanner reports Compute Engine VMs and Cloud SQL instances without deletion protection, which is useful before you automate changes.

The limits matter. Schedules run in Indian Standard Time. Bigbell does not choose which VMs to schedule, does not detect unused disks, snapshots, or addresses, and does not recommend a machine type or confirm that your chosen type is valid. We have not verified that utilization findings, such as over-provisioned servers, appear for Google Cloud accounts, or that notifications are sent when a scheduled action runs. Bigbell also does not calculate savings.

Book a demo to see how schedules work for your Google Cloud VMs.

FAQ

What drives Compute Engine cost? Machine type and running hours, plus disks, addresses, snapshots, and network traffic.

Does a stopped VM cost anything? Compute charges generally stop, but disks and reserved addresses continue to be billed.

What does the TERMINATED status mean? In Compute Engine, it means the VM is stopped, not deleted.

Can I change a VM's machine type while it runs? No. The VM must be stopped first.

Can Bigbell schedule Google Cloud VMs? Yes. It supports start, stop, and modify schedules.

What does modify do in Bigbell? It stops the VM, changes the machine type, and starts it again.

What if the VM is already stopped? Bigbell proceeds with the change and then starts it.

Does Bigbell find the zone for me? It resolves the zone from the region you provide.

Which time zone do schedules use? Indian Standard Time.

Can Bigbell find unused disks or addresses? No. It does not detect them.

Does Bigbell recommend a machine type? No. You enter the type you want.

Does Bigbell check for deletion protection? The scanner reports Compute Engine VMs without it.

Which VMs are best to schedule? Development, test, and demo machines that are idle outside working hours.

Are Spot VMs suitable for scheduling? They suit interruptible work, but Google Cloud can stop them at any time, so they are a different tool from schedules.

Does a VM keep its data when stopped? Data on persistent disks stays, but data held in memory is lost.

Does the external IP change after a restart? It can, unless a static address is reserved, so check how other systems connect.

How do I choose a new machine type? Review CPU and memory over a few weeks, including peak periods, and change in small steps.

Should I check the boot disk before stopping VMs? Yes. Confirm the disk's delete behavior so you know what happens when the VM is removed.