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

Enable CPU frequency chart #8938

Closed
Compizfox opened this issue May 8, 2020 · 6 comments
Closed

Enable CPU frequency chart #8938

Compizfox opened this issue May 8, 2020 · 6 comments
Labels
no changelog Issues which are not going to be added to changelog question

Comments

@Compizfox
Copy link

Compizfox commented May 8, 2020

I want to have the CPU clock frequency chart enabled in Netdata. If I'm not mistaken, this is handled by proc.plugin, which is enabled by default. However, my Netdata instance does not have the CPU frequency chart.

In the docs I found this statement:

If more than 50 cores are present in a system then CPU thermal throttling, frequency, and idle state charts are disabled.

The machine in question has a Threadripper 3970X (32 cores, 64 threads). Is it possible that the threads are counted as 'cores', and that is why the charts are disabled?

Is it possible to turn the charts back on using a config option?

@Compizfox Compizfox added no changelog Issues which are not going to be added to changelog question labels May 8, 2020
@ilyam8
Copy link
Member

ilyam8 commented May 8, 2020

i see that 50 limitation is hardcoded

if(unlikely(do_cpu == -1)) {
do_cpu = config_get_boolean("plugin:proc:/proc/stat", "cpu utilization", CONFIG_BOOLEAN_YES);
do_cpu_cores = config_get_boolean("plugin:proc:/proc/stat", "per cpu core utilization", CONFIG_BOOLEAN_YES);
do_interrupts = config_get_boolean("plugin:proc:/proc/stat", "cpu interrupts", CONFIG_BOOLEAN_YES);
do_context = config_get_boolean("plugin:proc:/proc/stat", "context switches", CONFIG_BOOLEAN_YES);
do_forks = config_get_boolean("plugin:proc:/proc/stat", "processes started", CONFIG_BOOLEAN_YES);
do_processes = config_get_boolean("plugin:proc:/proc/stat", "processes running", CONFIG_BOOLEAN_YES);
// give sane defaults based on the number of processors
if(unlikely(processors > 50)) {
// the system has too many processors
keep_per_core_fds_open = CONFIG_BOOLEAN_NO;
do_core_throttle_count = CONFIG_BOOLEAN_NO;
do_package_throttle_count = CONFIG_BOOLEAN_NO;
do_cpu_freq = CONFIG_BOOLEAN_NO;
do_cpuidle = CONFIG_BOOLEAN_NO;
}

@mfundul
Copy link
Contributor

mfundul commented May 8, 2020

That's not a problem @ilyam8 .

The "cores" word is wrong in this document. In reality it's what linux calls "processors" or "CPUs". The computer architecture term would be "hardware threads".

If you want to enable all of the options that are automatically disabled due to high processor count in proc_stat module, you need to enable in netdata.conf section [plugin:proc:/proc/stat] the following boolean configuration options:

    keep per core files open = yes
    keep cpuidle files open = yes
    core_throttle_count = yes
    package_throttle_count = yes
    cpu frequency = yes
    cpu idle states = yes

As a result, you will have more charts, more CPU overhead and more open file descriptors from netdata.

@Compizfox
Copy link
Author

Compizfox commented May 8, 2020

Thanks for the quick responses!

The "cores" word is wrong in this document. In reality it's what linux calls "processors" or "CPUs". The computer architecture term would be "hardware threads".

Ah, right, like I suspected ;)

If you want to enable all of the options that are automatically disabled due to high processor count in proc_stat module you need to enable in netdata.conf section [plugin:proc:/proc/stat] the following boolean configuration options:

So it is possible to override this behaviour in the config. Thanks! I have set these options and the charts are working. I'll keep an eye on the performance impact.

@ilyam8 ilyam8 closed this as completed May 8, 2020
@Compizfox
Copy link
Author

Okay, quick second question: the clock frequency figures I see in the Netdata chart differ from those I obtain from /proc/cpuinfo under load.

In Netdata, the frequency doesn't exceed 3.7 Ghz (the CPU's base clock), but using /proc/cpuinfo I see it boosting to about 4.1 GHz.

@mfundul
Copy link
Contributor

mfundul commented May 8, 2020

It's taken from /sys/devices/system/cpu/cpuX/cpufreq/scaling_cur_freq.

@netdata-community-bot
Copy link

This issue has been mentioned on the Netdata Community Forums. There might be relevant details there:

https://community.netdata.cloud/t/enable-cpu-frequency-chart-netdata-cpu-cpufreq/4336/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Issues which are not going to be added to changelog question
Projects
None yet
Development

No branches or pull requests

4 participants