Pub/Sub pricing: deliveries, retries, fan-out, and payload transfer (practical estimate)

Pub/Sub estimation is mostly "count the deliveries". The biggest mistakes are underestimating retries and forgetting fan-out: one publish can result in multiple deliveries across subscriptions.

0) What to measure

  • Publishes/month: baseline and peak.
  • Fan-out: subscriptions per topic (deliveries per publish).
  • Attempts: average delivery attempts (retries, redeliveries, replays).
  • Payload size: average bytes per message (split large topics separately).

1) Publish volume (baseline and peak)

Start with messages/second (or messages/day) and convert to monthly volume. If traffic is bursty, model peaks separately.

Tool: Rate to monthly volume.

2) Fan-out and delivery attempts (the multiplier)

If a topic has N subscriptions, one publish results in N deliveries. If delivery attempts average 1.2 due to retries, your true deliveries are: publishes x subscriptions x attempts.

  • Keep a separate "replay month" scenario if you reprocess history or DLQ messages.
  • If you use push delivery, validate HTTP retry/backoff behavior; it can multiply attempts.

3) Payload size and transfer

Payload size matters when you move large messages. Multiply average payload size by deliveries to estimate monthly GB moved. If subscribers are cross-region or external, model egress separately.

Tools: Transfer estimator, Egress cost.

4) Retention, replays, and slow consumers (hidden multipliers)

Retention and replays change the cost shape. If a consumer falls behind, you may see bursts of redelivery, replay jobs, and heavier "catch-up" months that do not look like your steady state.

  • DLQ and replay workflows: plan a separate replay month with higher attempts.
  • Ordering and exactly-once features can change throughput and retry behavior; validate for your workload.
  • Large topic payloads: split them out so a single big producer does not hide inside an average.

Worked estimate template (copy/paste)

  • Publishes/month = baseline + peak
  • Subscriptions/topic = fan-out
  • Avg attempts = 1 + retry factor (include replay months)
  • Deliveries/month = publishes x subscriptions x attempts
  • GB moved/month = deliveries x avg payload size (split large topics separately)

Common pitfalls

  • Counting publishes but not deliveries (fan-out multiplies).
  • Ignoring retries and DLQ replays (attempts are the multiplier).
  • Assuming all topics have small payloads (split large topics separately).
  • Cross-region subscribers creating egress you did not budget.

Validation checklist

  • Validate retry rates and DLQ/replay patterns (deliveries, not just publishes).
  • Validate fan-out (subscriptions) for each top topic.
  • Validate payload size distribution and identify large topics/endpoints.

Related reading

Sources


Related guides

Artifact Registry pricing (GCP): storage + downloads + egress (practical estimate)
A practical Artifact Registry cost model: stored GB-month baseline, download volume from CI/CD and cluster churn, and outbound transfer. Includes a workflow to estimate GB-month from retention and validate layer sharing and peak pull storms.
Cloud SQL pricing: instance-hours, storage, backups, and network (practical estimate)
A driver-based Cloud SQL estimate: instance-hours (HA + replicas), storage GB-month, backups/retention, and data transfer. Includes a worked template, common pitfalls, and validation steps for peak sizing and growth.
Bigtable cost estimation: nodes, storage growth, and transfer (practical model)
A driver-based Bigtable estimate: provisioned capacity (node-hours), stored GB-month + growth, and network transfer. Includes validation steps for hotspots, compactions, and peak throughput that force over-provisioning.
GCP VPC egress costs: estimate outbound transfer by destination (practical workflow)
A practical method to estimate GCP outbound transfer: split by destination (internet, cross-region, inter-zone, CDN origin), convert usage to GB/month, and validate boundaries. Includes a worked template, pitfalls, and optimization levers.
Inter-zone transfer costs on GCP: identify flows, estimate GB/month, and reduce churn
A practical checklist to estimate cross-zone data transfer: load balancers, multi-zone clusters, east-west chatter, and storage/database access patterns. Includes a worked template, validation steps, and control levers.
Messaging costs explained: requests, deliveries, retries, and payload size
A practical framework to estimate queue and pub/sub bills: request-based pricing, deliveries/retries, fan-out, and payload transfer (the hidden multiplier).

Related calculators


FAQ

What usually drives Pub/Sub cost?
Message volume and delivery attempts are common drivers. Retries and multiple subscriptions (fan-out) multiply deliveries.
How do I estimate quickly?
Estimate publishes/month, subscriptions per topic, average delivery attempts, and payload size. Model fan-out and replay months explicitly.
What is the most common mistake?
Counting publishes but not deliveries. Fan-out plus retries means deliveries can be several times larger than publishes.
How do I validate?
Validate retry rates, dead-letter/replay behavior, and payload size distribution for the top topics (not a blended average).

Last updated: 2026-01-27