This topic describes how to query transactions per second (TPS) charts based on the message operation logs that are generated for a ApsaraMQ for RabbitMQ instance. If the maximum number of requests that you can send per second without being throttled is exceeded, you can query second-level TPS charts based on the methods described in this topic. This can help you identify exceptions and ensure availability of your business.

Prerequisites

You are logged on to the ApsaraMQ for RabbitMQ console. The message operation logs that are generated for a ApsaraMQ for RabbitMQ instance are pushed to Log Service. For more information, see Configure message logs.

Background information

CloudMonitor provides charts that display the average of minute-level statistics for a Message Queue for RabbitMQ instance. CloudMonitor does not provide second-level TPS data. The number of requests that clients initiate by calling Advanced Message Queuing Protocol (AMQP) methods per second is counted as the TPS of a ApsaraMQ for RabbitMQ instance.

The number of requests that are sent by calling the following AMQP methods can be counted as the TPS:

  • ConnectionOpen and ChannelOpen
  • QueueDeclare, QueueDelete, QueueBind, and QueueUnbind
  • ExchangeDeclare and ExchangeDelete
  • ExchangeBind and ExchangeUnBind
  • SendMessage, BasicConsume, BasicGet, BasicAck, BasicReject, BasicNack, and BasicRecover

For more information about the request methods, see Request method.

Procedure

Specify a time range to query, configure the chart properties, and then enter an analytic statement in the search box of Log Service to query a TPS chart. For more information, see Query and analyze logs.
(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     
Query logs
Note
  • If the client calls BasicNack with the multiple=false setting, a request is sent for each call. If the client calls BasicNack with the multiple=true setting, multiple requests are sent for each call. However, Log Service creates only a log entry for a BasicNack call, regardless of whether multiple requests are sent for a call. Therefore, the TPS returned in a TPS chart is smaller than the actual TPS.
  • When you query a TPS chart, if a large amount of traffic is received by your client, we recommend that you specify a time range that is less than or equal to 1 hour and add limit 90000000 to the SQL statement that is executed to query the TPS chart. You can also replace 90000000 in limit with the largest possible value.