View CLB monitoring data
If you encounter network connectivity issues such as request timeout or throttling with a Classic Load Balancer (CLB) instance, or if you need to understand its load and performance, use CloudMonitor to view the instance's operational status and metrics. You can view this data through the console, an API, or an SDK.
Prerequisites
A CLB instance must be created and have at least one listener. For more information, see the following topics:
View monitoring data in the console
-
Log on to the CLB console.
-
In the top navigation bar, select the CLB instance's region.
-
On the Instances page, find the target instance and use one of the following methods to view its monitoring information.
-
Method 1: In the Monitoring column, click
. In the Monitoring Information panel, click the Instances or Listeners tab. -
Method 2: Click the instance ID. On the Instance Details tab, click the Monitoring tab. Then, click the Instances or Listeners tab.
On the Instances tab, click the Bandwidth/Traffic sub-tab to view the Data Processed metric for the CLB instance's requests and responses.
You can set a time range for the chart by specifying the Time. Turn on Auto Refresh to update the monitoring data every minute.
-
The following table describes the supported monitoring metrics.
|
Metric |
Description |
|
Traffic |
|
|
Packets |
|
|
Concurrent Connections |
|
|
New Connections |
The average number of new connections from clients to the load balancer per collection period. |
|
Dropped Traffic |
|
|
Dropped Packets |
|
|
Dropped Connections |
The number of connections dropped per second. |
|
The following metrics are specific to Layer 7 (HTTP/HTTPS) listeners. |
|
|
Layer-7 QPS |
The number of HTTP or HTTPS requests processed per second. |
|
Response Time (Listener) |
The average response time of the load balancer. |
|
Layer 7 2xx/3xx/4xx/5xx/other status codes |
The number of HTTP response codes returned by the listener. |
|
Layer 7 upstream code 4xx/5xx |
The number of HTTP response codes returned by the backend server. |
|
Response Time (Server) |
The average response time of the backend server. |
View monitoring data by using an API
You can use the CloudMonitor API to view monitoring metrics and detailed data for a CLB instance.
To view monitoring data by using an API:
-
Query the namespace. Call the
DescribeProjectMetaoperation to query the namespace of CLB in CloudMonitor. -
Optional: View available metrics. Call the
DescribeMetricMetaListoperation to query the descriptions of available time-series metrics in CloudMonitor. For more information, see CLB monitoring. -
Query the monitoring data for a specific metric.
-
Call the
DescribeMetricLastoperation to query the latest monitoring data for a specific CLB monitoring object. -
Call the
DescribeMetricListoperation to query the time-series data of a CLB monitoring object over a specific time range.
-
DescribeProjectMeta
Call the DescribeProjectMeta operation to query the namespace of CLB in CloudMonitor.
-
Set the Labels parameter to
[{"name":"product","value":"SLB"}]and keep the default values for other parameters. The Labels parameter filters resources by product tag. -
From the response, obtain the value of the Namespace parameter for the CLB instance in CloudMonitor. The value is
acs_slb_dashboard.
DescribeMetricMetaList
Call the DescribeMetricMetaList operation to query the descriptions of the time-series metrics available in CloudMonitor.
-
Set the Namespace parameter to acs_slb_dashboard and keep the default values for other parameters.
-
In the response, find the time-series metrics for the load balancer. For example, check for the Layer-7 QPS metric.
DescribeMetricLast
Call the DescribeMetricLast operation to query the latest monitoring data for a specific monitoring object of a load balancer. This example queries the latest data for the Layer-7 QPS metric.
-
In the parameters, set the parameters for querying Layer-7 QPS.
Configure the following parameters and keep the default values for other parameters.
-
MetricName: The name of the monitoring metric. In this example, set the value to InstanceQps.
-
Dimensions: A dimension map for querying monitoring data of a specific resource. In this example, set the value to
[{"instanceId":"lb-bp1r92vzpemy099f******"}]. -
Namespace: The namespace of the cloud service. In this example, set the value to acs_slb_dashboard.
-
-
From the response, view the latest monitoring data for Layer-7 QPS.
DescribeMetricList
Call the DescribeMetricList operation to query the time-series data of a load balancer metric over a specific time range.
-
In the parameters, set the parameters for querying the monitoring data of Layer-7 QPS over a specific time range.
Configure the following parameters and keep the default values for other parameters.
-
MetricName: The name of the monitoring metric. In this example, set the value to InstanceQps.
-
Namespace: The namespace of the cloud service. In this example, set the value to acs_slb_dashboard.
-
Dimensions: A dimension map for querying monitoring data of a specific resource. In this example, set the value to
[{"instanceId":"lb-bp1r92vzpemy099f******"}]. -
StartTime: The beginning of the time range to query. The value of StartTime cannot be the same as or later than the value of EndTime. In this example, set the value to
2020-03-28 00:10:00.Supported formats:
-
UNIX timestamp: The number of milliseconds since 00:00:00 UTC on January 1, 1970.
-
Format: YYYY-MM-DDThh:mm:ssZ.
-
-
EndTime: The end of the time range to query. The format is the same as that of StartTime. In this example, set the value to
2020-03-28 00:11:00.
-
-
From the response, view the monitoring data for Layer-7 QPS over the specified time range.
View monitoring data by using an SDK
This section describes how to use an SDK to view monitoring metrics and detailed data for CLB. The following example shows how to call the DescribeMetricList operation to query the maximum number of concurrent connections per second for a CLB instance.
-
Set the following parameters and keep the default values for other parameters:
-
MetricName: The name of the monitoring metric. In this example, set this parameter to InstanceMaxConnection.
-
Namespace: The namespace of the cloud service. In this example, set this parameter to acs_slb_dashboard.
-
Dimensions: A dimension map for querying monitoring data of a specific resource. In this example, set this parameter to [{"instanceId":"lb-bp1r92vzpemy099f******"}].
-
StartTime: The beginning of the time range to query. The value cannot be the same as or later than the value of EndTime. In this example, set this parameter to
2022-10-13 20:45:03.Supported formats:
-
UNIX timestamp: The number of milliseconds since 00:00:00 UTC on January 1, 1970.
-
Format: YYYY-MM-DDThh:mm:ssZ.
-
-
EndTime: The end of the time range to query. The supported formats are the same as those for StartTime. In this example, set this parameter to
2022-10-13 20:47:03.
-
-
On the SDK Sample Code tab, select the Python tab, and then click Run Example.
-
View the result in the panel that appears.
FAQ
CLB monitoring: Connections without requests
Internet scanning tools might access the public IP address of your CLB instance. These tools initiate TCP connections directly to the public IP address. These connections contribute to the connection count and bandwidth metrics. However, because the scanning tools do not send valid HTTP requests, the request count in Layer-7 monitoring remains empty.
This is the expected statistical behavior for CLB monitoring:
-
Connection and bandwidth metrics count all TCP-level connections, including those generated by scanners.
-
The request count (QPS) measures only valid Layer-7 HTTP/HTTPS requests and does not include TCP connections that lack an HTTP request.
If you migrate your services from CLB to Application Load Balancer (ALB) and notice that the CLB instance still shows connection and bandwidth data but no requests, this is typically caused by scanning activity and does not affect your migrated services.
References
For detailed descriptions of CLB monitoring metrics, see CLB monitoring.