edit-icon download-icon

Manage excessive health check logs

Last Updated: Apr 28, 2018

Server Load Balancer (SLB) automatically stores health check logs for the most recent three days. The quantity of health check logs may present concerns to your Operations & Maintenance (O&M). You can reduce the number of health check logs or prevent the logs from generating in certain scenarios by using the following methods.

Note: If the number of health check logs is reduced, you may be unable to identify problems that occurred. Evaluate the risks and configure as necessary.

Filter HEAD requests

HTTP health check uses HEAD method by default, filter out all HEAD requests, you can get the access logs.

Adjust the health check frequency

You can increase the health check intervals to reduce the health check frequency and the number of logs generated.

Potential risks

If you increase the health check intervals, and a backend ECS instance fails, it may take a longer time for SLB to detect the faulty backend ECS instance.

Procedure

  1. Log on the Server Load Balancer console.

  2. On the Instances page, find the target SLB instance and click Manage.

    Manage

  3. Click Listeners. Find the target listener and click Configure.

    Configure

  4. Click Next in the Listener Configuration dialog box to configure the health check.

  5. Adjust the Health Check Interval, in the range of 1-50 seconds. When you set a longer interval, the health check frequency becomes lower and the number of logs generated by backend ECS instances are reduced accordingly. Change the health check interval as necessary.

    Interval

  6. Click Confirm to complete the modification.

Disable the health check of Layer-7 SLB

For Layer-7 (HTTP/HTTPS) SLB, the health check is achieved by HTTP Head requests. Application logs of backend ECS instances record health check requests and a large amount of logs may be generated.

Potential risks

After you disable the health check of a Layer-7 SLB instance, SLB does not do health check on backend ECS instances. In this situation, if one backend ECS instance fails, the requests cannot be forwarded to other normal backend ECS instances.

Procedure

  1. Log on to the Server Load Balancer console.

  2. On the Instances page, find the target SLB instance and click Manage.

    Manage

  3. Click Listeners. Find the target listener and click Configure.

    Configure

  4. Click Next in the Listener Configuration dialog box to configure the health check.

  5. Disable Health Check.

    Disable

  6. Click Confirm to complete the modification.

Change Layer-7 SLB to Layer-4 SLB

The health check of a Layer-4 SLB instance is achieved by using the three-way handshake of TCP and does not generate application logs. If possible, you can change the Layer-7 SLB to the Layer-4 SLB to reduce the number of the application logs.

Potential risks

After you change the Layer-7 SLB to the Layer-4 SLB, SLB checks only the status of the listener port, but does not check the HTTP status. SLB cannot detect HTTP application exceptions in real time.

Procedure

  1. Log on to the Server Load Balancer console.

  2. On the Instances page, find the target SLB instance and click Manage.

    Manage

  3. Click Listeners. Find the target listener and click Configure.

    Configure

  4. Click Next in the Listener Configuration dialog box to configure the health check.

  5. Change the Health Check Method to TCP.

    Modify

  6. Click Confirm to complete the modification.

Disable application logs on the health check page

Configure a health check site that is independent from the service site. Disable application logs of the health check page to reduce the number of health check logs. For example, if the service site is abc.123.com, use test.123.com as the health check site and disable logs of test.123.com.

Potential risks

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

Procedure

  1. Create a new health check site and health check page on the backend ECS instance and disable logs. The following steps take Nginx as the example.

  2. Log on to the Server Load Balancer console.

  3. On the Instances page, find the target SLB instance and click Manage.

    manage

  4. Click Listeners. Find the target listener and click Configure.

    Configure

  5. Click Next in the Listener Configuration dialog box to configure the health check.

  6. Enter the domain name of the health check site in Domain Name and the relative path of the health check page in Health Check Path.

    TCP

  7. Click Confirm to complete the modification.

Thank you! We've received your feedback.