简体   繁体   English

来自 Pub/Sub 卡顿的 Beam(DataFlow) 流

[英]Beam(DataFlow) streams from Pub/Sub stuckness

We have a Beam streaming job in DataFlow that reads from PubSub.我们在 DataFlow 中有一个从 PubSub 读取的 Beam 流式传输作业。 During the peak hour amount of PubSub messages increases from 25k/s to 130k/s and stays at 120k/s for an hour.在高峰时段,PubSub 消息的数量从 25k/s 增加到 130k/s 并保持在 120k/s 一个小时。 We can see a few short watermark spikes (at the beginning and a few after) in reading from Pub/Sub step(2-3minutes) and in the subscription backlog.在从 Pub/Sub 步骤(2-3 分钟)和订阅积压中读取时,我们可以看到一些短的水印峰值(在开始时和之后)。 Dataflow indicates Possible stuckness for all stages, but there is nothing in logs.数据流指示所有阶段的可能卡顿,但日志中没有任何内容。

Our cluster is fixed-sized without autoscaling and I think we have enough workers(spikes go down fast, which means we can handle the peak hour load and even consume stuck backlog).我们的集群是固定大小的,没有自动扩展,我认为我们有足够的工作人员(峰值下降很快,这意味着我们可以处理高峰时段的负载,甚至消耗卡住的积压)。

My only thought is that increased load in addition to future grouping aggregation can result in an inner shuffle in PubSub read.我唯一的想法是,除了未来的分组聚合之外,增加的负载可能会导致 PubSub 读取中的内部洗牌。 Maybe someone has any ideas on this?也许有人对此有任何想法?

You can use Ordering of messages to deliver messages in order, If messages have the same ordering key and are in the same region, you can enable message ordering and receive the messages in the order that the Pub/Sub service receives them.您可以使用消息排序来按顺序传递消息,如果消息具有相同的ordering key并且在同一区域中,您可以启用消息排序并按照 Pub/Sub 服务接收消息的顺序接收消息。

Pub/Sub delivers each message at least once , so the Pub/Sub service might redeliver messages. Pub/Sub 至少传递每条消息一次,因此 Pub/Sub 服务可能会重新传递消息。 When you receive messages in order and the Pub/Sub service redelivers a message with an ordering key, Pub/Sub maintains order by also redelivering the subsequent messages with the same ordering key.当您按顺序接收消息并且 Pub/Sub 服务使用排序键重新传递消息时,Pub/Sub 还会通过使用相同的排序键重新传递后续消息来维护顺序。 The Pub/Sub service redelivers these messages in the order that it originally received them. Pub/Sub 服务按照最初接收这些消息的顺序重新传递这些消息。

Messages with the same ordering key are guaranteed to be delivered in order.具有相同 ordering key 的消息保证按顺序传递。

Messages with different ordering keys are not guaranteed to be delivered in order, independent of the publishing time.不保证具有不同排序键的消息按顺序传递,与发布时间无关。

In a rare case, the inability to acknowledge a message can hold up the delivery of messages for other ordering keys.在极少数情况下,无法确认消息可能会阻止其他排序键的消息传递。 This issue occurs when servers restart unexpectedly or there are changes in the set of servers used due to traffic changes.当服务器意外重新启动或由于流量更改而使用的服务器集发生更改时,会出现此问题。 To preserve order across such events, all messages published to the old server must be acknowledged before messages from the new server are delivered, even if they are for different ordering keys.为了保持此类事件的顺序,必须在传递来自新服务器的消息之前确认发布到旧服务器的所有消息,即使它们用于不同的排序键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GCP数据流:用于从Pub / Sub IO流式传输的系统延迟 - GCP Dataflow: System Lag for streaming from Pub/Sub IO 无法使用 Apache Beam(Python SDK)读取 Pub/Sub 消息 - Unable to read Pub/Sub messages with Apache Beam (Python SDK) GCP Pub/Sub:消息的生命周期 - GCP Pub/Sub: Life of a Message 从 100 多个客户到 Google Pub/Sub 再到 GCS 的近实时流数据 - Near real time streaming data from 100s customer to Google Pub/Sub to GCS Beam:在两个流之间共享 state - Beam: Sharing state between two streams python 数据流 DoFn 生命周期中的光束设置()刷新多长时间? - How long beam setup() refresh in python Dataflow DoFn life cycle? 如何限制流式作业、apache 梁、数据流后端、python 的 DoFn 线程数 - How to limit number of DoFn threads for streming job, apache beam, dataflow backend, python Apache Beam / Java / Dataflow - 当水印命中时,带有早期触发器的会话窗口不会触发“准时”窗格 - Apache Beam / Java / Dataflow - Session window with early trigger not firing the “on-time” pane when when the watermark hits go和grpc如何解决pub-sub问题? - How to solve pub-sub problem in go and grpc? Apache Beam Python 流式传输中的窗口和 GroupByKey 不起作用 - Apache Beam Python windowing and GroupByKey from streaming not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM