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] judge whether a SQL is AP or TP #2

Open
renajin opened this issue Aug 5, 2021 · 3 comments
Open

[Feature] judge whether a SQL is AP or TP #2

renajin opened this issue Aug 5, 2021 · 3 comments

Comments

@renajin
Copy link
Contributor

renajin commented Aug 5, 2021

Feature Request

Is your feature request related to a problem? Please describe:
We have two computing pools to handle AP and TP requests respectively, TP sql can be processed by AP pool, but not vice versa. So how to judge whether a SQL is AP or TP? How do these two pools manage scaling nodes?

Describe the feature you'd like:

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@renajin
Copy link
Contributor Author

renajin commented Aug 5, 2021

How do these two pools manage scaling nodes?

@shenzhengcmss
Copy link
Contributor

shenzhengcmss commented Aug 6, 2021

TP support switching tidb-server between 0.5 cpu core 1G memory、1 core 2 G、2 core 4G、4 core 8G,0.5 cpu use 0.5 * 100 pool of connection,
1 cpu use 1 * 100 pool of connection ,........, 4 core use 4 * 100 pool of connection,AP tidb-server only support 4 core 8G and 8 core 16G,4 core 8G use pool of connection, 8 core 16G apply for big cost sql

@spxcmss
Copy link
Contributor

spxcmss commented Aug 6, 2021

we differentiate AP or TP request according to sql cost calculated by the optimizer, and we will add more rules and strategies to distinguish SQL more accurately in the future. The SQL is forwarded to three different types of TIDB nodes based on the cost, ensuring that AP and TP SQL do not interfere with each other. Backend TIDB nodes are classified into three types :

  1. TP type: Proxy module forwards TP SQL to the node of this type.
  2. AP type: Proxy module forwards AP SQL with low cost (including SQL misjudged as TP type of AP) to nodes of this type.
  3. large cost type: Processing particularly complex SQL, when the cost of SQL is very high, then will temporarily start a large size of TIDB node to process this SQL, and after the SQL processing, large size of TIDB node will be immediately released.

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

3 participants