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

Improve Memory Management #17479

Open
4 tasks
zz-jason opened this issue May 28, 2020 · 1 comment
Open
4 tasks

Improve Memory Management #17479

zz-jason opened this issue May 28, 2020 · 1 comment
Assignees
Labels
epic/memory-management feature/accepted This feature request is accepted by product managers priority/P0 The issue has P0 priority. sig/execution SIG execution type/feature-request Categorizes issue or PR as related to a new feature.
Milestone

Comments

@zz-jason
Copy link
Member

zz-jason commented May 28, 2020

Description

Since TiDB 2.1, we have supported memory tracking to track the memory usage of a query. In the recent releases, we have supported canceling a query which consumes too much memory or spilling the intermediate result to disk for a query to reduce the memory usage.

But there's still lots of improvements related to memory management, for example:

  • Reduce memory usage for a query without spilling disk. A goal of this can be set to pass all the TPC-H (SF=10) queries without spilling disk in a 16 GB environment.
  • Optimize memory usages for internal components, like statistics cache(reduce memory consumption of stats data #16572), table reader, coprocessor client.
  • Make more operators be able to spill intermediate results to disk: Table Readers, Hash Aggregate, Insert/Update/Delete/Replace, etc.
  • Implement instance-level memory control, which needs careful design.
  • 10GB transaction memory usage optimization

See issues labeled with epic/memory-management for details.

P0 Task List

Category

Performance

Value

  • Value Score: 5

Lots of users have reported memory issues, such as can not cancel the query consumes too much memory, which is caused by the memory of some components are tracked. (priority/P1)

In the DBaaS environment, the memory usually is not that rich, reducing the memory usage without spilling disk or enable more operators to spill disk can greatly improve the usability. (priority/P1)

Usually, there's a lot of tables on a cluster(more than 1 million tables), reducing the statistics cache can heavily reduce the overall memory consumption of the tidb process, which further reduces the OOM risk. (priority/P0)

Workload Estimation

Workload contains coding, documenting, and testing.
1 Point for 1 Person/Work Day

  • 150 Points

Time

GanttStart: 2020-07-01
GanttDue: 2020-09-30
GanttProgress: 50%

@zz-jason zz-jason added type/feature-request Categorizes issue or PR as related to a new feature. epic/memory-management labels May 28, 2020
@scsldb scsldb added the priority/P0 The issue has P0 priority. label Jun 12, 2020
@scsldb scsldb added this to the v5.0-alpha milestone Jun 12, 2020
@SunRunAway SunRunAway added the sig/execution SIG execution label Jun 17, 2020
@SunRunAway SunRunAway assigned XuHuaiyu and unassigned SunRunAway Jun 23, 2020
@jackysp
Copy link
Member

jackysp commented Jul 3, 2020

#18308

@zz-jason zz-jason changed the title improve memory management Improve Memory Management Jul 14, 2020
@scsldb scsldb modified the milestones: v5.0.0-alpha, v5.0.0-beta Jul 15, 2020
@zz-jason zz-jason added the feature/accepted This feature request is accepted by product managers label Jul 29, 2020
@jebter jebter modified the milestones: v5.0.0-beta, v5.0.0-rc Jan 7, 2021
@jebter jebter modified the milestones: v5.0.0-rc, v5.0.0 Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/memory-management feature/accepted This feature request is accepted by product managers priority/P0 The issue has P0 priority. sig/execution SIG execution type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

6 participants