Throttle PubNub publish message

2019-08-11 17:48发布

PubNub recommends "publish no faster than 5 msgs per second to any one channel." I was wondering if PubNub itself has some settings can throttle publish msgs?

For example, I publish 100 msgs per second to one channel, PubNub server can drop first 95 msgs and only publish last 5 recent msgs per second.

"windowing" parameter is something similar I found from PubNub, but it seems bundling msgs and compressed them instead of dropping them.

"windowing" Specifies the time interval in milliseconds that PubNub will use to optimize message delivery by bundling them into a single compressed payload.

标签: pubnub
2条回答
混吃等死
2楼-- · 2019-08-11 18:13

PubNub Throttle and Rate Limiting

PubNub caps your account ingress (publishing a message) to a baseline. We also rate limit egress (receiving a message via subscribe). You can increase these limits by talking with PubNub directly. We can update and upgrade your account limits to anything you require!

Need to send and receive billions of messages in a pinch? We can do that for you!

Upgrade Your Account and Increase your Limits

You have to chat with us - support@pubnub.com - and ask for "Throttling and Rate Limiting Account Review".

查看更多
唯我独甜
3楼-- · 2019-08-11 18:26

I've got pretty quick response from PubNub support team.

"The recommendation is more like 10 to 12 per second per channel (upper end before you potentially have a missed messages scenario). There isn’t actually a publish rate limit but rather, there is a practical subscriber limitation.

PubNub will handle as many messages as you through at it but typically subscribers can’t keep up. Because of this practical limitation, the size of our in-memory channel message queues (on the server side) are 100 messages. As messages are published they are sent to subscribers and added to this queue. As more messages come, older messages are pushed off the end of the queue. So if you publish 100 messages followed by another 100 a second later, the subscriber(s) will not be able to consume them fast enough and will miss messages. So you kind of get the effect you are asking for but it is not predictable or configurable."

查看更多
登录 后发表回答