Clarification on Publication Rate

I would like to clarify following quoted API docs:

NOTE 1: Currently, a device can publish at rate of about 1 event/sec, with bursts of up to 4 allowed in 1 second. Back to back burst of 4 messages will take 4 seconds to recover.

  • Whose responsibility to ensure event publish at rate 1 /sec, is it Application or Device OS?

  • What does burst up to 4 in a second mean? If we are only limited by 1 event/second, doesn’t it mean we can’t publish 4 event in 1 s? So we can’t send burst of 4 events in one second? Do I miss something?

  • What does " Back to back burst of 4 messages will take 4 seconds to recover." mean?

Thank you!

The cloud enforces the limit.

As long as you publish only once per second, you can publish once per second forever. This is the recommended mode of operation.

However, in limited situations, you can send out more than that. The maximum publish size is 622 characters. Say your application generates 2K of JSON data, but you only want to send it to the cloud every 10 seconds. Since the data is too large to fit in a single publish, you split it into 4 separate publishes. Since that will still fit in the burst rate, you can send them out sequentially, without waiting.

You can’t do that continuously, so you can’t send 5 publishes at once. And you need to wait the recovery period (4 seconds) before you publish again after a burst of publishes.

But in this application, since there are only 4 publishes, 10 seconds apart, you can burst out all 4 publishes quickly, and not have to wait 1 second between each publish, because there is enough time to recover from that.

2 Likes

Thank you @rickkas7 and I apologies for long reply.
So let’s say in my context, at particular time, to publish following 3 different events with its size:

  • Event1 300B
  • Event2 200B
  • Event3 100B
    Does it mean I should:
  1. Publish Event1
  2. Wait 1s
  3. Publish Event 2
  4. Wait 1s
  5. Publish Event3
    ?

It depends how often you want to send those three events. If you want to send them continuously, publishing event 1 again immediately after sending event 3, then you probably will want to wait 1 second between publishes.

If you will wait more than 3 or 4 seconds before publishing again, you can send all three out without waiting between them.

In the more common case of sending a burst of events periodically, say every 30 seconds or few minutes, you do not need to wait between publish 1 and 2, or between 2 and 3.

Thank you @rickkas7, say I want to publish those 3 events for every 15s, does this fall to category no 1s waiting needed?

Every 15 seconds you do not need to wait between publishes.

1 Like