Is there a command to view current cpu clock speed?
-
I have a cpu that can turbo boost but I wanted to see if there was a way to view the current cpu clock speed?
Kinda like the task manager in windows where you see current clocks but on pfsense. Is it a special command/package i need?
-
-
stephenw10 Netgate Administratorlast edited by stephenw10 Aug 21, 2019, 2:15 PM Aug 21, 2019, 2:13 PM
-
Thanks guys!!
-
Also you must enable powerd in Sys > Adv > Misc to see variable clock speed.
Steve
-
@stephenw10 yea i have it on max performance
-
@stephenw10 said in Is there a command to view current cpu clock speed?:
[2.5.0-DEVELOPMENT][root@xtm800.stevew.lan]/root: sysctl dev.cpu.0.freq dev.cpu.0.freq: 3201
Note that is indicating 3.2GHz with Turbo. The extra 1 shows turbo is enabled.
The dashboard will also show it at anything less than maximum speed:
Steve
@stephenw10 sorry to bump such an old thread but I was wondering if you knew if this meant that the CPU was actually scaling past the 3200 MHz in this example and we just didn't have the visibility to it from withing pfSense (FreeBSD).
Just trying to understand how this works.
-
stephenw10 Netgate Administratorlast edited by stephenw10 Feb 10, 2022, 4:18 PM Feb 10, 2022, 4:17 PM
Yeah, the extra 1 there means turbo is active but we can't see the actual speed since the CPU itself varies that with temperature and on a per core basis. That particular CPU has turbo capability shown as
2/3/4/4
. So all 4 cores at 3.4GHz, 3 cores at 3.5GHz or 2 cores at 3.6GHz.
As far as I know there's no way to see that in FreeBSD/pfSense though.Steve
-
@stephenw10 said in Is there a command to view current cpu clock speed?:
Yeah, the extra 1 there means turbo is active but we can't see the actual speed since the CPU itself varies that with temperature and on a per core basis. That particular CPU has turbo capability shown as
2/3/4/4
. So all 4 cores at 3.4GHz, 3 cores at 3.5GHz or 2 cores at 3.6GHz.
As far as I know there's no way to see that in FreeBSD/pfSense though.Steve
Thanks for the confirmation, I noticed that FreeBSD 13 has Intel SpeedShift enabled which is quicker to respond than SpeedStep.
I noticed that 2.6 was still on 12.3 I wonder if and when pfSense moves to v13 we would get more visibility into this?
-
Maybe. If it's in FreeBSD 13 then there's a very good chance.
Can you test 13? Or 14 even?
-
@stephenw10 said in Is there a command to view current cpu clock speed?:
Maybe. If it's in FreeBSD 13 then there's a very good chance.
Can you test 13? Or 14 even?
Not without there being a hypervisor in the mix which brings in other variables.
-
Yes, not much point testing virtually for that.
-
Took a serious L with the 2.6 upgrade and ended up installing from scratch.
Figured I would give OPNsense a try since I was starting from scratch and I can confirm the implementation of Speedshift and clock speed movement without powerd being enabled. (In fact powerd slows things down).
root@OPNsense:~ # sysctl -a dev.cpu | grep 'freq_levels\|freq' dev.cpu.7.freq_levels: 3600/-1 dev.cpu.7.freq: 799 dev.cpu.6.freq_levels: 3600/-1 dev.cpu.6.freq: 799 dev.cpu.5.freq_levels: 3600/-1 dev.cpu.5.freq: 799 dev.cpu.4.freq_levels: 3600/-1 dev.cpu.4.freq: 799 dev.cpu.3.freq_levels: 3600/-1 dev.cpu.3.freq: 799 dev.cpu.2.freq_levels: 3600/-1 dev.cpu.2.freq: 799 dev.cpu.1.freq_levels: 3600/-1 dev.cpu.1.freq: 799 dev.cpu.0.freq_levels: 3600/-1 dev.cpu.0.freq: 799 root@OPNsense:~ # sysctl -a dev.cpu | grep 'freq_levels\|freq' dev.cpu.7.freq_levels: 3600/-1 dev.cpu.7.freq: 799 dev.cpu.6.freq_levels: 3600/-1 dev.cpu.6.freq: 4597 dev.cpu.5.freq_levels: 3600/-1 dev.cpu.5.freq: 4597 dev.cpu.4.freq_levels: 3600/-1 dev.cpu.4.freq: 4298 dev.cpu.3.freq_levels: 3600/-1 dev.cpu.3.freq: 4298 dev.cpu.2.freq_levels: 3600/-1 dev.cpu.2.freq: 4057 dev.cpu.1.freq_levels: 3600/-1 dev.cpu.1.freq: 3999 dev.cpu.0.freq_levels: 3600/-1 dev.cpu.0.freq: 3928
-
How did it show those things enabled? The second output is after enabling it? In the BIOS?
powerd relies on some driver to actually control the cpu speed, est(4) for Intel CPUs. And that relies on either hard coded values or, far more commonly, values passed to it by ACPI. It's not unusual for those to be wrong or missing unfortunately.
Steve
-
@stephenw10 said in Is there a command to view current cpu clock speed?:
How did it show those things enabled? The second output is after enabling it? In the BIOS?
powerd relies on some driver to actually control the cpu speed, est(4) for Intel CPUs. And that relies on either hard coded values or, far more commonly, values passed to it by ACPI. It's not unusual for those to be wrong or missing unfortunately.
Steve
No both outputs are taken right after one another it shows the proc jumping all around to different clock speeds as the processor sees fit.
My guess is the usage of hwpstate_intel is what allows the different visibility into the two different operating systems.
https://www.freebsd.org/cgi/man.cgi?query=hwpstate_intel&apropos=0&sektion=4&manpath=FreeBSD+13-current&arch=default&format=html