google_ pubsub_ topic cost estimation
A pub/sub topic for messaging. Priced per TB of message ingestion and delivery, with a generous free tier.
A google_
Pricing:
Message throughput: $40 per TiB of message data, applied to publish requests, delivery, and seek operations. The first 10 GB/month is free at the project level.
Cloud Pub/Sub Lite (a separate resource type) is cheaper per TiB but requires provisioning capacity (similar to Kinesis shards) and lacks some features. Right for very high-throughput workloads.
Snapshots and seek: snapshots are $0.27 per GB-month and seek operations count toward throughput. Right for replay scenarios.
Cross-region delivery: messages published in one region but consumed in another incur cross-region egress at standard GCP rates.
Storage: Pub/Sub stores undelivered messages for up to 7 days by default (configurable via message_
There's no per-topic fee. Topics, subscriptions, and snapshots are all free as resources; you pay only for actual message throughput.
c3x estimates Pub/Sub from c3x-usage.yml's monthly_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_pubsub_topic" "events" {
name = "production-events"
message_retention_duration = "604800s" # 7 days
schema_settings {
schema = google_pubsub_schema.event.id
encoding = "JSON"
}
}
resource "google_pubsub_subscription" "processor" {
name = "event-processor"
topic = google_pubsub_topic.events.name
ack_deadline_seconds = 60
message_retention_duration = "604800s"
retry_policy {
minimum_backoff = "10s"
maximum_backoff = "600s"
}
}Pricing dimensions
What you actually pay for when you provision google_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Message throughput | per TiB | Counted across publish, delivery, and seek. First 10 GB/month free at project level. $40/TiB |
| Snapshot storage | per GB-month | Storage of message snapshots for replay. $0.27/GB-month |
| Retained messages (beyond default) | per GB-month | If message_ |
| Cross-region egress | per GB | Messages delivered to consumers in a different region. |
Optimization tips
Common ways to reduce google_ cost without changing the workload.
Take advantage of the 10 GB/month free tier
Up to $0.40/month per project (small projects)Most low-volume integrations and dev environments stay within free tier. The 10 GB is across the entire project, not per topic.
Use Pub/Sub Lite for very high-throughput workloads
Up to 80% on high-volume workloadsAt sustained throughput above ~1 TiB/day, Lite is cheaper than standard Pub/Sub if you can manage provisioned capacity. Lite is a separate resource (google_
Batch publishes and acknowledgments
Marginal, Pub/Sub bills by data, not request countPublishing in batches reduces overhead. Subscription clients with high ack rates can use batched modify-ack-deadline calls to reduce request count.
Set short message_ retention_ duration
Storage for slow-consumer scenariosDefault is 7 days. If your consumers always process within 1 day, set retention to 24 hours. Undelivered messages cost storage; aged-out messages are deleted.
FAQ
Why does c3x show Pub/Sub topic as $0?
Pub/Sub topics themselves are free. Cost is entirely usage-based. Add monthly_
Is Pub/Sub cheaper than SNS/SQS?
Different model. SNS/SQS bill per million requests; Pub/Sub bills per TiB. For small messages at high frequency, SNS/SQS often wins. For larger messages at moderate frequency, Pub/Sub wins. Crossover depends on average message size.
What's the difference between Pub/Sub and Pub/Sub Lite?
Lite is a cheaper, regional-only, capacity-provisioned variant with fewer features (no schema registry, no exactly-once delivery, no filtering). Right for very high throughput in a single region.
Are subscriptions billed separately?
No, but message delivery to each subscription counts toward the topic's throughput. A message published once and delivered to 5 subscriptions counts as 6 TiB units (1 publish + 5 deliveries).
Related resources
More Google Cloud resources
Further reading
- GCP Cloud Scheduler cost: a few cents per job per month
Cloud Scheduler bills per job per month (the first three free, then about $0.10 each), making it one of the cheapest ways to run cron in the cloud. The real cost is the work each job triggers, not the scheduler. Here is the model.
- Pub/Sub cost explained: what $40 per TiB actually buys you
Pub/Sub prices throughput at a flat rate per TiB with no shards to provision, which is either a bargain or a trap depending on your fan out factor and retention settings. Here is the full meter list.
- GCP Pub/Sub Lite vs Pub/Sub cost: when the cheaper tier pays off
Pub/Sub bills per gigabyte of message throughput with no capacity planning, while Pub/Sub Lite bills for provisioned capacity at a much lower unit rate. Here is how the two compare on cost and when Lite's savings justify its extra management.
- The cost of a message queue in the cloud
Managed message queues like SQS, Pub/Sub, and Azure Service Bus bill per request or per message, sometimes plus data and features. Here is how queue pricing works, what drives the bill, and how to keep messaging cost low.
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_.