Configuring Health Check

Last updated: 2023-09-05 16:18:21

You can enable health check when configuring listeners to determine the availability of real servers. For more information on health checks, see Health Check Overview.

Description

TCP listeners for IPv6 CLB instances do not support HTTP health checks and custom health checks.
UDP listeners for IPv6 Cloud Load Balancer (CLB) instances do not support custom health checks.

Preparations

1. You have created a Cloud Load Balancer (CLB) instance. For more information, see Creating CLB Instances.
2. Create a CLB listener.
To create a TCP listener, see Configuring a TCP Listener.
To create a UDP listener, see Configuring a UDP Listener.
To create a TCP SSL listener, see Configuring a TCP SSL Listener.
To create an HTTP listener, see Configuring an HTTP Listener.
To create an HTTPS listener, see Configuring an HTTPS Listener.

TCP Listener

Layer-4 TCP listeners support three types of health checks: Layer-4 TCP, Layer-7 HTTP, and custom health checks.
TCP health checks are conducted with SYN packets, that is, TCP three-way handshakes are initiated to obtain the status information of real servers.
HTTP health checks are conducted by sending HTTP requests to obtain the status information of real servers.
Custom protocol health checks are conducted by customizing the input and output content of the application layer protocol to obtain the status information of real servers.

Configuring TCP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the Health Check tab, select TCP as the check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
TCP health checks are conducted if TCP is selected.
Port
This parameter is optional. We recommend not specifying the port unless you need to check a specific port. The real server port will be checked if the port is not specified here.
Show advanced options
For more details, refer to Advanced Options.

Configuring HTTP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the "Health Check" tab, select "HTTP" as the check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
HTTP health checks are conducted if HTTP is selected.
Port
This parameter is optional. We recommend not specifying the port unless you need to check a specific port. The real server port will be checked if the port is not specified here.
The domains to check
Limits on a health check domain name:
Length: 1 to 80 characters.
It is the forwarding domain name by default.
Regular expressions are not supported. If your forwarding domain name is a wildcard one, you need to specify a fixed (non-regular) domain name as the health check domain name.
Supported characters: lowercase letters (a to z), digits (0 to 9), decimal points (.), and hyphens (-).
Path
Limits on a health check path:
Length: 1-200 characters.
/ is the default value and should be the first character.
Regular expressions are not supported. We recommend specifying a fixed URL (static webpage) for the health check.
Supported characters: lowercase letters (a to z), uppercase letters (A to Z), digits (0 to 9), decimal points (.), hyphens (-), underscores (_), forward slashes (/), equal signs (=), and question marks (?).
HTTP request method
HTTP request method of health checks. Valid values: GET (default) and HEAD.
If HEAD is selected, the server will only return the HTTP header information, which can reduce backend overheads and improve request efficiency. The real server must support HEAD.
If GET is selected, the real server must support GET.
HTTP version
HTTP version of the real server.
If the version supported by the real server is HTTP 1.0, then the host field of the request does not need authentication, that is, the check domain does not need to be configured.
If the version supported by the real server is HTTP 1.1, the Host field of the request needs to be verified, that is, the check domain needs to be configured.
Note: When selecting HTTP/1.1 version, if the check domain name is not configured, the real server will return a 400 error code according to the HTTP standard protocol, indicating a health check exception. It is recommended to select http_4xx as the normal status code.
Normal status code
If the status code is the selected one, the real server is considered as alive (healthy). Valid values: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx.
Show advanced options
For more details, refer to Advanced Options.

Configuring Custom Health Check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. In the "Health Check" tab, select the "Custom" check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
Selecting "Custom" indicates the configuration of custom protocol health checks.
Port
This parameter is optional. We recommend not specifying the port unless you need to check a specific port. The real server port will be checked if the port is not specified here.
Input formats
Text and hexadecimal strings are supported.
If Text is selected, the text will be converted into a binary string for sending requests and comparing returned results.
If Hexadecimal is selected, the hexadecimal string will be converted into a binary string for sending requests and comparing returned results.
Request
Custom health check request content is mandatory. For instance, a sample request for probing a DNS service could be: F13E0100000100000000000003777777047465737403636F6D0774656E63656E7403636F6D0000010001.
Return result
When customizing a health check request, it is mandatory to provide the health check response. For instance, the response for a DNS service check could be: F13E.
Show advanced options
For more details, refer to Advanced Options.

UDP Listener

UDP listeners support UDP health checks, which can be conducted by checking ports and running the Ping command.

Configuring Custom Health Check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. In the "Health Check" tab, select the "Custom" check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
If Custom is selected, UDP detection packets are sent from the health check source IP address to a real server to obtain the status of the real server.
Port
This parameter is optional. We recommend not specifying the port unless you need to check a specific port. The real server port will be checked if the port is not specified here.
Input formats
Text and hexadecimal strings are supported.
If Text is selected, the text will be converted into a binary string for sending requests and comparing returned results.
If Hexadecimal is selected, the hexadecimal string will be converted into a binary string for sending requests and comparing returned results.
Request
Customize the health check request content. For example, the check request sample for probing DNS service is: F13E0100000100000000000003777777047465737403636F6D0774656E63656E7403636F6D0000010001.
Return result
When customizing health check requests, it is essential to configure the health check response. For instance, the response for a DNS service check might be: F13E.
Show advanced options
For more details, refer to Advanced Options.

Configuring PING health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the Health Check tab, select PING as the check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
If you select PING, the IP address of the real server will be pinged to obtain the status of the real server.
Show advanced options
For more details, refer to Advanced Options.

TCP SSL Listener

Configuring TCP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the Health Check tab, select TCP as the check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
TCP health checks are conducted if TCP is selected.
Port
The health check port and listening port of a TCP SSL listener are the same.
Show advanced options
For more details, refer to Advanced Options.

Configuring HTTP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the "Health Check" tab, select "HTTP" as the check method.

Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
HTTP health checks are conducted if HTTP is selected.
Port
The health check port and listening port of a TCP SSL listener are the same.
The domains to check.
Limits on a health check domain name:
Length: 1 to 80 characters.
It is the forwarding domain name by default.
Regular expressions are not supported. If your forwarding domain name is a wildcard one, you need to specify a fixed (non-regular) domain name as the health check domain name.
Supported characters: lowercase letters (a to z), digits (0 to 9), decimal points (.), and hyphens (-).
Path
Limits on a health check path:
Length: 1-200 characters.
/ is the default value and should be the first character.
Regular expressions are not supported. We recommend specifying a fixed URL (static webpage) for the health check.
Supported characters: lowercase letters (a to z), uppercase letters (A to Z), digits (0 to 9), decimal points (.), hyphens (-), underscores (_), forward slashes (/), equal signs (=), and question marks (?).
HTTP request method
HTTP request method of health checks. Valid values: GET (default) and HEAD.
If HEAD is selected, the server will only return the HTTP header information, which can reduce backend overheads and improve request efficiency. The real server must support HEAD.
If GET is selected, the real server must support GET.
HTTP version
The HTTP version of the backend service only supports HTTP1.1. The backend service needs to verify the Host field of the request, which means a check domain needs to be configured.
Note: If the check domain is not configured, the backend server will return a 400 error code according to the HTTP standard protocol, indicating a health check anomaly. It is recommended to select the normal status code http_4xx.
Normal status code
If the status code is the selected one, the real server is considered as alive (healthy). Valid values: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx.
Show advanced options
For more details, refer to Advanced Options.

HTTP Listener

Configuring HTTP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the "Health Check" tab, select "HTTP" as the check method.



Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
The domains to check
Limits on a health check domain name:
Length: 1 to 80 characters.
It is the forwarding domain name by default.
Regular expressions are not supported. If your forwarding domain name is a wildcard one, you need to specify a fixed (non-regular) domain name as the health check domain name.
Supported characters: lowercase letters (a to z), digits (0 to 9), decimal points (.), and hyphens (-).
Path
The health check path can be set to the root directory of the real server or a specified URL. Limits on a health check path are as follows:
Length: 1-200 characters.
/ is the default value and should be the first character.
Regular expressions are not supported. We recommend specifying a fixed URL (static webpage) for the health check.
Supported characters: lowercase letters (a to z), uppercase letters (A to Z), digits (0 to 9), decimal points (.), hyphens (-), underscores (_), forward slashes (/), equal signs (=), and question marks (?).
Response timeout
Maximum response timeout period for a health check.
If a real server fails to respond within the timeout period, the real server is considered as abnormal.
Value range: 2-60 seconds.
Check interval
Interval between two health checks.
Value range: 2-300 seconds.
Unhealthy threshold
If a real server has failed the health check for n (a customizable value) consecutive times, the real server is considered unhealthy, and Abnormal is displayed in the console.
Value range of n: 2-10.
Healthy threshold
If a real server has passed the health check for n (a customizable value) consecutive times, the real server is considered healthy, and Healthy is displayed in the console.
Value range of n: 2-10.
HTTP request method
HTTP request method of health checks. Valid values: GET (default) and HEAD.
If HEAD is selected, the server will only return the HTTP header information, which can reduce backend overheads and improve request efficiency. The real server must support HEAD.
If GET is selected, the real server must support GET.
Normal status code
If the status code is the selected one, the real server is considered as alive (healthy). Valid values: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx.

Configuring TCP health check

1. Refer to Preparations and navigate to the "Health Check" tab.
2. On the Health Check tab, select TCP as the check method.



Category
Note
Health check
You can enable or disable health check. We recommend that you enable health check for automatic checks on real servers and removal of abnormal ports.
Health check source IP
The source IP address of health check packets defaults to the 100.64.0.0/10 IP range, which effectively prevents address conflicts. Existing users can choose the VIP of the load balancer as the source IP for health checks, or switch to the 100.64.0.0/10 IP range with a single click using the self-service tool. For more details, please refer to Health Check Source IP Diagnostic Assistant.
Check method
TCP health checks are conducted if TCP is selected.
Show advanced options
For more details, refer to Advanced Options.

HTTPS Listener

Note:
If HTTP is selected as the backend protocol of the HTTPS listener's forwarding rules, HTTP health checks will be conducted; if HTTPS is selected, HTTPS health checks will be conducted.
For configuring health checks for HTTPS listeners, refer to the HTTP Listener health check mentioned above.

Advanced Options

Health Check Configuration
Note
Default value
Response timeout
Maximum response timeout period for a health check.
If a real server fails to respond within the timeout period, the real server is considered as abnormal.
Value range: 2-60 seconds.
2 seconds
Check interval
Interval between two health checks.
Value range: 2-300 seconds.
5 seconds
Unhealthy threshold
If a real server has failed the health check for n (a customizable value) consecutive times, the real server is considered unhealthy, and Abnormal is displayed in the console.
Value range of n: 2-10.
3
Healthy threshold
If a real server has passed the health check for n (a customizable value) consecutive times, the real server is considered healthy, and Healthy is displayed in the console.
Value range of n: 2-10.
3

Documentation