GCP - Pub/Sub 发布放缓

GCP - Pub/Sub Publish slowdown

几天前(~2022 年 2 月 9 日),我们在 通过 ordered Google Cloud Pub/Sub. Before that day the publish time was around 1 sec, however that day this time increased above 15 sec. (Sometimes it was more than 30 sec.) That problem didn't come up constantly. The GCP status page 发布消息期间检测到 大规模减速 未显示任何相关问题。

我们第一个想到的是google库(nuget) has some revealed bug, however when we tested the publish method via gcloud cli (version),发布时间差不多。

本周发布正常,我们无法复制它。

其他人是否检测到同样的问题? 有序主题是否正常? 我们是否应该通过 GCP 准备 15 - 30 秒的通信时间 - Pub/Sub?

这是我们发布消息的方式:

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));
}

你有什么相关的建议吗?

(我们知道我们没有使用最新版本,但似乎与此问题无关。此外,正如我们所写,我们无法再重现此问题,所以我们可以' t 测试新的 lib 版本。)

2022 年 7 月 2 日至 2022 年 2 月 14 日之间存在 server-side 问题,导致在特定发布模式下使用排序键的消息的发布意外放缓。范围相对有限,这就是它没有出现在 GCP 状态页面上的原因。该问题已于 2022 年 2 月 14 日在 18:00:00 PST 得到解决。这种缓慢的行为对于有序主题来说是不正常的,并且不是 return.

预期的问题