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

[Feature] Watch CPU frequency in near real time. #132

Closed
joaoherberto opened this issue Dec 3, 2020 · 4 comments
Closed

[Feature] Watch CPU frequency in near real time. #132

joaoherberto opened this issue Dec 3, 2020 · 4 comments

Comments

@joaoherberto
Copy link

joaoherberto commented Dec 3, 2020

This is not an issue, I just want to share this code snippet for monitoring CPU frequency in almost realtime. I use auto-cpufreq on all my Linux devices, even desktops and it is always nice to see if it is working properly or not. Note: I found this code months ago and unfortunately I don't know whom to give credit.

Just run this command from the terminal
watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""

@AdnanHodzic
Copy link
Owner

I use auto-cpufreq on all my Linux devices, even desktops and it is always nice to see if it is working properly or not

Glad to hear this!

In that case I'm marking this as a [request]. I think this feature would be perfectly implemented as part of what's requested in #87

I don't know when I'll have time to implement this feature, so if you're up and know bit of Python please make the changes yourself and submit a PR. I'll be glad to do the code review.

If anything you'll be given credit as part of Releases :)

@AdnanHodzic AdnanHodzic changed the title Watch CPU frequency in near real time. [Feature] Watch CPU frequency in near real time. Dec 6, 2020
@netikras
Copy link

Two things to consider:

  1. cat + grep -- that's unnecessary. Especially when grep can easily do what cat does -- read a file. Just do grep <pattern> <file>
  2. Current refresh rate is what, 4 seconds? Tuning it down to 0.1 second would mean that auto-cpufreq will utilize 40x more CPU resources. This makes it possible for auto-cpufreq itself to cause high CPU usage and switch to Performance mode, meaning the governor will always be at Performance, even when the computer is idling. This risk is especially worrying in smaller, older computers, esp. single-core ones w/o HT.

@AdnanHodzic
Copy link
Owner

Tat's an excellent point @netikras and same conclusion I came to when I was thinking about this last time. Definitely something to keep on mind if we go forward with implementation of one this feature request.

@AdnanHodzic
Copy link
Owner

In latest release 1.9.4, changes have been made where auto-cpufreq will refresh frequencies in (near) real time and counter has been removed.

Refresh rate is still around every 3-4 seconds, as through my analysis and testing anything below this timeframe will only cause tool to use unnecessary amount of resources, which would defeat purpose of this tool.

With that said I'll close this feature request.

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

No branches or pull requests

3 participants