Health Check Configuration

Last updated: 2021-02-02 19:42:21

    When configuring listeners, you can enable health check to obtain the availability information of real servers. For more information on health check, please see Health Check Overview.

    Prerequisites

    1. Create a CLB instance. For more information, please see Creating CLB Instances.
    2. Create a CLB 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 backend CVM instances.
    • HTTP health checks are conducted by sending HTTP requests to obtain the status information of backend CVM instances.
    • Custom protocol health checks are conducted by customizing the input and output content of the application layer protocol to obtain the status information of backend CVM instances.

    Configuring TCP health check

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
    2. In the step of Health Check, select TCP as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolTCP health checks will be conducted if **TCP** is selected.
      PortIt is optional. We recommend not specifying the port unless you need to check specific ones. The real server port will be checked if the port is not specified here.
      Show advanced optionsFor more information, please see Advanced Options.

    Configuring HTTP health check

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
    2. In the step of Health Check, select HTTP as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolHTTP health checks will be conducted if **HTTP** is selected.
      PortIt is optional. We recommend not specifying the port unless you need to check specific ones. The real server port will be checked if the port is not specified here.
      Check domainRequirements on health check domain names:
      • 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 (-).
      PathRequirements on health check paths:
      • Length: 1 to 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 methodHTTP request method of health checks. Options: GET (default method) 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 versionHTTP 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, then the host field of the request needs authentication, that is, the check domain needs to be configured, or the error code 404 will be returned.
      Normal status codeIf the status code is of the selected ones, the real server is considered as alive (healthy). Options: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx. You can select multiple ones.
      Show advanced optionsFor more information, please see Advanced Options.

    Configuring custom protocol health check

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
    2. In the step of Health Check, select HTTP as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolCustom protocol health checks will be conducted if **Custom Protocol** is selected.
      PortIt is optional. We recommend not specifying the port unless you need to check specific ones. The real server port will be checked if the port is not specified here.
      Input formatText 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.
      RequestCustom health check request content.
      Return resultWhen customizing a health check request, you need to enter the health check return result.
      Show advanced optionsFor more information, please 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. In the step of Health Check, select Port as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolIf Port is selected, UDP detection packets will be sent to the backend CVM instance via the VIP (i.e., the IP address used by a CLB instance to provide service to clients), and the IP of the backend CVM instance will be pinged to obtain the backend CVM instance status.
      PortIt is optional. We recommend not specifying the port unless you need to check specific ones. The real server port will be checked if the port is not specified here.
      Input formatText 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.
      RequestIt is optional. Custom health check request content.
      Return resultIt is optional. When customizing a health check request, you need to enter the health check return result.
      Show advanced optionsFor more information, please see Advanced Options.

    Configuring UDP health check - Ping command

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
    2. In the step of Health Check, select PING as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolIf PING is selected, the IP of the backend CVM instance will be pinged to obtain the backend CVM instance status.
      Show advanced optionsFor more information, please 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. In the step of Health Check, select TCP as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolTCP health checks will be conducted if **TCP** is selected.
      PortThe health check port and listening port of TCP SSL listeners are the same.
      Show advanced optionsFor more information, please see Advanced Options.

    Configuring HTTP health check

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
    2. In the step of Health Check, select HTTP as the protocol.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      ProtocolHTTP health checks will be conducted if **HTTP** is selected.
      PortThe health check port and listening port of TCP SSL listeners are the same.
      Check domainRequirements on health check domain names:
      • 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 (-).
      PathRequirements on health check paths:
      • Length: 1 to 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 methodHTTP request method of health checks. Options: GET (default method) 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 versionHTTP version of the real server. Only the HTTP 1.1 is supported. The real server needs to authenticate the host field of the request, that is, the check domain needs to be configured, or the error code 404 will be returned.
      Normal status codeIf the status code is of the selected ones, the real server is considered as alive (healthy). Options: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx. You can select multiple ones.
      Show advanced optionsFor more information, please see Advanced Options.

    HTTP Listener

    Configuring HTTP health check

    1. Configure a listener to the step of Health Check as instructed in Prerequisites.
      ParameterDescription
      Health checkIt can be enabled or disabled. We recommend enabling it for automatic checks on backend CVM instances and removal of abnormal ports.
      Check domainRequirements on health check domain names:
      • 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 (-).
      PathThe health check path can be set as the root directory of the real server or a specified URL. The requirements are as follows:
      • Length: 1 to 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 for a health check.
      • If a real server fails to respond within the timeout, it is considered as abnormal.
      • Value range: 2-60 seconds.
      Check interval
      • Interval between two health checks.
      • Value range: 5-300 seconds.
      Unhealthy threshold
      • If the health check result is failed for n (a customizable value) times, it is considered that the backend CVM instance is unhealthy, and the status displayed in the console is **Abnormal**.
      • Value range: 2-10 times.
      Healthy threshold
      • If the health check result is successful for n (a customizable value) times, it is considered that the backend CVM instance is healthy, and the status displayed in the console is **Healthy**.
      • Value range: 2-10 times.
      HTTP request methodHTTP request method of health checks. Options: GET (default method) 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 codeIf the status code is of the selected ones, the real server is considered as alive (healthy). Options: http_1xx, http_2xx, http_3xx, http_4xx, and http_5xx. You can select multiple ones.

    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, please see HTTP Listener.

    Advanced Options

    Health Check Configuration Description Default Value
    Response timeout
  • Maximum response timeout for a health check.
  • If a real server fails to respond within the timeout, it is considered as abnormal.
  • Value range: 2-60 seconds.
  • 2 seconds
    Check interval
  • Interval between two health checks.
  • Value range: 5-300 seconds.
  • 5 seconds
    Unhealthy threshold
  • If the health check result is failed for n (a customizable value) times, it is considered that the backend CVM instance is unhealthy, and the status displayed in the console is Abnormal.
  • Value range: 2-10 times.
  • 3 times
    Healthy threshold
  • If the health check result is successful for n (a customizable value) times, it is considered that the backend CVM instance is healthy, and the status displayed in the console is Healthy.
  • Value range: 2-10 times.
  • 3 times

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help