Open MonkeyDLufy opened 9 months ago
Hi @MonkeyDLufy please check the docs here if this is what you are looking for https://apisix.apache.org/docs/apisix/next/tutorials/health-check/#active-check
Are you having any specific problems in configuring it?
Hi @MonkeyDLufy please check the docs here if this is what you are looking for https://apisix.apache.org/docs/apisix/next/tutorials/health-check/#active-check
Are you having any specific problems in configuring it?
curl http://127.0.0.1:9180/apisix/admin/stream_routes/1 -X PUT -d ' { "server_port": 9100, "upstream": { "nodes": { "10.178.178.178:80": 1, "10.187.187.187:80": 1 }, "type": "roundrobin", "scheme": "tcp", "checks": { "active": { "type": "tcp", "unhealthy": { "interval": 1, "tcp_failures": 3 }, "healthy": { "interval": 2, "successes": 1 } } } } }'
This is my config. I used tcpdump to capture packets and observed that the probe packets for active health checks were not sent. Among the two IP addresses in the example, one of them is not reachable. I expected it to be circuit broken and not receive any traffic, but apisix still sent traffic to it until the connection timed out and then retried with another available node.
AFAIK, healthchek for TCP upstreams isn't supported.
Thank you for helping me confirm this information. I hope that Apisix can provide support for this feature in the future
@shreemaan-abhishek I can handle this issue, can you assign this to me?
I think health check for UDP upstreams is also necessary.
Hi I worked on this issue. Stream proxy health check works fine now. Here is my branch. https://github.com/fatihusta/apisix/tree/stream-proxy-healthcheck-support @shreemaan-abhishek could you please check my branch. Is this right way to do this or not? Please give me advice. I will send the PR after your review.
@fatihusta it would be much better if you write your proposal first.
@fatihusta it would be much better if you write your proposal first.
I re-imlemented this PR. Also I added new control API functions. Control API is in http context. upstream-healthcheck-stream shared-dict is in stream context. There is no access between http and stream context for shared-dicts. So I added unix domain socket in stream context. After that I access the unix socket from control API. Is this right way to do this or not?
Description
As a tcp server user, I want to use apisix for proxy tcp servers. So I need the stream upstream can support active health check. But I try and found that, the active health check seem only support for http, it can't work on tcp.