Skip to content
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

[Feature] TiDB nodes assignment algorithm when receiving a request #5

Open
renajin opened this issue Aug 5, 2021 · 1 comment
Open

Comments

@renajin
Copy link
Contributor

renajin commented Aug 5, 2021

Feature Request

Is your feature request related to a problem? Please describe:
How does a load balancer work according to middleware?At any time, the operating load on each node should be balanced, so we need strategy to determine which tidb executes current sql in a short time(time must be a constant), we can’t waste too much time making decisions.

Describe the feature you'd like:
An algorithm is used to enable us to get an accurate decision for select nodes.

Describe alternatives you've considered:
The result relying solely on sql cost calculation is not very accurate, cpu should also be taken into consideration. Dynamically adjust this strategy throughout the process. @spxcmss

Teachability, Documentation, Adoption, Migration Strategy:

@spxcmss
Copy link
Contributor

spxcmss commented Aug 6, 2021

Currently, the SWRR(Smooth Weighted Round-Robin) algorithm is considered to be used in tidb nodes‘s allocation, and the weights are set according to the cpus of different TIDB nodes. In the future, the cost and TIDB CPU usage and some other factors will be taken into comprehensive consideration as the weight value. Therefore, when selecting back-end TIDB nodes, the weight can be allocated according to dynamic changes to ensure that the real load of each back-end TIDB node is balanced as much as possible.

@spxcmss spxcmss changed the title [Feature] Connection pool algorithm [Feature] TiDB nodes assignment algorithm when receiving a request Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants