Skip to content
Calcrivo

Pub/Sub Cost Calculator

Price Pub/Sub throughput per TiB including the 1,000-byte minimum message size and per-subscription delivery.

Inputs

millions
KB
bytes

Pub/Sub bills a floor of 1,000 bytes per message, so tiny events cost the same as 1 KB ones.

subscriptions

Delivery throughput is billed once per subscription, so fan-out multiplies the bill.

USD/TiB
TiB

The first 10 GiB of throughput each month is free.

GiB
USD/GiB-month
GiB
GiB
USD/GiB

Monthly Cost

$1,506.12

Billed Throughput

37.243TiB

Throughput Charge

$1,489.72

Retention Charge

$16.20

Egress Charge

$0.20

Billed Bytes per Message

2,048bytes

Extra Paid for the Size Floor

0.0%

Cost per Million Messages

$0.3012

Step by step

  1. Values used

    Messages published per month = 5,000 millions; Average message payload = 2 KB; Minimum billed bytes per message = 1,000 bytes; Subscriptions per topic = 3 subscriptions; Price per TiB of throughput = 40 USD/TiB; Free throughput allotment = 0.0100 TiB; Message backlog retained = 50 GiB; Retained storage price per GiB = 0.2700 USD/GiB-month; Snapshot storage = 10 GiB; Cross-region egress = 20 GiB; Egress price per GiB = 0.0100 USD/GiB

  2. Pub/Sub Cost

    billed bytes = messages × max(payload, 1,000-byte floor) × (1 publish + 1 per subscription); cost = (bytes ÷ 1 TiB − free allotment) × per-TiB price + retained GiB × retention price + egress.

  3. Monthly Cost

    = 1,506.12

  4. Billed Throughput

    = 37.243 TiB

  5. Throughput Charge

    = 1,489.72

  6. Retention Charge

    = 16.20

  7. Egress Charge

    = 0.20

  8. Billed Bytes per Message

    = 2,048 bytes

How it works

Pub/Sub prices message throughput by volume, not by message count, but a 1,000-byte minimum per message means a firehose of 100-byte events bills at ten times its real size. Fan-out matters just as much: every subscription attached to a topic re-bills the same bytes on delivery. Teams size Pub/Sub on message counts and are then surprised by the bill, when the two real drivers are the size floor on small events and the number of subscriptions on a busy topic. Confirm the current per-TiB throughput and retention prices in the Google Cloud pricing calculator for your region.

Formula

Pub/Sub Cost

billed bytes = messages × max(payload, 1,000-byte floor) × (1 publish + 1 per subscription); cost = (bytes ÷ 1 TiB − free allotment) × per-TiB price + retained GiB × retention price + egress.

1,000-byte floor
Minimum size Pub/Sub bills per message, regardless of payload
1 publish + subscriptions
Throughput is metered once on publish and once per subscription delivery
retained GiB
Unacknowledged backlog and snapshots, billed per GiB-month

Frequently Asked Questions

How is Pub/Sub Cost calculated?

billed bytes = messages × max(payload, 1,000-byte floor) × (1 publish + 1 per subscription); cost = (bytes ÷ 1 TiB − free allotment) × per-TiB price + retained GiB × retention price + egress. Pub/Sub prices message throughput by volume, not by message count, but a 1,000-byte minimum per message means a firehose of 100-byte events bills at ten times its real size. Fan-out matters just as much: every subscription attached to a topic re-bills the same bytes on delivery.

Why does Pub/Sub Cost matter?

Teams size Pub/Sub on message counts and are then surprised by the bill, when the two real drivers are the size floor on small events and the number of subscriptions on a busy topic. Confirm the current per-TiB throughput and retention prices in the Google Cloud pricing calculator for your region.

What values do I need to enter?

This calculator takes 11 inputs: Messages published per month, Average message payload, Minimum billed bytes per message, Subscriptions per topic, Price per TiB of throughput, Free throughput allotment, Message backlog retained, Retained storage price per GiB, Snapshot storage, Cross-region egress, Egress price per GiB. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Should I batch small messages together?

Usually yes. Because of the 1,000-byte minimum, packing ten 100-byte events into one message cuts billed throughput by roughly 90% — at the cost of coarser retry granularity and higher per-message latency.

You might also need