Service Manager: Health Check
Applies To: LOAD BALANCER
The "Health Check" section of the Service Manager configuration enables and configures the health check that the Load Balancer can perform on the active servers that have been added to the service. Should any servers in the service fail the health check the Load Balancer will no longer send them incoming connections. However, the Load Balancer will continue to perform health checks on the problem server as long as it is health checks are enabled and the Load Balancer will resume sending it connections when it passes a health check.
The following is an image of the Health Check configuration section of the Service Manager, followed by a table with each of the fields explained in more detail;
Field | Description |
---|---|
Type | This drop down is where the type of connection is selected. The options are; connect or negotiate. Please see the following "Connections Type" section below for explanations of these types. |
Port | This port is the port that the Load Balancer will connect to on the servers in the cluster in order to perform the health check. Unless there is a specific reason not to then this should be configured to be the same as the Target port in the Service Definition section. |
Timeout | This is the amount of time that the Load Balancer will wait when performing a health check before it classifies the server as unavailable. For example, if the time out is set to 3 seconds then the server will open a connection to the server and wait 3 seconds for a response. If it does not get a response in less than 3 seconds it will terminate the health check and mark the server as unavailable. Setting this value to zero will mean that the server expects an immediate response and anything else will classify as offline. |
Request | This field will only be available when the negotiate check is selected and is explained in detail in the negotiate section below. |
Check String | This field will only be available when the negotiate check is selected and is explained in detail in the negotiate section below. It should be used to specify the String (Text) you want to check on the page |
Email Address for Alerts | This is the email address that will be notified when a server fails a health check. |
Update | New configuration will only be saved when this button is clicked. The Update button will save the configuration. It will not push the new configuration live to the Load Balancer. In order to push all new saved configuration (that is any new configuration for any aspect of the service) the Update Now button must be selected from the first page of the Service Manager section. |
Connection Types
The Load Balancer has the capability to perform one of two available checks on the members of the servers in the service by connecting to them and assessing the outcome in two different way. The two available connection types are connect and negotiate.
Connect
This is the simpler of the two tests. The server will simple initiate a connection on the configured port and classify the server as online and working if there is a correct response from the server before the expiry of the configured timeout period.
This health check is the same as running something like the following by hand to against a webserver:
netcat -v www.memset.com 80
www.memset.com [37.128.131.171] 80 (http) open
where a connection is requested on port 80 (line one) and a successful response is obtained (line 2). Once the load balancer receives the correct response the server has passed the health check.
Negotiate
The Load Balancer performs this health check by requesting a file from the server and checking if that file contains a specific piece of text.
The file and the text are the parameters that are configured in the Request and Check string fields, with the Request being the name of the file and Check String being the text to search for.
A typical example of a file and a string are the home page, typically index.php and a word that appears on the home page, in the example below this is "Can you see me?". The fields for this example configuration would look like the following:
A second common configuration for this health check is where a non-public facing (i.e. not viewable by the public) file is specified. This file is created by the server periodically after preforming an internal check and writing either "online" or "offline" to the file. The Load Balancer will then check for that word and only classify the server as active if the file contains that word.
Applying Configuration Changes
Configuring the Load Balancer requires some moderately time consuming work. For this reason it is not desirable that each configuration change goes live immediately as the proper functioning of the cluster depends on all parts being correctly configured.
It is for this reason that the Update button will only save the new configuration but will not put it live. New configuration will only go live on the Load Balancer when the Update Now butting is clicked. This button is found on the first page of the Service Manager section but only when there is saved but not yet live configuration.