All Products
Search
Document Center

ApsaraMQ for MQTT:Limits

Last Updated:Jun 22, 2026

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

  • Length: 3 to 64 characters

  • Allowed characters: digits (0-9), letters (a-z and A-Z), hyphens (-), and underscores (_). The name is case-insensitive.

  • Uniqueness: The instance name must be unique within the same region.

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:

  • The client connects using an IP address instead of a domain name, and the IP address becomes invalid after a DNS update.

  • A firewall policy is configured for a specific IP address, and the new IP address is blocked after a DNS update.

Topic limits

Limit

Limits

Description

Topic name

  • Length: 3 to 64 characters

    Note

    The topic length refers to the total length of the parent topic and the child topic.

  • Allowed characters: digits (0-9), letters (a-z and A-Z), hyphens (-), and underscores (_). The name is case-insensitive.

  • Uniqueness: The parent topic name must be unique within the same instance.

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

  • Length: Up to 64 characters

  • Allowed characters: digits (0-9), letters (a-z and A-Z), hyphens (-), and underscores (_).

The Client ID must not exceed this length limit. Otherwise, the client connection is terminated.

Group ID

  • Length: 7 to 64 characters

  • Allowed characters: digits (0-9), letters (a-z and A-Z), hyphens (-), and underscores (_). The ID must start with "GID_" or "GID-".

  • Uniqueness: The Group ID must be unique within the same instance.

The Group ID must fall within the specified length range. Otherwise, the client cannot send messages or subscribe to topics.

Device ID

  • Length: The Client ID format is <GroupID>@@@<DeviceID>. The length limit for the Device ID is dynamic. The total length of the Client ID cannot exceed 64 characters.

  • Allowed characters: digits (0-9), letters (a-z and A-Z), hyphens (-), and underscores (_).

  • Uniqueness: The Device ID must be unique within the same Group 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:

  • If cleanSession is set to true, you can set QoS to 0, 1, or 2.

  • If cleanSession is set to false, you cannot set QoS to 2. ApsaraMQ for MQTT does not support this configuration.

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.