Classic Load Balancer (CLB) integrates with CloudMonitor to expose real-time performance metrics for your instances and listeners. Use these metrics to diagnose request timeouts, identify throttling, and assess load capacity.
Three access methods are supported: the CLB console, CloudMonitor API operations, and SDKs.
Prerequisites
Before you begin, ensure that you have:
A CLB instance with at least one listener configured. See Add a TCP listener, Add a UDP listener, Add an HTTP listener, or Add an HTTPS listener
View monitoring data in the CLB console
Log on to the CLB console.
-
Log on to the CLB console.
In the top navigation bar, select the region where your CLB instance resides.
On the Instances page, find your CLB instance and open the monitoring panel using either method:
Method 1: Click
in the Monitoring column. In the Monitoring Information panel, select the Instances or Listeners tab.Method 2: Click the instance ID. On the Instance Details tab, click Monitoring, then select the Instances or Listeners tab.
On the Instances > Bandwidth/Traffic view, the panel header shows Processed Data, which counts both requests and responses.
Set Time to filter by time range. Turn on Auto Refresh to update the data every minute.
Available metrics
The following metrics are available for all listener types (Layer 4 and Layer 7).
| Metric | Description |
|---|---|
| Traffic | Inbound Traffic: traffic volume received by the CLB instance.<br>Outbound Traffic: traffic volume sent from the CLB instance. |
| Packets | Inbound Packets: packets received per second.<br>Outbound Packets: packets sent per second. |
| Concurrent connections | Active Connections: TCP connections in the ESTABLISHED state. With persistent connections, a single connection can carry multiple file transfers simultaneously.<br>Inactive Connections: TCP connections not in the ESTABLISHED state. Run netstat -an on Windows or Linux to inspect these connections.<br>Maximum Concurrent Connections: total number of TCP connections. |
| New connections | Average number of new TCP connections established between clients and the CLB instance per statistical period. |
| Traffic dropped | Inbound Traffic Dropped: inbound traffic dropped per second.<br>Outbound Traffic Dropped: outbound traffic dropped per second. |
| Packets dropped | Inbound Packets Dropped: inbound packets dropped per second.<br>Outbound Packets Dropped: outbound packets dropped per second. |
| Connections dropped | Connections dropped per second. |
The following metrics apply only to Layer 7 (HTTP/HTTPS) listeners.
| Metric | Description |
|---|---|
| Layer 7 QPS | HTTP and HTTPS requests processed per second. |
| Layer 7 RT | Average response time of the CLB instance. |
| Layer 7 2XX/3XX/4XX/5XX/Other status codes | HTTP response codes returned by listeners. |
| Layer 7 upstream code 4XX/5XX | HTTP response codes returned by backend servers. |
| Layer 7 upstream RT | Average response time of backend servers. |
Query monitoring data using the API
CLB monitoring data is available through CloudMonitor API operations. The workflow consists of three steps: look up the CLB namespace, optionally list available metrics, then query the data.
Step 1: Get the CLB namespace using DescribeProjectMeta
Call DescribeProjectMeta to retrieve the CLB namespace in CloudMonitor.
Set Labels to
[{"name":"product","value":"SLB"}]and leave all other parameters at their defaults.The response returns
acs_slb_dashboardas the Namespace value. Use this namespace in subsequent API calls.
Step 2: (Optional) List available metrics using DescribeMetricMetaList
Call DescribeMetricMetaList to see all time series metrics available for CLB, or consult CLB monitoring metrics directly.
Set Namespace to
acs_slb_dashboardand leave all other parameters at their defaults.The response lists all CLB metrics with their dimensions, units, and supported statistics. Confirm that
InstanceQps(Layer 7 QPS) is present before using it in the next step.
Step 3: Query metric data
Use one of the following operations depending on what you need:
DescribeMetricLast — returns the most recent data point for a metric
DescribeMetricList — returns data points within a time range
Query the latest data using DescribeMetricLast
Call DescribeMetricLast to get the latest value of a metric. This example queries Layer 7 QPS (InstanceQps).
Open OpenAPI Explorer for DescribeMetricLast.Log on to OpenAPI Explorer
Set the following parameters and leave all others at their defaults:
Parameter Value MetricName InstanceQpsNamespace acs_slb_dashboardDimensions [{"instanceId":"lb-bp1r92vzpemy099f******"}]The response contains the latest QPS data in the
Datapointsfield.
Query historical data using DescribeMetricList
Call DescribeMetricList to retrieve data points for a metric within a specific time window. This example queries Layer 7 QPS (InstanceQps).
Set the following parameters and leave all others at their defaults:
StartTimeandEndTimeaccept two formats:UNIX timestamp (milliseconds since January 1, 1970, 00:00:00 UTC)
UTC time in
YYYY-MM-DDThh:mm:ssZformat
Parameter Value MetricName InstanceQpsNamespace acs_slb_dashboardDimensions [{"instanceId":"lb-bp1r92vzpemy099f******"}]StartTime 2020-03-28 00:10:00EndTime 2020-03-28 00:11:00The response returns all data points in the specified window.
View monitoring data using SDKs
OpenAPI Explorer generates ready-to-use SDK code for any CloudMonitor operation. This example queries the maximum number of concurrent connections (InstanceMaxConnection) for a CLB instance using DescribeMetricList.
Set the following parameters and leave all others at their defaults:
Parameter Value MetricName InstanceMaxConnectionNamespace acs_slb_dashboardDimensions [{"instanceId":"lb-bp1r92vzpemy099f******"}]StartTime 2022-10-13 20:45:03EndTime 2022-10-13 20:47:03Click the SDK Sample Code tab and select Python.
Click Example to generate and run the code. The results appear in the panel below.
What's next
For a complete list of CLB monitoring metrics and their descriptions, see CLB monitoring metrics.
For definitions of CLB monitoring metrics, see CLB metric reference.