frankie567
frankie567

Reputation: 1760

StreamingPull request has a very high latency

We are experiencing very high latencies when we start a Google PubSub client. Messages are not arriving before minutes after the client initialization.

When looking in the Google Cloud console, we can indeed see that google.pubsub.v1.Subscriber.StreamingPull calls have very high latencies (around 8 minutes):

StreamingPull latency

Is it expected behaviour? If not, what could cause this issue?

Best regards

Upvotes: 4

Views: 1351

Answers (1)

Kamal Aboul-Hosn
Kamal Aboul-Hosn

Reputation: 17206

The latency in the Google Cloud console would not be correlated with latency in receiving messages. The nature of a StreamingPull request is that it stays open for a long time, until shut down by a connection error or when a shutdown is initiated on the client. The latency in the console would indicate how long the connections are staying open, not how long it is taking to receive messages. This is also why the error rate is 100%.

Messages should be received quickly after starting up a subscriber, assuming there are messages available in the backlog to receive. There are many different things that could lead to delays in message delivery:

  1. Subscriber client running on a machine with limited available resources that
  2. Very tight flow control settings that only allow a few messages through at a time.
  3. Publisher-side latency due to the publisher running on a machine with limited available resources.
  4. Messages having been received earlier by another subscriber client running or via a pull command on gcloud tool on the same subscription, resulting in messages not being redelivered until the ack deadline has expired.

Upvotes: 1

Related Questions