tzssangglass commented on issue #7934: URL: https://github.com/apache/apisix/issues/7934#issuecomment-1250470002
log 1: ``` 2022/09/16 11:35:37 [warn] 44#44: *1891665 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix-edge-gateway/upstreams/xxx-extractor) unhealthy TIMEOUT increment (1/3) for 'xxx.test.com(192.168.3.94:8106)', context: ngx.timer, client: 105.99.84.230, server: 0.0.0.0:8080 ``` log 2: ``` 2022/09/16 11:35:37 [warn] 45#45: *1887001 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix-edge-gateway/upstreams/xxx-extractor) healthy SUCCESS increment (2/3) for 'xxx.test.com(192.168.3.94:8106)' while logging request, client: 31.4.158.18, server: _, request: "POST /xxx HTTP/1.1", upstream: "http://192.168.3.94:8106//xxx", host: "xxx.test.com" ``` These two logs make me think there may be an error in your health check config. ``` "checks": { "active": { "timeout": 3, "http_path": "/", "healthy": { "interval": 5, "successes": 2 }, "unhealthy": { "interval": 5, "http_failures": 3 }, "req_headers": ["User-Agent: curl/7.29.0"] }, "passive": { "healthy": { "http_statuses": [200, 201], "successes": 3 }, "unhealthy": { "http_statuses": [500, 502, 503, 504], "http_failures": 3, "tcp_failures": 3 } } } ``` For active health check, the `active.unhealthy.http_statuses` property you use is the default value, the default value is: `default = {429, 404, 500, 501, 502, 503, 504, 505}`. This means that whenever one of the above http statuses is returned by upstream, such as 404, then it will trigger log 1(active health check). When the request is proxied to 192.168.3.94:8106 and the upstream http status is [200, 201], then log 2 is triggered(passive health check). you can use `curl http://192.168.3.94:8106/` inside APISIX Pod to simulate the results of active health check. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
