Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/tagotip/servers/rate-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,36 @@ RPM = requests per minute.
|---|---|---|---|---|
| Uplink RPM (PUSH) | UDP, TCP, HTTP, MQTT | 1,000 | 500 | 60 |
| Downlink RPM (PULL) | UDP, TCP, HTTP, MQTT | 1,000 | 500 | 60 |
| Connections per IP | TCP, HTTP, MQTT | 100 | 20 | 5 |
| Connections per IP | TCP, HTTP, MQTT | 20 | 10 | 3 |

## Per device

| Resource | Transports | Default |
| Resource | Transports | Scale | Starter | Free |
|---|---|---|---|---|
| Max payload size | UDP, TCP, HTTP, MQTT | 100 KB | 100 KB | 100 KB |
| Connection TTL | TCP, MQTT | 15 s | 10 s | 10 s |
| Keep-alive idle timeout | TCP, MQTT | 5 s | 5 s | 5 s |

:::info Connection TTL vs Keep-alive idle timeout

These two TCP limits serve different purposes:

- **Connection TTL** is a hard cap on total connection duration. No matter how active the device is, the server closes the connection after this period and sends `ACK|ERR|ttl_expired`. The device should reconnect.
- **Keep-alive idle timeout** is the maximum silence between frames. If the device stops sending data for this long, the server closes the connection with `ACK|ERR|keep_alive_timeout`. Sending any frame (including `PING`) resets the timer.

Both timers start when the connection is accepted. TTL counts total elapsed time; keep-alive resets on every received frame.

:::

## Error and close responses

| Condition | Raw ACK | HTTP Status |
|---|---|---|
| Max payload size | UDP, TCP, HTTP, MQTT | 100 KB |
| Connection TTL | TCP, MQTT | 60 s |
| Keep-alive idle timeout | TCP, MQTT | 20 s |
| RPM exceeded | `ACK\|ERR\|rate_limited` | 429 |
| Payload too large | `ACK\|ERR\|payload_too_large` | 413 |
| Per-IP connections exceeded | `ACK\|ERR\|rate_limited` (then close) | 429 (then close) |
| Connection TTL exceeded | `ACK\|ERR\|ttl_expired` (then close) | N/A |
| Keep-alive idle timeout | `ACK\|ERR\|keep_alive_timeout` (then close) | N/A |

PING is exempt from rate limiting on TCP and UDP. On HTTP, `HEAD` counts toward the uplink RPM. On MQTT, keepalive is handled natively by PINGREQ/PINGRESP.

Expand Down