All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Best practices for querying the peak TPS of an instance

更新時間:Sep 23, 2024

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:

  • 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

(Recommend) 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 the display of an excessively long query result list, only the query results returned within the first 10 minutes are displayed.

Peak TPS at the second level

  • Peak TPS of an instance

  • Peak TPS of a specific API operation

Query the peak TPS of an instance by using Simple Log Service

  • Benefits: You can use Simple 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 results are not easy to understand.

    • You are charged when you use Simple Log Service. For information about the billing of Simple Log Service, see Billable items of pay-by-feature.

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

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.

  2. 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.

  3. In the left-side navigation pane, click Monitoring and Alerting.

  4. 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

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.

  2. 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.

  3. In the left-side navigation pane, click Monitoring and Alerting.

  4. 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.

  5. In the Configure Rule Description panel, specify the alert rule name and choose Instance > Instance API peak TPS from the Metric drop-down list. 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, click Instances.

  2. 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.

  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 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.

      按API级别查询

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