Correct Way to View CPU Speed on Linux – Monitoring Guide

cpulinux

I found two commands to output information about my CPU: cat /proc/cpuinfo and lscpu. /proc/cpuinfo shows that my CPU speed is 2.1 Ghz, whereas lspcu says it is 3167 Mhz. Which one is correct?

This is my exact output from cat /proc/cpuinfo about my processor speed:

model name  : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz

And this is from lscpu:

CPU MHz:               3225.234

(For some reason, lscpu outputs differently every time, varying between 3100 and 3300 MHz)

Best Answer

To see the current speed of each core I do this:

watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"

Note:

If your watch command does not work with intervals smaller than one second, modify the interval like so:

watch -n1 "grep \"^[c]pu MHz\" /proc/cpuinfo"

This displays the cpu speed of each core in real time.

By running the following command, one or more times, from another terminal one can see the speed change with the above watch command, assuming SpeedStep is enabled (Cool'n'Quiet for AMD).

echo "scale=10000; 4*a(1)" | bc -l &

(This command uses bc to calculate pi to 10000 places.)

Related Question