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.

MethodDescriptionTime granularityResource level
(Recommended)Query the peak TPS of an instance and configure an alert rule by using CloudMonitorBenefits:
  • You can use this query method to query the changes of peak TPS in the previous 14 days. This query method helps you identify exceptions in an efficient manner.
  • You can use the instance peak TPS as a metric to configure an alert rule.
  • You are not charged when you use this query method.
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
  • Benefits:
    • You can use this query method to query the peak TPS at the second level. This query method helps you identify exceptions in an accurate manner.
    • You can query the peak TPS of a specific API operation.
    • You are not charged when you use this query method.
  • Usage notes: To prevent excessively long query results, only the query result for the previous 10 minutes is returned.
Peak TPS at the second level
  • Peak TPS of an instance
  • Peak TPS of a specific API operation
Query the peak TPS by using Log Service
  • Benefits: You can use Log Service statements to query the peak TPS of an instance. This query method helps you identify exceptions in complex business scenarios.
  • Usage notes:
    • Compared with the preceding two query methods, this query method is more complicated and the query result is not easy to understand.
    • You are charged when you use Log Service. For information about the pricing of Log Service, see Billable items.
Peak TPS at the second levelPeak 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

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. 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.
  3. In the left-side navigation pane, click Monitoring and Alerting.
  4. 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:Figure - Query result of the metric

Configure an alert rule based on the peak TPS of API calls metric

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. 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.
  3. In the left-side navigation pane, click Monitoring and Alerting.
  4. In the upper-right corner of the Monitoring and Alerting page, move the pointer over the Figure - More icon and click Configure Alert Rules.
    You are redirected to the Alert Rules page in the CloudMonitor console.
  5. On the Alert Rules page, click Create Alert Rule. In the Create Alert Rule panel, configure an alert rule. For the Metric parameter, choose Instance > Instance API peak TPS. For more information, see Alert service.

Query the peak TPS of an instance on the instance details page

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. 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.
  3. 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.

      Figure-Query the peak TPS of an instance
    • 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.

      Figure - Query the peak TPS of an API operation

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