Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

about health check #12552

Unanswered
Lewisyixin asked this question in Q&A
Discussion options

By default, the health check of apisix will be triggered only after a request is made. However, the health check indicator is a very important indicator of the gateway. For example, it is necessary to make some big charts based on the health status of all server groups to see which nodes are abnormal, rather than only knowing after a request. So I would like to ask if anyone has some mature modification experience in this area, such as automatically turning on health check after configuring the server group.

You must be logged in to vote

Replies: 1 comment

Comment options

You can enable automatic (proactive) health checks in APISIX by configuring active health checks in your upstream configuration. By default, APISIX uses passive health checks, which only update node health after a request. However, with active health checks, APISIX will periodically probe upstream nodes on a schedule, independent of traffic, which is ideal for real-time dashboards and monitoring abnormal nodes.

To set this up, add a checks.active section to your upstream definition. For example, for HTTP upstreams:

"checks": {
 "active": {
 "type": "http",
 "http_path": "/",
 "healthy": {
 "interval": 2,
 "successes": 1
 },
 "unhealthy": {
 "interval": 1,
 "timeouts": 3
 }
 }
}

For gRPC upstreams, use:

healthCheck:
 active:
 type: grpc
 healthy:
 successes: 2
 unhealthy:
 http_failures: 2
 timeout: 5
 interval: 30

Once configured, APISIX will automatically and continuously check the health of all nodes in the server group, and you can visualize this data using monitoring tools like Prometheus. No code modification is needed—just configuration. It's also recommended to combine both active and passive health checks for robust monitoring in production environments. More details and examples are available in the official documentation and community threads.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other Chat with Dosu Join Discord Share on X

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /