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

fix(vm): cpu usage/idle handled by single worker #12663

Merged
merged 5 commits into from Mar 12, 2024

Conversation

JimMoen
Copy link
Member

@JimMoen JimMoen commented Mar 7, 2024

Fixes https://emqx.atlassian.net/browse/EMQX-11897

Release version: v/e5.6.0

Summary

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • [ ] If changed package build workflow, pass this action (manual trigger)
  • [ ] Change log has been added to changes/ dir for user-facing artifacts update

@JimMoen JimMoen requested review from lafirest and a team as code owners March 7, 2024 10:19
@JimMoen JimMoen changed the title Emqx 11897/fix cpu usage/api fix(vm): cpu usage/idle handled by single worker Mar 7, 2024
@JimMoen JimMoen force-pushed the EMQX-11897/fix-cpu-usage/api branch from 8c871e1 to 230c491 Compare March 8, 2024 07:19
apps/emqx/src/emqx_sys_sup.erl Outdated Show resolved Hide resolved
apps/emqx_management/src/emqx_mgmt.erl Show resolved Hide resolved
changes/ce/fix-12663.en.md Outdated Show resolved Hide resolved
apps/emqx/src/emqx_cpu_sup_worker.erl Show resolved Hide resolved
@JimMoen JimMoen force-pushed the EMQX-11897/fix-cpu-usage/api branch from 230c491 to b42922b Compare March 11, 2024 07:32
@@ -131,7 +132,7 @@ handle_info({timeout, _Timer, mem_check}, #{sysmem_high_watermark := HWM} = Stat
handle_info({timeout, _Timer, cpu_check}, State) ->
CPUHighWatermark = emqx:get_config([sysmon, os, cpu_high_watermark]) * 100,
CPULowWatermark = emqx:get_config([sysmon, os, cpu_low_watermark]) * 100,
CPUVal = emqx_vm:cpu_util(),
CPUVal = cpu_sup:util(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change? for accuracy?

Copy link
Member Author

Choose a reason for hiding this comment

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

cpu_sup:util/0 will be called in single gen_server emqx_os_mon, no need to warp it in emqx_cpu_sup_worker process.

qzhuyan
qzhuyan previously approved these changes Mar 11, 2024
@JimMoen JimMoen merged commit 20cd47a into emqx:release-56 Mar 12, 2024
166 checks passed
@JimMoen JimMoen deleted the EMQX-11897/fix-cpu-usage/api branch March 12, 2024 17:28
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

Successfully merging this pull request may close these issues.

None yet

3 participants