This topic describes how to view the CPU utilization and cpu credits of a burstable instance in the ECS console and create a cpu credit alert rule in the CloudMonitor console.
Prerequisites
To receive alert notifications, you must first create an alert contact group. For more information, see Create an alert contact or alert contact group.
Background
Changes in the cpu credits of a burstable instance directly affect its CPU utilization and performance. You can create alert rules in the CloudMonitor console to monitor metrics such as Burstable Instance - Consumed CPU Credits, Burstable Instance - Accrued CPU Credits, Burstable Instance - Excess CPU Credits, or Burstable Instance - Advanced CPU Credits for one or more burstable instances. The following table describes the metrics for monitoring the cpu credits of burstable instances.
|
Metric |
Description |
|
Burstable Instance - Consumed CPU Credits |
This metric tracks the change in consumed cpu credits. Its trend mirrors CPU utilization. For more information, see CPU credits. |
|
Burstable Instance - Accrued CPU Credits |
Tracks the cpu credit balance available to sustain CPU utilization. For more information, see CPU credits. |
|
Burstable Instance - Excess CPU Credits |
This metric tracks the change in excess cpu credits. Excess cpu credits are consumed only when unlimited mode is enabled. For more information, see Performance modes. |
|
Burstable Instance - Advanced CPU Credits |
This metric tracks the change in advanced cpu credits. Advanced cpu credits are consumed only when unlimited mode is enabled. For more information, see Performance modes. |
View CPU credit usage
Follow these steps to view the real-time trend of cpu credits for a burstable instance in the ECS console.
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
-
Find the target burstable instance and click its ID to go to the Instance Info page.
-
Click the Monitor tab to view cpu credit usage and CPU utilization.
Note-
The operating system inside the ECS instance monitors the CPU utilization that you view in the ECS console. CPU credit consumption is not based on this value.
-
The physical host layer collects the CPU utilization data used for calculating cpu credit consumption. This data includes the emulation overhead of privileged instructions inside the ECS instance. You can log on to the CloudMonitor console, click the instance ID on the Host Monitoring page, and then view the relevant data on the Basic Monitoring tab. For more information, see Host Monitoring Overview.
-
Create alert rules for CPU credits
The following steps describe how to create alert rules for the Total Credit and (ECS)NotpaidSurplusCredit metrics in the CloudMonitor console.
-
In standard mode, if a burstable instance has no available cpu credits, its CPU utilization cannot exceed the baseline performance. Monitoring Burstable Instance-CPU Credit Balance notifies you when instance performance is constrained, helping you decide whether to enable unlimited mode.
-
In unlimited mode, a burstable instance consumes excess cpu credits to maintain CPU utilization above the baseline performance after exhausting its advanced cpu credits. You are charged for excess cpu credits on an hourly basis. Therefore, monitoring Burstable Instance-Overdrawn CPU Credits notifies you when billing for excess cpu credits begins, allowing you to decide whether to disable unlimited mode.
-
Log on to the CloudMonitor console.
-
In the left-side navigation pane, choose .
-
On the Alert Rule page, click Create Alert Rule.
-
In the Create Alert Rules panel, configure the following settings.
-
Set the resource information:
-
Product: Select Elastic Compute Service (ECS).
-
Resource Scope: Select Instance.
-
Associated Resources: Select one or more burstable instances.
-
-
Click . In the Configure Rule Description panel, set the following parameters:
-
Rule Name: Enter a custom name.
-
Metric Type: Simple Metric.
-
Configure the Metrics and Threshold and Alert Level.
Example of monitoring Burstable Instance-CPU Credit Balance: Select . In this example, the rule triggers a warning if the average value of Burstable Instance - Accrued CPU Credits is less than 1 for 3 consecutive 1-minute periods.
NoteWhen accrued cpu credits are less than 1, the CPU utilization of the burstable instance cannot exceed the baseline performance in standard mode. In unlimited mode, if CPU utilization exceeds the baseline performance, the instance starts to consume advanced and excess cpu credits. You can set the number of consecutive periods for the trigger condition based on your tolerance for performance constraints.
-
-
Mute Period: Select the interval for sending alert notifications.
-
Effective Period: Select the time period during which you can receive notifications.
-
Alert Contact Group: Select an alert contact group.
If no contact group is available, click Create Alert Contact Group on the right to create one.
-
Tag: Adds a custom tag to the alert notification.
-
Configure Advance Settings.
-
Alarm callback: A publicly accessible URL that receives alert information pushed by CloudMonitor through POST requests.
-
Push Channel.
-
Auto Scaling: If you enable Auto Scaling, an alert triggers the corresponding scaling rule.
-
Simple Log Service: If you enable Simple Log Service, CloudMonitor writes the alert information to the specified Logstore in Log Service when an alert occurs.
-
Message Service (MNS) - Topic: If you enable Message Service (MNS) - Topic, CloudMonitor writes alert information to the specified topic in Message Service (MNS) when an alert occurs.
-
Function Compute: If you enable Function Compute, CloudMonitor sends alert notifications to Function Compute for formatting when an alert occurs. You must specify the region, service, and function for Function Compute.
-
-
NoDataPolicy: Specifies the action to take when no monitoring data is available. The default value is Do not do anything.
-
-
-
After you configure the settings, click Confirm.