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 part 2 of #1291 - add PDH_FMT_NOCAP100 to format options in win_perf_counters #2483

Closed

Conversation

VVvKamper
Copy link
Contributor

@VVvKamper VVvKamper commented Mar 2, 2017

Required for all PRs:

  • CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

This addresses part 2 of #1291.

As i understand pdh_GetFormattedCounterValue function by default capping some values to 100.
In this PR i override this behaviour by adding PDH_FMT_NOCAP100 to format options.

added PDH_FMT_NOCAP100 format option
@sparrc
Copy link
Contributor

sparrc commented Mar 2, 2017

cc @PierreF @TheFlyingCorpse could you review?

@PierreF
Copy link
Contributor

PierreF commented Mar 2, 2017

I'm not sure to fully understand PDH_FMT_NOCAP100. From the documentation

Counter values greater than 100 [...] will not be reset to 100.

But I do already have value larger that 100 (e.g. filesystem space used, it does not loop at 100 bytes !)

I don't have multi-core under the hand right now, the biggest issue I could see is how would be reported global CPU usage. Before this change (like unix one) 100% idle or 100% used means all core full utilization. Does this change break that and make global CPU between 0-400 % (core 4-core) ?

If it's not changed, very fine and +1.
If that change, I would prefer to normalize this value to 0-100%.

Note: I understand that this bug fix issue for CPU usage of one process. I do talk about CPU usage of whole system.

@VVvKamper
Copy link
Contributor Author

@PierreF I have multi-core server and total cpu usage look fine after this fix.
image
Here is screenshot of my monitoring system. You can see how changing telegraf agent affects per process CPU metric and doesn't affect total CPU metric.

I'm also worried that there can be some counters that will be broken by this patch. We use this version on production for 2 days and haven't seen any problem yet, but we use small amount of counters namely: total CPU, per core CPU, Available Memory, network IO (bytes per second), Private memory per process.

I think there is some counters in windows that capped to 100 and some that are not, but i don't know
how it works precisely.

@PierreF
Copy link
Contributor

PierreF commented Mar 2, 2017

Perfect. LGTM.

@sparrc
Copy link
Contributor

sparrc commented Mar 2, 2017

@VVvKamper the first graph there is your total CPU usage, isn't it? you need to show an example of pre-change total CPU and post-change total CPU that is greater than 100%.

ie, your total CPU usage is below 100 so it is not getting capped regardless.

@PierreF
Copy link
Contributor

PierreF commented Mar 2, 2017

total CPU usage (if that what I called system CPU/global CPU) could never be above 100% (and that what we want).

What I wanted to avoid, is that with pre-change 2 core out of 4-core used = 50% and with post-change 2 core out of 4-core used = 200%.
Here I assume that with the same system load, the PR was deployed around 22h20. Can you confirm @VVvKamper ? In this case PDH_FMT_NOCAP100 does not affect global CPU.

@VVvKamper
Copy link
Contributor Author

VVvKamper commented Mar 2, 2017

@sparrc Yes it's win_cpu/_Total/Processor/Percent_User_Time and as I understand it can't be greater than 100% because windows return average cpu usage between every cores. You can see pre-change and post change CPU usage per Process (win_proc/xxx/Process/Percent_Processor_Time where xxx is process name) on second graph. First graph shows that total cpu counter metric remains the same pre-change and post-change.
@PierreF Yes, I confirm.

@sparrc
Copy link
Contributor

sparrc commented Mar 2, 2017

got it 👍

Copy link
Contributor

@sparrc sparrc left a comment

Choose a reason for hiding this comment

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

LGTM

@sparrc sparrc added this to the 1.3.0 milestone Mar 2, 2017
@sparrc sparrc closed this in 7513fca Mar 8, 2017
ssorathia pushed a commit to ssorathia/telegraf that referenced this pull request Mar 25, 2017
added PDH_FMT_NOCAP100 format option

closes influxdata#2483
calerogers pushed a commit to calerogers/telegraf that referenced this pull request Apr 5, 2017
added PDH_FMT_NOCAP100 format option

closes influxdata#2483
vlamug pushed a commit to vlamug/telegraf that referenced this pull request May 30, 2017
added PDH_FMT_NOCAP100 format option

closes influxdata#2483
maxunt pushed a commit that referenced this pull request Jun 26, 2018
added PDH_FMT_NOCAP100 format option

closes #2483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants