Google Cloud Compute Services

Google Cloud provides a range of compute services to run workloads, from fully managed serverless platforms to infrastructure-level virtual machines. The key compute services include Compute Engine, GKE, App Engine, Cloud Run, and Cloud Run functions (formerly Cloud Functions).
Compute Engine
- is a virtual machine (VM) hosted on Google’s infrastructure.
- can run the public images for Google provided Linux and Windows Server as well as custom images created or imported from existing systems
- availability policy determines how it behaves when there is a maintenance event
- VM instance’s maintenance behavior
onHostMaintenance, which determines whether the instance is live migratedMIGRATE(default) or stoppedTERMINATE - Instance’s restart behavior
automaticRestartwhich determines whether the instance automatically restarts (default) if it crashes or gets stopped
- VM instance’s maintenance behavior
- Live migration helps keep the VM instances running even when a host system event, such as a software or hardware update, occurs
- Spot VMs (recommended replacement for Preemptible VMs) offer up to 60-91% discount compared to on-demand pricing
- can be reclaimed by Compute Engine at any time when resources are needed
- unlike Preemptible VMs, Spot VMs have no maximum runtime limit (no 24-hour expiration)
- same pricing model as Preemptible VMs
- ideal for fault-tolerant, batch, and stateless workloads
- Preemptible VMs (legacy — Google recommends using Spot VMs instead)
- can be created and run at a much lower price than normal instances
- always stop after 24 hours of running
- can be stopped at any time when Compute Engine needs resources
- Shielded VM offers verifiable integrity of the Compute Engine VM instances, to confirm the instances haven’t been compromised by boot- or kernel-level malware or rootkits.
- Confidential VMs keep sensitive code and data encrypted in memory during processing (encryption-in-use)
- uses hardware-based memory encryption with AMD SEV, AMD SEV-SNP, or Intel TDX
- supports GPU workloads with A3 machine types (NVIDIA H100) using Intel TDX
- together with encryption-at-rest and encryption-in-transit, provides encryption at all times
- Instance template is a resource used to create VM instances and managed instance groups (MIGs) with identical configuration
- Instance group is a collection of virtual machine (VM) instances that can be managed as a single entity.
- Managed instance groups (MIGs)
- allows app creation with multiple identical VMs.
- workloads can be made scalable and highly available by taking advantage of automated MIG services, including: autoscaling, autohealing, regional (multiple zone) deployment, and automatic updating
- supports rolling update feature
- works with load balancing services to distribute traffic across all of the instances in the group.
- Unmanaged instance groups
- allows load balance across a fleet of VMs that you manage yourself which may not be identical
- Managed instance groups (MIGs)
- Instance templates are global, while instance groups are regional.
- Machine image stores all the configuration, data, metadata and permissions from one or more disks required to create a VM instance
- Sole-tenancy provides dedicated hosting only for the project’s VM and provides added layer of hardware isolation
deletionProtectionprevents accidental VM deletion esp. for VMs running critical workloads and need to be protected- provides Sustained Discounts, Committed discounts, free tier etc. in pricing
Machine Families (Updated 2025)
- General-purpose — best price-performance for common workloads
- C4 — powered by 5th/6th Gen Intel Xeon Scalable processors (Emerald Rapids/Granite Rapids) and Google Titanium
- C4D — powered by 5th Gen AMD EPYC Turin processors and Titanium; up to 80% higher throughput per vCPU for web-serving workloads; supports confidential computing
- C4A — powered by Google Axion (Arm-based) processors with Titanium SSD; up to 72 vCPUs
- N4D — AMD Turin-based; up to 3.5x throughput for web-serving vs. previous-gen N2D
- E2, N2, N2D, N1 — previous generation general-purpose options
- Compute-optimized — highest per-core performance (C2, C2D, H3)
- Memory-optimized — large in-memory workloads (M1, M2, M3, X4)
- Accelerator-optimized — GPU/ML workloads (A2, A3, G2, G4)
- A3 — NVIDIA H100 GPUs, ideal for AI/ML training and large model inference
- G4 — NVIDIA RTX PRO 6000 GPUs for graphics and virtual workstations
- Storage-optimized — high IOPS local storage (Z3)
Storage Options
- Persistent Disk — network-attached block storage (Standard, Balanced, SSD, Extreme)
- Hyperdisk — next-generation block storage with substantially higher IOPS and throughput
- Hyperdisk Balanced — general workloads with independently configurable IOPS and throughput
- Hyperdisk Throughput — optimized for sequential reads/writes
- Hyperdisk Extreme — highest performance for databases
- Hyperdisk Balanced High Availability — multi-zone replication for critical workloads
- Supports Confidential mode for hardware-based encryption
- Local SSD — physically attached high-performance local storage
- Titanium SSD — Google’s custom SSD integrated with Titanium infrastructure (available on C4A)
App Engine
- App Engine helps build highly scalable applications on a fully managed serverless platform
- Each Cloud project can contain only a single App Engine application
- App Engine is regional, which means the infrastructure that runs the apps is located in a specific region, and Google manages it so that it is available redundantly across all of the zones within that region
- App Engine application location or region cannot be changed once created
- App engine allows traffic management to an application version by migrating or splitting traffic.
- Traffic Splitting (Canary) – distributes a percentage of traffic to versions of the application.
- Traffic Migration – smoothly switches request routing
- Supports Standard and Flexible environments
- Standard environment
- Application instances that run in a sandbox, using the runtime environment of a supported language only.
- Sandbox restricts what the application can do
- only allows the app to use a limited set of binary libraries
- app cannot write to disk
- limits the CPU and memory options available to the application
- Sandbox does not support
- SSH debugging
- Background processes
- Background threads (limited capability)
- Using Cloud VPN
- Flexible environment
- Application instances run within Docker containers on Compute Engine virtual machines (VM).
- As Flexible environment supports docker it can support custom runtime or source code written in other programming languages.
- Allows selection of any Compute Engine machine type for instances so that the application has access to more memory and CPU.
- Standard environment
min_idle_instancesindicates the number of additional instances to be kept running and ready to serve traffic for this version.
App Engine Runtime Lifecycle (Updated 2025)
- Legacy runtimes reached End of Support on January 30, 2024 — Python 2.7, Java 8, PHP 5.5, Go 1.11
- Legacy runtimes deprecated on January 31, 2026 and will be decommissioned after that
- Google recommends Cloud Run as the modern alternative for new serverless container workloads
- Cloud Run offers more flexibility: custom containers, VPC connectivity, GPU support, and finer-grained scaling controls
- App Engine migration center provides guidance for moving to Cloud Run
Google Kubernetes Engine (GKE)
- is a managed Kubernetes service for deploying and managing containerized applications
- provides a fully managed environment for deployment, management, and scaling of containerized apps using Google infrastructure
- uses Compute Engine instances as nodes in a cluster
GKE Modes of Operation
- Autopilot mode (default since 2023, recommended)
- fully managed — GKE manages nodes, node pools, and cluster infrastructure
- pay-per-pod model — charges based on requested vCPU, memory, and ephemeral storage
- hardened security configuration enabled by default
- automatic security patching of nodes
- built-in best practices for security, reliability, performance, and scalability
- In 2024, 30% of active GKE clusters used Autopilot mode
- In 2025, Autopilot became available to all qualifying clusters (automatic migration)
- supports custom compute classes for workload-specific hardware requirements
- Standard mode
- provides full control over node configuration and management
- user is responsible for managing and configuring individual nodes
- can run Autopilot-mode workloads within Standard clusters
- multi-cluster management features (Fleets, Teams, Config Management, Policy Controller) now included at no additional cost (2025)
GKE Key Features
- Node Pools — group of nodes with identical configuration within a cluster
- supports autoscaling (automatically adjusts number of nodes)
- supports auto-provisioning (GKE creates optimal node pools automatically)
- surge upgrade strategy by default (maxSurge=1, maxUnavailable=0)
- Cluster Autoscaler — automatically resizes number of nodes based on workload demands
- Vertical Pod Autoscaler (VPA) — adjusts CPU/memory requests for containers
- Horizontal Pod Autoscaler (HPA) — adjusts number of pod replicas
- GKE Sandbox — provides an extra layer of security using gVisor for untrusted workloads
- Confidential GKE Nodes — uses Confidential VMs for hardware-based memory encryption
- Workload Identity Federation — recommended way to access Google Cloud services from GKE workloads
- Binary Authorization — deploy-time security control to ensure only trusted containers are deployed
GKE AI/ML Features (2024-2026)
- GKE Inference Gateway — optimized routing for AI model inference workloads
- GKE Inference Quickstart — simplified deployment for AI inference serving
- Custom Compute Classes — define hardware requirements for AI workloads (GPUs, TPUs)
- GKE Agent Sandbox — secure execution environment for AI agents
- Support for clusters up to 130,000 nodes for massive AI computation
- GKE now powers AI workloads for all top 50 Google Cloud platform customers
GKE Commands
gcloud container clusters create— creates a new cluster (Autopilot by default)gcloud container clusters create --mode=standard— creates a Standard mode clustergcloud container clusters resize --num-nodes— scales the cluster node count (--sizeis deprecated)gcloud container node-pools create— creates a new node pool
Cloud Run
- is a fully managed serverless platform for running containerized applications
- automatically scales containers up and down, including scale to zero
- supports any container that listens for HTTP requests or processes events
- no infrastructure to manage — deploy with a single command (
gcloud run deploy) - Cloud Run services — for serving HTTP requests (web apps, APIs)
- Cloud Run jobs — for running batch tasks to completion (GA since 2023)
- Cloud Run worker pools — for long-running background workers (2025)
- GPU support — serverless GPU acceleration with NVIDIA L4 GPUs (GA 2025)
- ideal for AI inference, image/video processing, and scientific computation
- no cluster management required
- pay-per-use pricing — charged only when container is handling requests or running jobs
- supports both request-based and instance-based billing models
- integrates with VPC for private networking and direct VPC egress
Cloud Run Functions (formerly Cloud Functions)
- Renamed from Cloud Functions to Cloud Run functions in August 2024
- is a Functions-as-a-Service (FaaS) offering powered by Cloud Run and Eventarc
- provides a simple event-driven programming model for small code snippets
- supports 90+ event sources via Eventarc triggers
- deployed as Cloud Run services under the hood, providing same scalability and networking features
- 1st gen — original version with limited event triggers (legacy)
- 2nd gen (Cloud Run functions) — latest version with advanced control, longer timeouts, larger instances, and traffic splitting
- no server management — write code and deploy, infrastructure is handled automatically
- supports Node.js, Python, Go, Java, .NET, Ruby, and PHP
Compute Services Comparison
| Feature | Compute Engine | GKE | App Engine | Cloud Run | Cloud Run Functions |
|---|---|---|---|---|---|
| Type | IaaS | CaaS (Containers) | PaaS | Serverless containers | FaaS |
| Use case | Full VM control | Container orchestration | Web apps | Stateless containers | Event-driven functions |
| Scaling | MIG autoscaling | Pod/node autoscaling | Automatic | Automatic (to zero) | Automatic (to zero) |
| Management | User manages OS, runtime | User manages containers | Google manages runtime | Google manages infra | Google manages everything |
| Pricing | Per VM (seconds) | Per node or per pod | Per instance hour | Per request/instance | Per invocation |
| GPU support | Yes | Yes | No | Yes (L4) | No |
Google Cloud Compute Services Cheat Sheet Questions
- A company needs to run a containerized application that automatically scales based on traffic and requires zero infrastructure management. Which service should they use?
- Compute Engine
- GKE Standard
- Cloud Run
- App Engine Flexible
Show Answer
Answer: c. Cloud Run – provides automatic scaling including scale-to-zero with no infrastructure management for containerized apps.
- A team wants to run Kubernetes workloads without managing node pools, patching, or capacity planning. Which GKE mode should they choose?
- GKE Standard
- GKE Autopilot
- GKE Enterprise
- GKE Sandbox
Show Answer
Answer: b. GKE Autopilot – fully managed mode where GKE handles all node management, patching, and capacity planning.
- Which Compute Engine VM type is recommended over Preemptible VMs and has no maximum runtime limit?
- Shielded VM
- Confidential VM
- Spot VM
- Sole-tenant VM
Show Answer
Answer: c. Spot VM – recommended replacement for Preemptible VMs with same pricing but no 24-hour time limit.
- What happened to Google Cloud Functions in August 2024?
- It was deprecated entirely
- It was renamed to Cloud Run functions
- It was merged into App Engine
- It moved to GKE
Show Answer
Answer: b. It was renamed to Cloud Run functions – Cloud Functions (2nd gen) is now Cloud Run functions, deployed as services on Cloud Run.
- An organization needs to deploy AI inference models on GKE with optimized routing. Which feature should they use?
- GKE Sandbox
- GKE Inference Gateway
- Cloud Run GPU
- Compute Engine A3
Show Answer
Answer: b. GKE Inference Gateway – provides optimized routing specifically for AI model inference workloads on GKE.
- Which storage option provides substantially higher IOPS and throughput than Persistent Disk with independently configurable performance?
- Local SSD
- Standard Persistent Disk
- Hyperdisk
- Filestore
Show Answer
Answer: c. Hyperdisk – next-generation block storage with independently configurable IOPS and throughput.
- A company wants to run serverless GPU workloads for AI inference without managing clusters. Which service is most appropriate?
- Compute Engine with GPU
- GKE with A3 nodes
- Cloud Run with GPU
- App Engine Flexible
Show Answer
Answer: c. Cloud Run with GPU – provides serverless GPU acceleration with NVIDIA L4 GPUs, no cluster management required.
- Which Compute Engine feature protects data in memory using hardware-based encryption?
- Shielded VM
- Confidential VM
- Sole-tenant node
- Live migration
Show Answer
Answer: b. Confidential VM – keeps data encrypted in memory during processing using AMD SEV, SEV-SNP, or Intel TDX.