This topic describes how to query the peak transactions per second (TPS) of an ApsaraMQ for RabbitMQ instance.
Background information
ApsaraMQ for RabbitMQ imposes limits on the peak TPS of instances. If the actual TPS usage of your ApsaraMQ for RabbitMQ instance exceeds the specified limit, the 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 provided by ApsaraMQ for RabbitMQ to query the peak TPS of an instance.
Method | Description | Time granularity | Resource level |
(Recommend) 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 |
(Recommend) Query the peak TPS of an instance on the Instance Details page |
| Peak TPS at the second level |
|
Query the peak TPS of an instance by using Simple 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, click Instances.
In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, 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, select Instance from the Group Name drop-down list and select a time range to query the peak TPS.
The following figure shows an example.
Configure an alert rule based on the peak TPS of an API operation
Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.
In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, 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, click Create Alert Rule.
You are redirected to the Configure Rule Description panel in the CloudMonitor console.
In the Configure Rule Description panel, specify the alert rule name and choose Alert service. from the Metric drop-down list. For more information, see
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, click Instances.
In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, 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.
NoteYou can use this query method to query the peak TPS data for the previous 15 days. The query results are accurate to seconds. To prevent the display of an excessively long query result list, only the query results returned within the first 10 minutes are 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, select the API operation whose peak TPS you want to query, specify the start time of the query, and then click Query.
Query the peak TPS by using Simple Log Service
For more information, see Query and analyze logs.
The following code provides a sample Simple 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