This topic describes how to query the peak TPS of a ApsaraMQ for RabbitMQ instance.
Background information
Your ApsaraMQ for RabbitMQ instance limits the peak TPS that you can use based on its specifications. If the actual peak TPS exceeds this limit, your instance is throttled.
To prevent throttling and related business impacts, we recommend that you specify the peak TPS as a key metric in daily O&M tasks to detect business risks at the earliest opportunity. You can also monitor this metric to analyze workload changes and determine whether the current instance type meets your business requirements.
Query methods
The following table describes the methods that are supported by ApsaraMQ for RabbitMQ to query the instance peak TPS.
Method | Description | Time granularity | Resource level |
---|---|---|---|
(Recommended)Query the peak TPS of an instance and configure an alert rule by using CloudMonitor | Benefits:
| Peak TPS at the minute level The peak TPS of an instance during a 1-minute statistical period | Peak TPS of an instance |
(Recommended)Query the peak TPS of an instance on the instance details page |
| Peak TPS at the second level |
|
Query the peak TPS by using Log Service |
| Peak TPS at the second level | Peak TPS of an instance |
Query the peak TPS of an instance and configure an alert rule by using CloudMonitor
Query the peak TPS of an instance
- Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
- In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
- In the left-side navigation pane, click Monitoring and Alerting.
- On the Monitoring and Alerting page, set the Group Name parameter to Instance and specify a time range to query data. The following figure shows an example:
Configure an alert rule based on the peak TPS of API calls metric
- Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
- In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
- In the left-side navigation pane, click Monitoring and Alerting.
- In the upper-right corner of the Monitoring and Alerting page, move the pointer over the icon and click Configure Alert Rules. You are redirected to the Alert Rules page in the CloudMonitor console.
- On the Alert Rules page, click Create Alert Rule. In the Create Alert Rule panel, configure an alert rule. For the Metric parameter, choose . For more information, see Alert service.
Query the peak TPS of an instance on the instance details page
- Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
- In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
- On the Instance Details page, click the Peak TPS Query tab. Note You can use this query method to query the peak TPS data for the previous 15 days. The query result is accurate to seconds. To prevent excessively long query results, only the query result for the past 10 minutes is displayed.
- Query the peak TPS of an instance.
Click the Query by Instance tab, specify the start time of the query, and then click Query.
- Query the peak TPS of an API operation.
Click the Query by API tab, specify the start time of the query, and then click Query.
- Query the peak TPS of an instance.
Query the peak TPS by using Log Service
For more information, see Query and analyze logs.
The following code provides a sample Log Service statement for querying the peak TPS:
(Action : ConnectionOpen or Action : ChannelOpen or Action: ExchangeDeclare or Action: QueueBind or Action : QueueDeclare or Action : QueueDelete or Action : ExchangeDelete or Action : QueueUnBind or Action : ExchangeBind or Action : ExchangeUnBind or Action : BasicConsume or Action : BasicReject or Action : BasicRecover or Action : SendMessage or Action : BasicAck or Action : BasicNack or Action : BasicGet ) | select from_unixtime(cast(microtime as bigint)/1000/1000) as time, COUNT(*) as count GROUP by time ORDER by time limit 90000000