FCM 将推送通知发送到大基数的主题需要多长时间 [英] How much time FCM takes to deliver push notification to a topic of large base

查看:50
本文介绍了FCM 将推送通知发送到大基数的主题需要多长时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们计划通过 FCM 实施主题消息传递将 PN 发送到我们的基地,我想知道 FCM 通过主题将 PN 发送到应用程序需要多长时间:

  1. 有 1000 万人订阅了一个主题
  2. 有 5000 万人订阅了一个主题
  3. 有 1 亿人订阅了一个主题

我理解交付将取决于应用程序是否在线,但是我们可以在这里假设每个应用程序都在线的假设情况.换句话说,我想了解 FCM 如何处理将 PN 发送到主题以及它将/可能引入多少延迟?

解决方案

消息是排队的,它们将从 Firebase 云消息服务器逐个用户传递,您可以在 Firebase 通知控制台了解这些消息的状态.

https://firebase.google.com/docs/cloud-messaging/理解交付

此视频可确保您 95% 的消息会以平均 250 毫秒的时间送达

https://youtu.be/sioEY4tWmLI

来自文档

<块引用>

两种消息类型的最大负载均为 4KB,但从 Firebase 控制台发送消息时除外,该控制台强制执行 1024 个字符限制.

您可以在this 文档

<块引用>

FCM 不保证交货顺序.

限制和缩放

<块引用>

我们的目标是始终传递通过 FCM 发送的每条消息.然而,传递每条消息有时会导致整体用户不佳经验.在其他情况下,我们需要提供边界以确保FCM 为所有发件人提供可扩展的服务.

单个设备的最大消息速率

<块引用>

您最多可以将 240 条消息/分钟和 5,000 条消息/小时发送到一个单个设备.这个高门槛是为了允许短期流量爆发,例如当用户快速交互时聊天.此限制可防止无意中发送逻辑错误耗尽设备上的电池电量.

上游消息限制

<块引用>

我们将上游消息限制在每个项目 15,000/分钟,以避免使上游目标服务器过载.

我们将每个设备的上游消息限制在 1,000/分钟以保护防止因应用行为不当而导致电池消耗.

扇出节流

<块引用>

消息扇出是将消息发送给多个设备,例如当您定位主题和群组时,或使用Firebase 控制台中的通知编辑器.

我们将每个项目进行中的消息扇出数量限制为1,000.之后,我们可能会拒绝额外的扇出请求,直到某些扇出完成.

实际可实现的扇出率受数量的影响同时请求扇出的项目.扇出率为 10,000单个项目的 QPS 并不少见,但这个数字并不罕见保证并且是系统总负载的结果.这是重要的是要注意,可用的扇出容量分为项目而不是跨扇出请求.所以,如果你的项目有两个扇出正在进行中,那么每个扇出只会看到一半可用扇出率.最大化扇出的推荐方法速度是一次只有一个活动扇出正在进行.

如果您需要更多信息,可以在我提供的链接中找到.

We are planning to implement Topic Messaging via FCM to send PN to our base, I want to know how much time FCM takes to deliver PN to apps via topic:

  1. with 10 million subscribed to a topic
  2. with 50 million subscribed to a topic
  3. with 100 million subscribed to a topic

I understand delivery will depend on apps being online, however we can assume here hypothetical case of every one being online. In other words, I want to understand how does FCM processes sending PN to a topic and how much delay it will/might introduce?

解决方案

The messages are enqueue and they will be deliver user by user from Firebase cloud messaging server, you can know the status of those messages at your Firebase Notifications console.

https://firebase.google.com/docs/cloud-messaging/understand-delivery

This video ensures that 95% of your messages will deliver with an average time of 250ms

https://youtu.be/sioEY4tWmLI

From this documentation

Maximum payload for both message types is 4KB, except when sending messages from the Firebase console, which enforces a 1024 character limit.

Another important thing you can find at this documentation

FCM does not guarantee the order of delivery.

Throttling and scaling

Our goal is to always deliver every message sent via FCM. However, delivering every message sometimes results in a poor overall user experience. In other cases, we need to provide boundaries to ensure that FCM provides a scalable service for all senders.

Maximum message rate to a single device

You can send up to 240 messages/minute and 5,000 messages/hour to a single device. This high threshold is meant to allow for short term bursts of traffic, such as when users are interacting rapidly over chat. This limit prevents errors in sending logic from inadvertently draining the battery on a device.

Upstream message limit

We limit upstream messages at 15,000/minute per project to avoid overloading upstream destination servers.

We limit upstream messages per device at 1,000/minute to protect against battery drain from bad app behavior.

Fanout throttling

Message fanout is the process of sending a message to multiple devices, such as when you target topics and groups, or use the Notifications composer in the Firebase console.

We limit the number of in-progress message fanouts per project to 1,000. After that, we may reject additional fanout requests until some of the fanouts complete.

The actual achievable fanout rate is influenced by the number of projects requesting fanouts at the same time. A fanout rate of 10,000 QPS for an individual project is not uncommon, but that number is not a guarantee and is a result of the total load on the system. It is important to note that the available fanout capacity is divided among projects and not across fanout requests. So, if your project has two fanouts in progress, then each fanout will only see half of the available fanout rate. The recommended way to maximize your fanout speed is to only have one active fanout in progress at a time.

If you need more information, you can find it at those links I provide.

这篇关于FCM 将推送通知发送到大基数的主题需要多长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆