-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discuss: endpoint choose issue #101
Comments
Looks great to me. It just how much could we benefit from it. |
related PR: #96 |
get it , assigned to me. |
Hi folks,
|
@tzssangglass |
@tzssangglass I think you can take a look at this plugin[api-breaker]: https://github.com/apache/apisix/blob/master/apisix/plugins/api-breaker.lua#L168 it should be useful for you |
got, let me study it |
the |
I am busy during this period, so this work will be slow. |
@tzssangglass I think we can avoid using the The others are LGTM . ^_^ |
got |
Background
Currently,
lua-resty-etcd
supports cluster mode, but the way of implementation is too simple: each connection changes to the next endpoint.Using this mechanism, it can work well under normal circumstances, but once an api or an instance has a problem, the consequences will be unpredictable.
Issues with the current solution
In cluster mode, when an instance is down, there is no way to skip the down instance, and it will still be polled every time.
When all instances of a certain api fail (such as auth api), it will cause crazy retries, which may eventually overwhelm the ETCD cluster.
Suggested changes
Implement a health check mechanism, no active check is required, only passive check is required, that is, it is recorded when the connection fails.
There is no need to poll all instances, and only switch instances when the connection fails.
In a certain period of time, if there are n consecutive failures, the instance is considered unhealthy, and the instance will not be connected for a certain period of time in the future (the duration and times can be configured).
related issue: apache/apisix#2899
what do you think ?
Thanks.
The text was updated successfully, but these errors were encountered: