ApsaraMQ for MQTT enforces the following limits on instances, topics, clients, and messaging. Exceeding these limits may cause application exceptions such as disconnections or message loss.
If you purchase a Platinum Edition ApsaraMQ for MQTT instance, you can customize some of its metrics. These customizable metrics are indicated in the tables below. To request customization, contact ApsaraMQ for MQTT technical support in DingTalk group 116015007918.
Instance limits
|
Limit |
Limits |
Description |
|
Instance name |
|
You cannot specify a custom name when creating an instance. By default, the instance name matches its instance ID. You can rename it in the ApsaraMQ for MQTT console. |
|
Message Transactions Per Second (TPS) per instance |
Throttled based on purchased specifications. If the message TPS exceeds the specification limit, clients (including open source MQTT clients and cloud SDKs) may experience disconnections, response timeouts, or message discards. |
A single MQTT client typically handles a low message volume, and some SDKs are not designed for high throughput. Keep the message TPS for a single MQTT client below 20. For higher throughput in server-side scenarios, use an ApsaraMQ for RocketMQ client instead. |
|
Online connections per instance |
Throttled based on purchased specifications. New connections may be rejected if the number of connections exceeds the specification limit. |
ApsaraMQ for MQTT monitors online connections and sends alerts by default. You can adjust the alert threshold as needed. |
|
Subscription relationships per instance |
If the number of subscriptions exceeds the specification limit, new subscriptions may fail, existing client connections may be disconnected, or subscription integrity is not guaranteed. |
ApsaraMQ for MQTT monitors subscription relationships and sends alerts by default. You can adjust the alert threshold as needed. |
|
IP address of the instance endpoint |
None |
Instance endpoint IP addresses are dynamic and may change at any time. Do not hardcode IP addresses in your application. ApsaraMQ for MQTT is not responsible for issues caused by the following situations:
|
Topic limits
|
Limit |
Limits |
Description |
|
Topic name |
|
The topic name must fall within the specified length range when you send and receive messages. Otherwise, message sending and topic subscription fail. |
|
Number of parent topics per instance |
25 |
If the default limit does not meet your requirements, contact ApsaraMQ for MQTT technical support. The DingTalk group number is 116015007918. Note
The number of child topics is not limited. For stable business operations, the number of child topics should not exceed 1,000. |
|
Cross-region topic usage |
Not supported |
If you configure rules in ApsaraMQ for MQTT to enable data communication with ApsaraMQ for RocketMQ, the related resources must be in the same region. |
Client limits
|
Limit |
Limits |
Description |
|
Client ID |
|
The Client ID must not exceed this length limit. Otherwise, the client connection is terminated. |
|
Group ID |
|
The Group ID must fall within the specified length range. Otherwise, the client cannot send messages or subscribe to topics. |
|
Device ID |
|
The Device ID must adhere to the length limit. Otherwise, the client connection is terminated. |
|
Number of topics a single client can subscribe to |
30 |
Each client can subscribe to up to 30 topics simultaneously. Exceeding this limit causes new subscription requests to fail. Platinum Edition instances support customization. To request customization, contact ApsaraMQ for MQTT technical support in DingTalk group 116015007918. When you calculate the number of subscribed topics, a subscription that includes a wildcard character counts as one subscription. Subscriptions to different child topics under the same parent topic are counted as separate subscriptions. For example, a subscription to A/# is counted as one subscription. Subscriptions to A/# and A/a1/# are counted as two subscriptions. |
|
Number of wildcard subscription relationships |
A maximum of 100 wildcard subscription relationships are allowed for each parent topic. |
The server limits active wildcard subscriptions to 100 per parent topic. If exceeded, only 100 relationships are loaded, which may prevent some clients from receiving messages. Strictly control the number of wildcard subscriptions. For example, for parent topic A, subscriptions to A/#, A/a1/#, and A/a2/# count as three separate relationships. |
|
Maximum heartbeat interval |
8 minutes |
The heartbeat interval must not exceed 8 minutes. |
Message sending and receiving limits
|
Limit |
Limits |
Description |
|
Message size |
64 KB |
Messages exceeding this payload size limit are discarded. Platinum Edition instances support customization. To request customization, contact ApsaraMQ for MQTT technical support. The DingTalk group number is 116015007918. |
|
Message retention period |
3 days |
ApsaraMQ for MQTT retains offline messages only when QoS is set to 1 and cleanSession is set to false. Messages are retained for up to 3 days and then automatically deleted using the scrolling method. For more information about QoS and cleanSession, see Glossary. Platinum Edition instances support customization. To request customization, contact ApsaraMQ for MQTT technical support. The DingTalk group number is 116015007918. |
|
QoS and cleanSession |
The configuration of QoS=2 and cleanSession=false is not supported. |
When sending and receiving messages with ApsaraMQ for MQTT:
|
|
Token validity period |
30 days |
When you call the API operation to request a token, if the ExpireTime value exceeds 30 days, the operation returns a token without an error, but the actual validity period is capped at 30 days. |
|
Offline message visibility time |
10 seconds |
After the server pushes a message for the first time, it waits for a timeout or failure acknowledgment to determine whether the message becomes an offline message. This delay is typically 5 to 10 seconds. |
|
Number of offline messages stored |
1,000,000 |
The server limits offline messages per instance to 1,000,000. When exceeded, the earliest messages are cleared first. Use the persistence subscription pattern carefully to avoid generating excessive offline messages. If the default limit does not meet your requirements, contact ApsaraMQ for MQTT technical support. The DingTalk group number is 116015007918. |