tencent cloud

Feedback

Configuring Health Check

Last updated: 2024-01-04 20:51:00
    When configuring listeners, you can enable health check to obtain the availability information of real servers. For more information about health check, see Health Check Overview.

    Restrictions

    TCP listeners for IPv6 Cloud Load Balancer (CLB) instances do not support HTTP health checks or custom protocol health checks.
    UDP listeners for IPv6 CLB instances do not support port-based health checks.

    Prerequisites

    1. You have created a CLB instance. For more information, see Creating CLB Instances.
    2. You have created 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, namely the layer-4 TCP health check, layer-7 HTTP health check, and custom protocol health check.
    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. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select TCP for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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 information, see Advanced Options.

    Configuring HTTP health check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health Check tab, select HTTP as the protocol.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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.
    Check domain
    Limits on a health check domain name:
    Length: 1 to 80 characters.
    The default value is the forwarding domain name.
    Regular expressions are not supported. If your forwarding domain name is a wildcard domain name, 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 to 200 characters.
    A health check path must start with /. The default value is /.
    Regular expressions are not supported. You are advised to specify a fixed URL (static webpage) for health checks.
    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. This reduces backend overheads and improves request efficiency. The real server must support the HEAD method.
    If GET is selected, the real server must support the GET method.
    HTTP version
    HTTP version of the real server.
    If the real server supports HTTP 1.0, then the Host field of a request does not need authentication, that is, the health check domain name does not need to be configured.
    If the real server supports HTTP 1.1, the Host field of a request needs authentication, that is, the health check domain name needs to be configured.
    Note: If you select HTTP/1.1 but do not specify the health check domain name, the real server returns the 400 error code, which indicates a health check exception. You are advised to select http_4xx for 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 information, see Advanced Options.

    Configuring custom protocol health check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select Custom for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    Check method
    Custom protocol health checks are conducted if Custom is selected. This is applicable to non-HTTP protocols in TCP.
    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.
    Format
    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
    This parameter is the custom health check request content, which is required, such as F13E0100000100000000000003777777047465737403636F6D0774656E63656E7403636F6D0000010001 for the DNS service health check.
    Return result
    When customizing the health check request, you must enter the returned health check result, such as F13E for DNS service health check.
    Show advanced options
    For more information, see Advanced Options.

    UDP Listener

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

    Configuring UDP health check - port check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select Custom for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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.
    Format
    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
    This is the custom health check request content, such as F13E0100000100000000000003777777047465737403636F6D0774656E63656E7403636F6D0000010001 for the DNS service health check.
    Return result
    When customizing the health check request, you must configure the returned health check result, such as F13E for the DNS service health check.
    Show advanced options
    For more information, see Advanced Options.

    Configuring UDP health check - Ping command

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select PING for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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 information, see Advanced Options.

    TCP SSL Listener

    Configuring TCP health check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select TCP for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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 information, see Advanced Options.

    Configuring HTTP health check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select HTTP for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    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.
    Check domain
    Limits on a health check domain name:
    Length: 1 to 80 characters.
    The default value is the forwarding domain name.
    Regular expressions are not supported. If your forwarding domain name is a wildcard domain name, 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 to 200 characters.
    A health check path must start with /. The default value is /.
    Regular expressions are not supported. You are advised to specify a fixed URL (static webpage) for health checks.
    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. This reduces backend overheads and improves request efficiency. The real server must support the HEAD method.
    If GET is selected, the real server must support the GET method.
    HTTP version
    HTTP version of the real server. Only HTTP 1.1 is supported. The real server needs to verify the Host field of the request, that is, the check domain name needs to be configured.
    Note: If you do not specify the check domain name, the real server returns the 400 error code, which indicates a health check exception. We recommend that you select http_4xx for 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 information, see Advanced Options.

    HTTP Listener

    Configuring HTTP health check

    1. Configure a listener to the step of Health check as instructed in Prerequisites.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    Check domain
    Limits on a health check domain name:
    Length: 1 to 80 characters.
    The default value is the forwarding domain name.
    Regular expressions are not supported. If your forwarding domain name is a wildcard domain name, 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 to 200 characters.
    A health check path must start with /. The default value is /.
    Regular expressions are not supported. You are advised to specify a fixed URL (static webpage) for health checks.
    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. This reduces backend overheads and improves request efficiency. The real server must support the HEAD method.
    If GET is selected, the real server must support the GET method.
    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. Configure a listener to the step of Health check as instructed in Prerequisites.
    2. On the Health check tab, select TCP for Check method.
    
    Parameter
    Description
    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. The default value is the 100.64.0.0/10 IP range. By using this IP range, you can solve the container loopback problem in TKE scenarios. Existing users can choose to use a CLB VIP as the health care source IP address.
    Check method
    TCP health checks are conducted if TCP is selected.
    Show advanced options
    For more information, see 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 the health check configuration of HTTPS listeners, see HTTP Listener.

    Advanced Options

    Option
    Description
    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 times
    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 times

    References

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support