-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
help request: 负载策略采用chash时,如果没有key,默认是根据remote_addr hash,可是客户端ip比较固定,能不能如果没key,就round-robin轮询。 #11895
Comments
When the load strategy uses chash, if there is no key, the default is based on remote_addr hash, but the client IP is relatively fixed(all traffic will visit a single node). If there is no key, can round-robin polling be performed? |
It's reasonable to use a default key to chash then choose the upstream (It would be much more complex if use a fallback strategy) I think you should check what key can be performed like RR, or just use RR directly. |
Currently, this requirement is achieved by modifying the code. If the request does not have a key, the time hash is used by default: |
you can test the vars of nginx here https://nginx.org/en/docs/varindex.html.
|
Can this be done without modifying the code, but still meet my needs? If the request header has a key, use the key hash. If there is no key, the default is based on the time key (the effect is similar to round-robin). |
I don't think so.you can clone the project, modify the code and generate a patch file, and patch it after installed (or during build image). |
Description
负载策略采用chash时,如果没有key,默认是根据remote_addr hash,可是客户端ip比较固定,能不能如果没key,就round-robin轮询。
Environment
apisix version
): 3.8The text was updated successfully, but these errors were encountered: