[ResourceLimit] Limit CPU resource usage of each query#6443
[ResourceLimit] Limit CPU resource usage of each query#6443yangzhg merged 1 commit intoapache:masterfrom
Conversation
1242231 to
d61d440
Compare
| // sql block rules | ||
| result.add(Lists.newArrayList(PROP_SQL_BLOCK_RULES, commonProperties.getSqlBlockRules())); | ||
|
|
||
| // sql block rules |
| } | ||
|
|
||
| struct TResourceLimit { | ||
| 1: optional i32 cpu_limit |
There was a problem hiding this comment.
Maybe It is better to use a name such as scannode_max_parallelism xxx
There was a problem hiding this comment.
I want to decouple the struct with the certain implementation.
So that we can extend this feature in future.
There was a problem hiding this comment.
maybe use max_concurrency is better
There was a problem hiding this comment.
maybe use max_concurrency is better
In fact, what I want to express is that this value is not bound to any implementation. It does not represent the number of threads or the number of concurrency, but a relative value.
It is more like a priority concept, or similar to the concept of weight in cgroups.
In this way, we can continue to use this parameter when we implement more refined resource isolation in the future.
de3cfd0 to
9c6bfd6
Compare
add doc fix review fix ut
9c6bfd6 to
db32068
Compare
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Proposed changes
Details see #6442
I add a new session variable "cpu_resource_limit" and a new user property "cpu_resource_limit".
The default value is -1, which is unlimited. And user can set limit for a single query in a session,
or set the limit for a certain user, so that all queries the user execute will use this limit.
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...