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

Tracking Issue of Background Resource Control #44517

Closed
13 of 14 tasks
glorv opened this issue Jun 8, 2023 · 0 comments
Closed
13 of 14 tasks

Tracking Issue of Background Resource Control #44517

glorv opened this issue Jun 8, 2023 · 0 comments
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@glorv
Copy link
Contributor

glorv commented Jun 8, 2023

Feature Description

In order to control the background tasks' resource usage, we plan to add an extra quota resource limit layer to the background jobs. That is, for foreground jobs, on the tikv side, the scheduler only controls the enqueue/deque order. Thus, running tasks is not under control, and tasks from different routine(thread pool) are not controlled either. But for the background jobs, the extra quota limiter layer can ensure the running tasks(in different pools) can be preempted early enough, so their resource usage can appeal to the setting:

  • Control the resource usage of all background tasks by the Resource Limiter : The rate limit is dynamically adjusted to the value via the formula TiKVTotalRUCapcity - sum(RUCostRateOfForgroundTasks), with a fine-grained adjusting duration, we can ensure the foreground tasks' RU is always enough(or near the system's maximum if the foreground requirement reaches the maximum quota), so the background tasks' impact on foregroup tasks should be very low; on the other hand, when the foreground resource consumption is low, the controller should increase the limit threshold, so background jobs can take advantage of the remaining resources.
  • The local resource manager will statics RU consumption of background jobs via the Resource Limiter : We will do statistics and report the resource consumption to the global resource manager. In the first stage, we only do statistics globally but control it locally.
  • Feedback mechanism: It's better to give feedback on how fast the limiter layer executes tasks on tikv to the upper layer like tidb, so that the upper layer task framework can adjust the number of tasks.

Task Breakdown

Management

TiKV Resource Limiter tikv/tikv#14900

@glorv glorv added the type/enhancement The issue or PR belongs to an enhancement. label Jun 8, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jul 13, 2023
@nolouch nolouch closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants