Rate Limit of Webhook Cast

Rate Limit of Webhook Cast #

Overview #

Cast with Webhook action has rate limit configuration. The rate limit is the maximum number of requests that can be sent to the Cast Target Service specified by the configured URL in your Cast. If devices registered to Act try to send more Act Logs than the rate limit, Actcast drops exceeded ones without sending them to Cast Target Services.

Why rate-limiting is necessary? #

In Actcast, several people can develop and publish their applications on the marketplace. Think about an application that recognizes human faces and sends detected the human’s attributes. There is a possibility that the application would had a bug and recognized a human’s face in a poster and sent ten Act Logs per second. In that case, Actcasts may put an unexpected load on the Cast Target Service if there’s no rate limit.

We need the rate-limiting to prevent Cast Target Services from these possibilities.

Evaluate the effect of rate-limiting in advance #

Act and Cast are mediators: They collect data from devices and send them to the target service. There is a trade-off between “Do not put unexpected loads on Cast Target Service” and “Send all data without dropping”. Users must tell Actcast which is preferable. (The former is the default for safety.) It depends on the purpose of the application, what you’ll use the collected data for, and the application’s situation.

Let’s see some examples:


Example 1: Install an application to a Raspberry Pi that notifies if the water in disposer for hamster becoming empty.

In this case, we want notifications without dropping. (Lovely ham gets thirsty.) But it’ll be at most once a day. Rate-limiting will not be triggered.


Example 2: Install an application to a Raspberry Pi that detects a human at the home entrance and notifies. (The application sends at most one Act Log per second.)

In this case, dropping notifications will not cause critical problems, but you’ll get lots of notifications as the application continues detecting humans. You can use rate limit to reduce unnecessary notifications.


Example 3: Develop an application that manages locking of doors by face recognition using Amazon Rekognition and electronic lock devices. One device per door. A device sends at most 10 requests per minute. A hundred devices will work simultaneously.

In this case, users will face an error if data dropped, like “The door doesn’t open even though I show my face on the camera.” Too bad.


Use an application to visualize congestion of grocery stores. The device sends data once every 15 minutes. 20 devices per store. There are 5000 stores.

What’ll happen in this case?

Something wrong if the data dropped? How much data do devices send per second?


You don’t need to care about the rate limit if you are OK with dropping data.

If not, you should evaluate how many requests are sent by Act at most and ensure that rate-limiting doesn’t drop your data.

We can evaluate the number of requests per second (RPS):

RPS (request / sec) = Number of requests sent by the application per second (request / sec / device) * Number of devices (device)

For example, in the above example 3,

RPS = 10/60 * 100 = About 17 requests per second.

In example 4,

RPS = 1/(60 * 15) * (20 * 5000) = About 111 requests per second.

Note that this is a rough estimation, i.e., maximum value or expected value. In example 3, the number will vary depending on the timeframe. In example 4, lots of requests will be sent if devices send ones simultaneously. The important thing here is, thinking about yourself what happens if rate-limiting is triggered, and avoid it if you need.

If you want to relax the limit, configure Cast as in Connect Actcast to External Services. If you want to turn off rate-limiting, follow the next section.

Remove rate-limiting #

A condition and an action required to remove rate-limiting:

  1. Condition for the Cast Target Service: Declare that Cast Target Service admits users to remove rate-limiting.
  2. Action of the user: Configures the Cast with “No rate limit”.

Declare that Cast Target Service admits users to remove rate-limiting #

In this section, we assume that the readers are developers of the Cast Target Service.

See Cast Target Service, Actcast option.

Configures the Cast with “No rate limit” #

  1. Open Cast configuration as in Connect Actcast to External Services.
  2. Fill elements other than Rate Limit (s).
  3. Clear the field Rate Limit (s).
  4. Save the configuration by clicking the Finish button.

If save succeeded, Webhook Cast will be started without rate-limiting.

If not, make sure that the Cast Target Service admits removing rate-limiting.


Back to Cast