This topic describes how to query the CPU utilization and credits of a burstable instance in the Elastic Compute Service (ECS) console and how to configure alert rules on CPU credits in the CloudMonitor console.

Prerequisites

Before you can configure contacts to receive notifications, you must create a contact group. For more information, see Create an alert contact or alert contact group.

Background information

Changes to the number of CPU credits of a burstable instance directly affect the CPU utilization and load performance of the instance. You can configure alert rules that include the following monitoring metrics for one or more burstable instances in the CloudMonitor console: BurstCredit, TotalCredit, NotpaidSurplusCredit, and AdvanceCredit. The following table describes the monitoring metrics for CPU credits of burstable instances.

Monitoring metric Description
BurstCredit The changes in CPU credit consumption. Consumption trends are consistent with CPU utilization. For more information, see CPU credits.
TotalCredit The changes in CPU credit balance. CPU credit balance can be consumed to maintain CPU utilization. For more information, see CPU credits.
NotpaidSurplusCredit The changes in the number of overdrawn CPU credits. Overdrawn CPU credits can be used only after the unlimited mode is enabled. For more information, see Performance modes.
AdvanceCredit The changes in the number of advance CPU credits. Advance CPU credits can be used only after the unlimited mode is enabled. For more information, see Performance modes.

View CPU credit usage information

This section describes how to view the real-time CPU credit trends of a burstable instance in the ECS console.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the burstable instance and click its ID to go to the Instance Details page.
  5. Click the Monitoring tab and view the CPU credit usage and CPU utilization of the instance.
    Note
    • CPU utilizations displayed in the ECS console are the values measured by instance operating systems and are not used to calculate CPU credit usage.
    • CPU utilizations that are collected from physical machines incorporate the simulation overheads of privileged instructions and are used to calculate CPU credit usage. You can log on to the CloudMonitor console, click Host Monitoring in the left-side navigation pane, and then click the ID of an ECS instance on the Host Monitoring page. Then, you can click the Basic Monitoring tab and view the CPU utilization of the instance. For more information, see Overview.

Create alert rules on CPU credits

This section describes how to create alert rules that include the TotalCredit and NotpaidSurplusCredit monitoring metrics in the CloudMonitor console. Take note of the following items:
  • In standard mode, if a burstable instance does not have available CPU credits, its CPU utilization cannot burst above the baseline level. You can monitor the TotalCredit metric to receive notifications when instance performance is limited and determine whether to enable the unlimited mode.
  • In unlimited mode, after a burstable instance consumes all of its advance CPU credits, the instance consumes overdrawn CPU credits to continue to run above its performance baseline. The consumed overdrawn CPU credits are billed and charged on an hourly basis. You can monitor the NotpaidSurplusCredit metric to receive notifications when overdrawn CPU credits are billed and determine whether to disable the unlimited mode.
  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, choose Alerts > Alert Rules.
  3. On the Alert Rules page, click Create Alert Rule.
  4. In the Create Alert Rule panel, configure parameters.
    1. Configure instance-related parameters:
      • Product: Select ECS. from the drop-down list.
      • Resource Range: Select Instances.
      • Associated Resources: Select one or more burstable instances from the drop-down list.
    2. Click Add Rules. In the Add Rule Description panel, configure parameters to create an alert rule. If you want to create multiple alert rules, repeat this step.
      • Alert Rule: Enter a name for the alert rule.
      • Metric Type: Select Single indicator.
      • Metric and Threshold and Alert Level: Configure alert rules and judgment standards.
        • Monitoring of TotalCredit: Choose Instance Dimension > (ECS)TotaCredit to monitor accrued CPU credits. In this example, 1Minute cycle, Continue for 1 periods, Average, <, and 1 are used as the values of the alert triggering condition fields. If the average value of TotalCredit remains less than 1 for at least 1 minute, an alert is triggered.
          Note In standard mode, if the number of accrued CPU credits of a burstable is less than 1, the CPU utilization of the instance cannot exceed the performance baseline. In unlimited mode, a burstable instance can consume advance or overdrawn CPU credits to run at a CPU utilization higher than the performance baseline. You can also configure the average value for multiple consecutive periods as the alert triggering condition based on your actual requirements on CPU performance.
          (ECS)TotalCredit
        • Monitoring of NotpaidSurplusCredit: Choose Instance Dimension > (ECS)NotpaidSurplusCredit to monitor overdrawn CPU credits. In this example, 1Minute cycle, Continue for 1 periods, Average, >, and 0 are used as the values of the alert triggering condition fields. If the average value of NotpaidSurplusCredit remains greater than 0 for at least 1 minute, an alert is triggered.
          Note If the number of overdrawn CPU credits is greater than 0, overdrawn CPU credits are being used and billed. You can also configure the average value for multiple consecutive periods as the alert triggering condition based on your actual requirements on billing of overdrawn CPU credits.
          (ECS)NotpaidSurplusCredit
        • Monitoring of BurstCredit: Choose Instance Dimension > (ECS)BurstCredit to monitor consumed CPU credits.
        • Monitoring of AdvanceCredit: Choose Instance Dimension > (ECS)AdvanceCredit to monitor advance CPU credits.
    3. Mute for: Select the interval at which notifications are pushed.
    4. Effective Time: Select the time range during which you can receive notifications.
    5. Alert Contact Group: Select a contact group to receive notifications.
    6. Configure parameters in the Advanced Settings section.
      • Set WebHook And Alert Trigger.
        • Alert Callback: The callback URL that can be accessed over the Internet. CloudMonitor sends a POST request to push an alert notification to the specified callback URL.
        • Auto Scaling: If you turn on Auto Scaling and an alert is triggered, the specified scaling rule is enabled.
        • Log Service: If you turn on Log Service and an alert is triggered, the alert information is written to the specified Logstore in Log Service.
        • Message Service - topic: If you turn on Message Service - topic and an alert is triggered, the alert information is written to the specified Message Service (MNS) topic.
      • No data alarm processing method: The method that is used to handle alerts when no monitoring data is found. Default value: Do not do anything.
    7. Optional:Set Tags.

      Alert labels are added to the alert content.

  5. Click OK.