google_ alloydb_ instance cost estimation
A PostgreSQL-compatible instance within an AlloyDB cluster. Priced per vCPU-hour and per GB of memory-hour, plus separately-billed cluster storage.
A google_
Instance compute bills on two meters: per vCPU-hour and per GB-of-memory-hour. AlloyDB uses a fixed 8 GB of memory per vCPU, so a 2-vCPU instance carries 16 GB of memory. At roughly $0.066/vCPU-hour and $0.0112/GB-hour, a 2-vCPU primary runs about $227/month. Read-pool instances are priced the same way per node, so a read pool multiplies the instance cost.
Storage is billed at the cluster level, not per instance, on actual data stored plus a continuous backup component, so it appears on google_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_alloydb_instance" "primary" {
cluster = google_alloydb_cluster.main.name
instance_id = "primary"
instance_type = "PRIMARY"
machine_config {
cpu_count = 4
}
}Pricing dimensions
What you actually pay for when you provision google_.
| Dimension | Unit | What's being charged |
|---|---|---|
| vCPU hours | per vCPU-hour | Per-vCPU rate for the instance, billed continuously. c3x reads machine_ $0.06608/vCPU-hour in us-central1 |
| Memory hours | per GB-hour | Memory is fixed at 8 GB per vCPU. Billed per GB-of-memory-hour across the instance's total memory. $0.0112/GB-hour in us-central1 |
| Cluster storage (separate resource) | per GB-month | Data storage and continuous backup bill at the cluster level on google_ |
Sample C3X output
Example output from c3x estimate for a 4-vCPU primary (32 GB):
google_alloydb_instance.primary
├─ vCPU hours (4) 2,920 vCPU-hours $192.95
└─ Memory hours (32 GB) 23,360 GB-hours $261.63
OVERALL TOTAL $454.58
(cluster storage billed via google_alloydb_cluster)Optimization tips
Common ways to reduce google_ cost without changing the workload.
Right-size vCPU count to real load
Proportional to over-provisioningCost scales linearly with vCPUs (and memory follows at 8 GB each). An over-provisioned primary pays for both meters. Pull query and CPU metrics and drop to the smallest cpu_
Add read-pool instances only when read load demands it
Per avoided read nodeEach read-pool instance is a full-priced node. Scale the pool to actual read QPS rather than provisioning replicas speculatively.
Compare against Cloud SQL for modest workloads
Workload-dependentAlloyDB targets high-performance PostgreSQL. For modest databases, google_
FAQ
How does c3x estimate AlloyDB instance cost?
It reads machine_
Why is storage not on the instance estimate?
AlloyDB bills storage and continuous backup at the cluster level, shared across the primary and read-pool instances. So those charges appear on google_
How much memory does an AlloyDB instance have?
A fixed 8 GB per vCPU. You set cpu_
Are read-pool instances priced like the primary?
Yes. Each read-pool instance bills the same per-vCPU and per-memory meters as the primary. A read pool of two 4-vCPU nodes costs roughly twice a single 4-vCPU instance.
Is AlloyDB cheaper than Cloud SQL?
Not usually for small databases. AlloyDB's compute rates target high-performance workloads. For modest needs, Cloud SQL (google_
Related resources
More Google Cloud resources
Further reading
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including google_.