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.
Metric | Description |
BurstCredit | The changes in CPU credit consumption. Consumption trends are consistent with CPU utilization. For more information, see the "CPU credits" section in Overview. |
TotalCredit | The changes in CPU credit balance. CPU credit balance can be consumed to maintain CPU utilization. For more information, see the "CPU credits" section in Overview. |
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 the "Performance modes" section in Overview. |
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 the "Performance modes" section in Overview. |
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.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the burstable instance and click its ID to go to the Instance Details page.
Click the Monitoring tab and view the CPU credit usage and CPU utilization of the instance.
NoteCPU 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 Burstable Instance-CPU Credit Balance and Burstable Instance-Overdrawn CPU Credits 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 Burstable Instance-CPU Credit Balance 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 Burstable Instance-Overdrawn CPU Credits metric to receive notifications when overdrawn CPU credits are billed and determine whether to disable the unlimited mode.
Log on to the CloudMonitor console.
In the left-side navigation pane, choose
.On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, complete the following settings.
Configure instance-related parameters:
Product: Select Elastic Compute Service (ECS) from the drop-down list.
Resource Range: Select Instances.
Associated Resources: Select one or more burstable instances from the drop-down list.
Click
. In the Configure Rule Description panel, configure parameters to create an alert rule.Alert Rule: Enter a name for the alert rule.
Metric Type: Select Single Metric.
Metric and Threshold and Alert Level: Configure alert rules and judgment standards.
Monitoring of Burstable Instance-CPU Credit Balance: Choose
to monitor accrued CPU credits. In this example, 1 Consecutive Cycles (1 Cycle = 1 Minutes), Average, <, and 1 are used as the values of the alert trigger condition fields. If the average value of TotalCredit remains less than 1 for at least 1 minute, an alert is triggered.NoteIn 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 trigger condition based on your actual requirements on CPU performance.
Monitoring of Burstable Instance-Overdrawn CPU Credits: Choose
to monitor overdrawn CPU credits. In this example, 1 Consecutive Cycles (1 Cycle = 1 Minutes), Average, >, and 0 are used as the values of the alert trigger condition fields. If the average value of NotpaidSurplusCredit remains greater than 0 for at least 1 minute, an alert is triggered.NoteIf 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 trigger condition based on your actual requirements on billing of overdrawn CPU credits.
Monitoring of Burstable Instance-CPU Credit Consumption: Choose
to monitor consumed CPU credits.Monitoring of Burstable Instance-Advance CPU Credits: Choose
to monitor advance CPU credits.
Mute For: Select the interval at which notifications are pushed.
Effective Period: Select the time range during which you can receive notifications.
Alert Contact Group: Select a contact group to receive notifications.
If no contact groups are available, click Add Contact Group on the right side to add a contact group.
(Optional) Configure Tag.
Alert tags are added to the alert content.
Configure parameters in the Advanced Settings section.
Configure 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.
Configure Push Channel.
Auto Scaling: If you turn on Auto Scaling and an alert is triggered, the specified scaling rule is enabled.
Simple Log Service: If you turn on Simple Log Service and an alert is triggered, the alert information is written to the specified Logstore in Log Service.
Simple Message Queue (formerly MNS) - topic: If you turn on Simple Message Queue (formerly MNS) - topic and an alert is triggered, the alert information is written to the specified Message Service (MNS) topic.
Function Compute: If you turn on Function Compute and an alert is triggered, the alert information is sent to Function Compute for formatting. To configure Function Compute, you need to specify the region, service, and function.
Configure Method to handle alerts when no monitoring data is found: By default, if no monitoring data is found and an alert is triggered, Do not do anything is specified for this parameter.
Click Confirm.