The log management of Server Load Balancer can automatically save health check logs generated within three days. If there are too many health check logs that may affect your maintenance, you can configure to reduce health check logs or prevent the logs from being generated in certain scenarios through the following methods.

Note After reducing health check logs, you may be unable to identify problems occurred during the running of Server Load Balancer instance in a timely manner. So configure it according to the actual situation.

Get access logs

HTTP health check uses the head request method by default (the get method will be used later), therefore, you can obtain access logs by filtering out head requests.

Adjust health check frequency

You can increase the interval between two health checks to reduce the health check frequency and generated logs.

Potential risks

After you increase the interval, if the backend ECS instance fails, the time needed for Server Load Balancer to detect the faulty ECS instance is increased accordingly.

Procedure

  1. Log on to the SLB console.
  2. On the Server Load Balancer page, click the ID of the target SLB instance. Then find the target listener and click Configure.
  3. On the Configure Listener page, click Next to configure health check.
  4. Adjust the Health Check Interval in the range of 1 to 50 seconds. The greater the interval, the lower the health check frequency and the fewer logs generated by the backend server. Modify according to your actual situation.
  5. Click OK.

Close Layer-7 health check

When Layer-7 (HTTP/HTTPS) Server Load Balancer is used, the health check is implemented by HTTP head requests. Application logs of the backend ECS instance record the health check requests, leading to a large amount of logs.

Potential risks

After you close HTTP/HTTPS health check, Server Load Balancer does not check backend servers. Once a backend server fails, the traffic cannot be automatically forwarded to other normal backend servers.

Procedure

  1. Log on to the SLB console.
  2. On the Server Load Balancer page, click the ID of the target SLB instance. Then find the target listener and click Configure.
  3. On the Configure Listener page, click Next to configure health check.
  4. Close Enable Health Check.
  5. Click OK.

Change Layer-7 Server Load Balancer to Layer-4 Server Load Balancer

Layer-4 health check only uses TCP three-way handshakes and generates no application logs. If your service can be changed to Layer-4 Server Load Balancer, this method can reduce generated application logs.

Potential risks

After you change the HTTP/HTTPS Server Load Balancer to the TCP Server Load Balancer, Server Load Balancer checks only the status of the listener port and does not check the HTTP status. In this way, Server Load Balancer cannot detect the exceptions occurred to HTTP applications in real time.

Procedure

  1. Log on to the SLB console.
  2. On the Server Load Balancer page, click the ID of the target SLB instance. Then find the target listener and click Configure.
  3. On the Configure Listener page, click Next to configure health check.
  4. Change the Health Check Protocol to TCP.
  5. Click OK.

Disable application logs on the health check page

Configure the health check site that is independent from the service site, and disable the application logs of the health check page, then the number of health check logs can be reduced. For example, the service site is abc. 123.com, use test. 123.com as the health check site and disable logging of test. 123.com.

Potential risks

If the health check site is running normally, but the service site encounters an exception, the health check cannot detect the exceptions of the service site.

Procedure

  1. Create a new health check site and health check page on the backend server and disable logging. This tutorial takes ngix as an example.

  2. Log on to the SLB console.
  3. On the Server Load Balancer page, click the ID of the target SLB instance. Then find the target listener and click Configure.
  4. On the Configure Listener page, click Next to configure health check.
  5. Enter the domain name of the health check site in Health Check Domain Name and enter the path of the health check page in Health Check Path.
  6. Click OK.