---
title: "Why is my Pub/Sub backlog growing and its oldest message aging? | Proofline"
description: "A Pub/Sub backlog grows when subscribers stop pulling, pull but fail to acknowledge, or acknowledge more slowly than publishers send."
url: https://proofline.sh/learn/pubsub-backlog-oldest-unacked-age/
---

[Learning center](/learn/)

# Why is my Pub/Sub backlog growing and its oldest message aging?

A Pub/Sub backlog grows when subscribers stop pulling, pull but fail to acknowledge, or acknowledge more slowly than publishers send. The backlog metrics rise in all three cases. Compare how many messages Pub/Sub sent to subscribers with how many they acknowledged and how many ack deadlines expired, over the same minutes.

Broken dependencies The Proofline team November 23, 2026 6 min read

## Three causes behind one alarm

The alarm is usually on `subscription/num_undelivered_messages`, the number of unacknowledged messages in a subscription, or on `subscription/oldest_unacked_message_age`, the age in seconds of the oldest of them. Google recommends the regional versions, `subscription/num_unacked_messages_by_region` and `subscription/oldest_unacked_message_age_by_region`, because the global ones show a gap when one region is unavailable. [Pub/Sub metrics](https://cloud.google.com/monitoring/api/metrics_gcp_p_z) · [Monitor Pub/Sub](https://cloud.google.com/pubsub/docs/monitoring)

Both rise when:

-   **Subscribers are not pulling.** The subscriber deployment is down or scaled to zero, its streams are suspended, or it subscribes to a different subscription than the one that has the backlog.
-   **Subscribers pull but do not acknowledge.** Messages are delivered, processing fails or takes longer than the ack deadline, and Pub/Sub redelivers them. Nacks have the same effect, and the documentation warns that a nacked message may be redelivered before new ones. [Troubleshoot pull subscriptions](https://cloud.google.com/pubsub/docs/pull-troubleshooting)
-   **Subscribers acknowledge, but too slowly.** Every message is eventually acked, but the ack rate is below the publish rate, often because each message waits on a dependency that slowed down.

A fourth shape is narrower: a small, steady backlog with a growing oldest age. Google's monitoring guide reads that as a few messages that cannot be processed, which usually crash or fail the subscriber each time. [Monitor Pub/Sub](https://cloud.google.com/pubsub/docs/monitoring)

## Why they look alike

The backlog counts unacknowledged messages. A message that was never sent to a subscriber and one that was sent ten times and never acked count the same. The oldest age rises in each case too, since nothing removes the oldest message until someone acks it.

The delivery-side metrics separate them. `subscription/sent_message_count` counts messages Pub/Sub sent to subscriber clients, `subscription/ack_message_count` counts messages acknowledged, `subscription/expired_ack_deadlines_count` counts messages whose ack deadline expired while outstanding to a subscriber, and `subscription/nack_requests` counts nacks. For StreamingPull, `subscription/open_streaming_pulls` counts open streams by `status`, including `suspended_client_flow_controlled` when the client's flow control stopped delivery and `suspended_subscriber_quota_exceeded` at a throughput quota. [Pub/Sub metrics](https://cloud.google.com/monitoring/api/metrics_gcp_p_z)

## Read the subscription and its metrics

Start with the subscription's settings. `gcloud pubsub subscriptions describe` is read-only and returns the ack deadline, retention, dead-letter and retry policies, push configuration and state. [gcloud pubsub subscriptions describe](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/describe) · [Subscription resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions)

```
gcloud pubsub subscriptions describe SUBSCRIPTION --project PROJECT \
  --format 'yaml(name,topic,ackDeadlineSeconds,messageRetentionDuration,deadLetterPolicy,retryPolicy,pushConfig,state)'
```

The ack deadline defaults to 10 seconds and can be set from 10 to 600 seconds. High-level client libraries extend deadlines automatically with modify-ack-deadline requests, by default for up to an hour, so the subscription's value is only the starting point. [Subscription properties](https://cloud.google.com/pubsub/docs/subscription-properties) · [Lease management](https://cloud.google.com/pubsub/docs/lease-management)

Then read the delivery metrics in Metrics Explorer, or through the Cloud Monitoring API's `timeSeries.list`, which is a read. Metric types take the prefix `pubsub.googleapis.com/`, and the subscription is the `subscription_id` label of the `pubsub_subscription` resource. Run it once per metric: `sent_message_count`, `ack_message_count`, `expired_ack_deadlines_count`, `nack_requests` and `open_streaming_pulls`. [timeSeries.list](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) · [Reading metric data](https://cloud.google.com/monitoring/custom-metrics/reading-metrics) · [Monitored resources](https://cloud.google.com/monitoring/api/resources)

```
curl -s -G -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://monitoring.googleapis.com/v3/projects/PROJECT/timeSeries" \
  --data-urlencode 'filter=metric.type="pubsub.googleapis.com/subscription/sent_message_count" AND resource.labels.subscription_id="SUBSCRIPTION"' \
  --data-urlencode 'interval.startTime=2026-11-23T13:00:00Z' \
  --data-urlencode 'interval.endTime=2026-11-23T15:00:00Z' \
  --data-urlencode 'view=FULL'
```

The backlog metrics are sampled every 60 seconds and can take up to 120 seconds to appear; the delivery counters up to four to six minutes. Leave that much at the end of your window before you read a drop as real. [Pub/Sub metrics](https://cloud.google.com/monitoring/api/metrics_gcp_p_z)

Do not pull from the subscription with `gcloud pubsub subscriptions pull` to look at messages. It changes state: a pull delivers messages to you instead of the subscriber, `--auto-ack` acknowledges them so they leave the subscription, and without it they stay outstanding until their ack deadline passes. [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull)

## Read the pattern

| Sent | Acked | Expired deadlines or nacks | Points to |
| --- | --- | --- | --- |
| Near zero | Near zero | Near zero | Subscribers not pulling |
| High, above publish rate | Low | High | Pulling, not acking |
| Steady | Steady, below publish rate | Low | Acking too slowly |
| Normal | Normal | A few, repeating | A few stuck messages |

In the first row, check `open_streaming_pulls`. No open streams means no subscriber is connected. Open streams with a `suspended_*` status mean subscribers are connected and stopped receiving, for example because their own flow control limits are full of messages they have not acked.

In the second row, `sent_message_count` well above the publish rate means the same messages are going out again. Look at the subscriber's logs for the error, or at its processing time against the deadline the client library extends to. Expiry rates of 0.1 to 1% can be healthy, per Google's guide; a rate near 100% is not. [Monitor Pub/Sub](https://cloud.google.com/pubsub/docs/monitoring)

## A worked example: two aging backlogs

This example is illustrative. The fictional `orders` service consumes the subscription `orders-events-indexer` in project `example-prod` through StreamingPull. Both incidents start with `oldest_unacked_message_age_by_region` above 600 seconds at 14:10 UTC.

In the first incident, per minute:

| Metric | 13:50 | 14:05 |
| --- | --- | --- |
| Published to the topic | 2,000 | 2,050 |
| sent\_message\_count | 2,010 | 9,400 |
| ack\_message\_count | 2,000 | 30 |
| expired\_ack\_deadlines\_count | 5 | 8,900 |

Messages are being sent five times over and almost never acked. The subscriber's logs show each message waiting on a payments API that returns errors after 60 seconds, and the handler neither acks nor nacks. The subscriber is working; its dependency is failing. Follow that dependency: [is the latency the client's or the server's?](/learn/dependency-latency-client-or-server/)

In the second incident:

| Metric | 13:50 | 14:05 |
| --- | --- | --- |
| Published to the topic | 2,000 | 2,000 |
| sent\_message\_count | 2,010 | 0 |
| ack\_message\_count | 2,000 | 0 |
| open\_streaming\_pulls, status ok | 6 | 0 |

No stream is open and nothing is sent. The subscriber's deployment has no ready replicas since a failed rollout at 14:01. The payments API is fine; the subscriber is gone.

## Limits

When the oldest unacked age exceeds the subscription's message retention duration, Google's monitoring guide lists the result as permanent data loss. Alert well before retention, and read `messageRetentionDuration` from the describe output now. [Monitor Pub/Sub](https://cloud.google.com/pubsub/docs/monitoring)

Push subscriptions do not use pulls or streams; read `subscription/push_request_count` by response code instead. Dead-letter forwarding counts delivery attempts only approximately, and only when the dead-letter topic and its permissions are set up correctly. [Pub/Sub metrics](https://cloud.google.com/monitoring/api/metrics_gcp_p_z) · [Dead-letter topics](https://cloud.google.com/pubsub/docs/handling-failures)

The metrics show where delivery stops, not why the subscriber failed. For a backlog of the same kind on AWS, see [SQS messages that pile up](/learn/sqs-messages-visible-not-processed/), and for lag on Kafka, [stalled or slow consumers](/learn/kafka-consumer-lag-stalled-or-slow/). Other dependency failures are in [diagnosing runtime dependency failures](/learn/runtime-dependency-failures/).

## Questions

### What is the difference between num\_undelivered\_messages and oldest\_unacked\_message\_age?

The first is how many unacknowledged messages the subscription holds. The second is how long the oldest of them has been waiting, in seconds. Both growing together means subscribers are not keeping up; a flat count with a growing age points to a few messages that keep failing.

### Why are Pub/Sub messages redelivered when my subscriber is running?

The ack deadline expired before the subscriber acknowledged them, or the subscriber nacked them. Check `subscription/expired_ack_deadlines_count` and `subscription/nack_requests` for the subscription.

### What is the default Pub/Sub ack deadline?

Ten seconds, configurable from 10 to 600 seconds per subscription. Client libraries extend it per message while they process, up to a configurable maximum.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Why are SQS messages piling up without being processed?](/learn/sqs-messages-visible-not-processed/)
    
    Broken dependencies The Proofline team November 23, 2026 6 min read
    
-   ### [Is Kafka consumer lag growing because consumers stalled or are slow?](/learn/kafka-consumer-lag-stalled-or-slow/)
    
    Broken dependencies The Proofline team November 23, 2026 5 min read
