最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google cloud platform - Understanding GCP PubSub Sent Metric and Ack Metric With Dead Lettering - Stack Overflow

programmeradmin1浏览0评论

I am testing my Pub/Sub setup with dead lettering enabled. Inside my subscriber application, I have not added any ack logic so all messages will not be acked by my subscriber. I set the maximum delivery attempts to be 5 so all messages, after being retried for 5 times, should go to dead letter queue and be acknowledged.

More Context

My subscribers are pulling from the subscription with a QPS of 12K(this is hardcoded inside my app). I have setup a load test to generate load at 12K QPS. Messages are published with the same QPS correctly. But the sent metric shows only a 10K QPS. Ack metric shows a 2K QPS which I can understand since each message needs to be processed 6 times(1 initial attempt + 5 retries). But why the sent metric is 10K but not 12K?

I also observed that the sent metric + the ack metric = the publish metric all the time: see this screenshot.

Subscription acknowledgement deadline is set to 10 seconds and retry is set to "retry immediately".

Can you help me understand this behavior? Thanks?

I am testing my Pub/Sub setup with dead lettering enabled. Inside my subscriber application, I have not added any ack logic so all messages will not be acked by my subscriber. I set the maximum delivery attempts to be 5 so all messages, after being retried for 5 times, should go to dead letter queue and be acknowledged.

More Context

My subscribers are pulling from the subscription with a QPS of 12K(this is hardcoded inside my app). I have setup a load test to generate load at 12K QPS. Messages are published with the same QPS correctly. But the sent metric shows only a 10K QPS. Ack metric shows a 2K QPS which I can understand since each message needs to be processed 6 times(1 initial attempt + 5 retries). But why the sent metric is 10K but not 12K?

I also observed that the sent metric + the ack metric = the publish metric all the time: see this screenshot.

Subscription acknowledgement deadline is set to 10 seconds and retry is set to "retry immediately".

Can you help me understand this behavior? Thanks?

Share Improve this question edited Mar 19 at 3:21 Manxue Li asked Mar 19 at 3:20 Manxue LiManxue Li 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

From the context you provided, it looks like you might be using unary pulling for your subscribers.  In general, we recommend using the high-level client library instead.

With unary pull, Cloud Pub/Sub may return fewer messages than the maxMessages value you specify in your requests. You can verify if your requests are pulling the maximum number of messages by comparing the Sent message count and the Pull request count metrics. You should also make sure that you are not setting returnImmediately to True.

发布评论

评论列表(0)

  1. 暂无评论