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

feat: update default size of bgworkers, add hbworkers #4129

Merged
merged 8 commits into from
Jun 18, 2024

Conversation

sunng87
Copy link
Member

@sunng87 sunng87 commented Jun 10, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#4128

What's changed and what's your intention?

This patch changes default bg_worker runtime to half of cpu_num, to avoid cpu-intensive tasks to fill up all compute resources

It also use dedicated runtime to host heartbeat tasks, which is of higher priority.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

@sunng87 sunng87 requested a review from a team as a code owner June 10, 2024 20:36
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Jun 10, 2024
@sunng87
Copy link
Member Author

sunng87 commented Jun 10, 2024

It seems we need to update sample configuration as well. But I just need to make sure this looks good to you before moving on.

Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a workaround. We might need to implement some other approaches to limit the resources used by background tasks.

src/common/runtime/src/global.rs Outdated Show resolved Hide resolved
@evenyag
Copy link
Contributor

evenyag commented Jun 11, 2024

There is an issue related to the config test: #4126

Options related to the number of cores and the host memory are unstable in tests. You might encounter the same problem.

@sunng87 sunng87 linked an issue Jun 14, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jun 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.60%. Comparing base (d8b51cf) to head (f969a46).
Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4129      +/-   ##
==========================================
- Coverage   85.40%   84.60%   -0.80%     
==========================================
  Files         994     1022      +28     
  Lines      174087   179017    +4930     
==========================================
+ Hits       148677   151466    +2789     
- Misses      25410    27551    +2141     

@sunng87
Copy link
Member Author

sunng87 commented Jun 15, 2024

Just updated defaults and sample configuration. PTAL @evenyag @MichaelScofield

@evenyag
Copy link
Contributor

evenyag commented Jun 16, 2024

Just updated defaults and sample configuration. PTAL @evenyag @MichaelScofield

@sunng87 I realize that we don't need to make the size of the heartbeat runtime configurable. If sending the heartbeat occupies one core for the whole time, there must be something wrong...... I'd suggest not exposing hb_rt_size.

@sunng87
Copy link
Member Author

sunng87 commented Jun 16, 2024

@evenyag Sounds good. We need to keep to UI as minimal as possible. We only expose it when there is a real case.

@fengjiachun fengjiachun added this pull request to the merge queue Jun 18, 2024
Merged via the queue into GreptimeTeam:main with commit 70d113a Jun 18, 2024
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconsider bg_worker runtime size and dedicated heartbeat tasks
5 participants