Home/Server & Website Managed Operations/Special Handling of Logs for Alibaba Cloud SLB Health Checks
Server & Website Managed Operations

Special Handling of Logs for Alibaba Cloud SLB Health Checks

SLB health checks occur frequently, with several requests per second. Over time, this generates a large volume of web service logs. This not only consumes storage space but also impacts disk performance. In addition to the official recommendation to reduce the health check frequency, there are some alternative approaches.

1. If you are not strict about using HTTP or TCP forwarding protocols, switch to TCP forwarding and disable HTTP health checks.

Advantage: Convenient; simply configure it via the console.

Disadvantage: You lose the ability to detect application-layer anomalies.

2. Create a separate virtual host without logging enabled for health checks. Use different ports or hostnames to ensure health check requests do not hit your main business virtual hosts.

Advantage: Application-level anomalies can still be detected by health checks.

Disadvantage: Virtual host-level anomalies will no longer be detected by SLB health checks.

3. Use rules in web servers like Nginx to configure separate logging for health check URIs. For example, with Nginx:

In the following configuration, define a meaningless URI such as check.html for health checks. Requests to this file will not be logged.

location ~ /check.html
{
access_log off; # Disable logging
# access_log /var/log/nginx/access/health_check.log main; or configure health check logs to a separate file
}

Advantage: Health check logs can be configured flexibly without losing any health check functionality.

FREE CHECKUP

Free server checkup

We will send a problem checklist and remediation advice within one business day — no obligation to engage.

135 410 16684
Weekdays Mon – Fri 10:00 – 22:00 (UTC+8) · 7×24 emergency response
Call now
CONTACT

Contact Us

How can we help?

* Required