简体   繁体   English

GCP - Pub/Sub 发布速度变慢

[英]GCP - Pub/Sub Publish slowdown

Few days ago (~2022. Feb. 09.), we detect a massive slowdown during publishing messages via ordered Google Cloud Pub/Sub .几天前(~2022 年 2 月 9 日),我们发现在通过有序的 Google Cloud Pub/Sub 发布消息速度大幅下降 Before that day the publish time was around 1 sec, however that day this time increased above 15 sec.那天之前发布时间大约是 1 秒,但是那天这次增加到 15 秒以上。 (Sometimes it was more than 30 sec.) That problem didn't come up constantly. (有时超过 30 秒。)这个问题并没有经常出现。 The GCP status page did not show any related issue. GCP 状态页面没有显示任何相关问题。

Our first thought was that the google lib ( nuget ) has some revealed bug, however when we tested the publish method via gcloud cli ( version ), the publish time was almost the same.我们的第一个想法是 google lib ( nuget ) 有一些暴露的错误,但是当我们通过 gcloud cli ( version ) 测试发布方法时,发布时间几乎相同。

On this week the publishing works fine, and we can not reproduce it.本周发布工作正常,我们无法重现。

Does anybody else detect same issue?有没有其他人检测到同样的问题? Is this normal with ordered topics?这对于有序主题是否正常? Should we prepare with 15 - 30 sec communication time via GCP - Pub/Sub?我们是否应该通过 GCP - Pub/Sub 准备 15 - 30 秒的通信时间?

This is how we publish our messages:这是我们发布消息的方式:

protected virtual async Task Publish<T>(T messageToSend, string topicName, string orderingKey = null)
{
    var hasOrdering = !string.IsNullOrEmpty(orderingKey);
    var message = new PubsubMessage
    {
        Data = ByteString.CopyFromUtf8(messageToSend.ToJson()),
        OrderingKey = orderingKey ?? string.Empty
    };

    var topic = new TopicName(projectId, topicName);
    var customSettings = hasOrdering 
        ? new PublisherClient.Settings
            {
                EnableMessageOrdering = true
            } 
        : null;

    PublisherClient publisher = await PublisherClient.CreateAsync(topic, settings: customSettings);

    await publisher.PublishAsync(message);

    logger.LogInformation($"Pubsub message sent for topic: {topicName}, OrderingKey: {orderingKey ?? "[empty]"}");

    await publisher.ShutdownAsync(TimeSpan.FromSeconds(15));
}

Do you have any related advice?你有什么相关的建议吗?

(We know that we dont use the latest version, however it seems that doesn't correlate with this issue. Furthermore as we wrote, we can not reproduce this issue anymore, so we can't test with new lib versions.) (我们知道我们不使用最新版本,但似乎与此问题无关。此外,正如我们所写,我们无法再重现此问题,因此我们无法使用新的 lib 版本进行测试。)

There was a server-side issue between 2/7/2022 and 2/14/2022 that caused an unexpected slowdown in publishes for messages with ordering keys under specific publishing patterns. 2/7/2022 和 2/14/2022 之间存在服务器端问题,导致在特定发布模式下使用排序键的消息发布意外放缓。 The scope was relatively limited, which is why it did not appear on the GCP status page. scope 相对有限,这就是它没有出现在 GCP 状态页面上的原因。 The issue was resolved by 2/14/2022 at 18:00:00 PST.该问题已于 2022 年 2 月 14 日太平洋标准时间 18:00:00 解决。 This slow behavior is not normal for ordered topics and is not an issue anticipated to return.这种缓慢的行为对于有序主题来说是不正常的,并且不是预期会返回的问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM