Skip to main content

Client-Side Rate Limiting

In addition to rate limits on the server-side, the Bort SDK also employs client-side rate limiting.

Client-side rate limits in addition to server-side rate limits helps limit a device's overall network usage and bandwidth consumption, by not sending data in the first place. They also further reduce the traffic to Memfault from any single malfunctioning device, and which helps provide fairer pricing.

In general, when any particular error event is detected, Bort will check whether that type of error event has been rate limited, before recording the event to be uploaded. For some error types, Bort will additionally consider an error event's signature in the rate limit, by limiting events with unique signatures and repeated signatures.

For example, we can use the stacktrace from Java Exceptions as the signature to uniquely identify exceptions from one another. Java Exceptions are rate limited at a rate of 100 unique Exceptions, 4 repeated Exceptions, every 15 minutes. If we receive 5 Java Exceptions with the same stacktrace, and thus the same signature, in the same 15 minute period, those 5 Java Exceptions will only count as 1 towards the 100 allowed, and only 4 of those Java Exceptions will be uploaded.

This granularity helps mitigates situations where a single crash in a crashloop prevents all other exceptions from being seen.

Event TypeDefault Rate Limit
Bug Report (on device requests)3 bug report requests every 30 minutes
Bug Report (periodic)3 periodic bug reports every collection interval
DropBoxManager ANRs10 unique ANRs every 15 minutes
DropBoxManager Java Exceptions100 unique, 4 repeated Exceptions every 15 minutes
DropBoxManager WTFs10 unique, 5 repeated WTFs every day
DropBoxManager Kmsgs10 Kmsgs every 15 minutes
DropBoxManager Custom Events2 Custom Events every hour
DropBoxManager Tombstones10 unique Tombstones every 15 minutes
Kernel Oops3 Kernel Oops every 6 hours
Reboot Events5 Reboot Events every 15 minutes
SELinux Violations15 unique SELinux Violations every day
note

To bypass client-side rate limits for development, Bort can be placed in Developer Mode.