Skip to content

Sizing

A cluster’s size sets the gateway node type and count, the WAL disk per pod, the pending-upload cap and the Cloud SQL tier. Pick it by the peak rate you publish, in bytes per second. The console asks for the expected peak and picks the size.

Size Published Node Pods per zone (production / non-production) Capacity with one pod down WAL disk per pod Pending-upload cap Cloud SQL tier
small up to 20 MiB/s n2-standard-2 2 / 1 about 165 MiB/s 100 GiB 8 GiB db-custom-1-3840
medium up to 100 MiB/s n2-standard-4 2 / 1 about 330 MiB/s 200 GiB 16 GiB db-custom-2-8192
large up to 400 MiB/s n2-standard-4 4 / 2 about 770 MiB/s 400 GiB 32 GiB db-custom-4-16384

How the table is built:

  • One gateway pod moved 110 to 137 MiB/s on 4 vCPU in a benchmark, publish and consume together. The table assumes about 27 MiB/s per vCPU. On GKE, a single pod on an n2-standard-2 node accepted 76 MiB/s (77,800 messages per second of 1 KiB) in a benchmark.
  • Production runs at least two pods per zone, so a node upgrade or repair still leaves each zone served. The size’s upper limit fits in about half of what remains with one pod down.
  • Non-production runs half the pods, at least one per zone.
  • One gateway pod runs per node. The node pool autoscales up to twice the pod count per zone, which leaves room for zone failover and surge upgrades.

Pod resources: small requests 1 CPU and 3 GiB (limit 4 GiB). Medium and large request 3 CPU and 6 GiB (limit 8 GiB), leaving room for the Cloud SQL Auth Proxy sidecar and GKE’s own DaemonSets.

The WAL holds only messages not yet uploaded to Cloud Storage, normally one or two seconds’ worth. It grows only when uploads stall, for example during a Cloud Storage or Cloud SQL outage. Its size decides how long a pod can ride out such an outage.

The pending-upload cap is kept well below the disk size. Once a pod has that much waiting for upload, it refuses new publishes with UNAVAILABLE rather than fill the disk. At each size’s upper limit the per-pod rate is 5, 25 and 50 MiB/s, so the cap covers roughly 27, 11 and 11 minutes of outage. Larger disks also get more throughput and IOPS from Compute Engine.

To estimate it for your traffic: disk needed ≈ publish rate per pod × outage length.

The Terraform module accepts overrides for each value in the table:

Override When
gateways_per_zone Many subscriptions per topic. Delivered bytes cost CPU too, so heavy fan-out needs more pods, or the next size up.
sql_tier Thousands of active subscriptions. Each subscription shard records its acknowledgement position every second, so database load grows with subscriptions, not only with bytes.
wal_disk_size_gb You want to ride out longer outages. Only growing works after the install.
node_machine_type Your organization standardizes on another machine family.

Above 400 MiB/s, split traffic over several clusters.

The module creates billable resources in your project: GKE nodes, the cluster management fee, Cloud SQL (high availability doubles it), regional persistent disks (billed twice, for two replicas), Cloud NAT, the internal load balancer, and Cloud Storage storage and operations. As a reference point, a medium production cluster costs about $3 per hour at us-central1 list prices. Use the Google Cloud pricing calculator for your region. The calculator on the website compares a cluster with your Pub/Sub bill.

lowtide’s own fee is separate and per cluster.