Throttles

This article describes what throttles are and how to prevent throttling.

What are throttles?

Throttles generally protect Digi Remote Manager from “rogue” devices or applications using system resources in a way that denies services to others.

Throttling generally occurs when a device or application is “over-using” its Digi Remote Manager access, where the allowed usage metrics are determined by subscription level which is based on the account type such as Premier.

Throttle Implementation

Throttles are calculated on a sliding scale (transactions per minute) and maintain a queue in order to provide bursting capabilities. An example is a sliding window of x transactions per y time interval (12 transactions per hour). Also, throttles may limit the number of concurrent requests, example is concurrent web service requests.

There is a sliding 10 second window for requests (so, for instance, at a limit of 180 per minute, you can send at most 30 in a ten second window before you hit that limit).

Device Data Service Throttler

Device data uploads are limited to 60 per minute. An example is a device uploading data into data streams (note that multiple data points can be sent in a single upload). One concurrent transaction is the maximum allowed since the data service can only process one request at a time. If exceeded a server error status is returned to the device, the device either has to slow down and retry.

This throttle can be controlled by a subscription to Device Throttling. Premier accounts have the values set to 60 transactions per minute. Other account types may have more restrictive device throttling.

Web Services Throttler

The web services throttler limits the number of web service API calls allowed by a customer. This is controlled by the subscription to Web Service messaging. An example is for Premier accounts the values are set to 240 transactions per minute and 4 concurrent transactions. Other account types may have more restrictive web service throttling.

When a throttle rate is exceeded the request results in an HTTP response status code of 429

Alarms

A System Throttles alarm event will be fired if devices are sending data too fast or if web service requests are exceeded.

Effects of Throttling

When requests are being throttled, it can cause issues for your intended solution. Suppose you have devices sending up data points to Remote Manager and you have an application that is continuously querying using web service requests to do the following:

Warning

NOTE: Do not actually do this - it is NOT scalable as explained below.

Get a list of devices using /ws/v1/devices/inventory 
for each device
	for each expected stream name
		 get stream history using /ws/v1/streams/history/device-id/your-stream-name
		 for each datapoint
		 	process datapoint for solution  

If this loop is going as fast as possible, it is likely to encounter throttling. Side effects of throttling to the intended solution include:

  • Data from a device not being processed as quickly as desired
  • SCI Requests to a device being throttled and difficult to get processed because the throttling caused by the queries makes the SCI request retries fail repeatedly

Additionally, when requesting the history for each stream, data in the stream is likely to be retrieved that is not needed as it has already been processed or has not changed since the previous request.

Solutions to Prevent Throttling

Use Monitors

Monitors allow data to be stored and retrieved efficiently. The data can be pushed to your solution as it arrives via HTTP or TCP monitors or you can use a polling monitor with a cursor. Monitors will only send new data so your solution will not have to process historical data multiple times. The data can be persisted so data is not lost if your application is not available temporarily.

For a practical tutorial with monitors, see Tutorial: Experimenting with Remote Manager Monitors

When using monitors, be sure to pay attention to the batch_size, batch_duration, and persistent values to make your solution process data as effectively as possible.

Use Remote Manager Features

If your solution requires processing at regular intervals, consider using the automations feature.

If your solution requires continuous verification of device firmware, device configuration, and device file system contents, consider using the configurations feature.

If you need to upgrade device firmware or modem firmware, consider using the automations or configurations feature.