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)
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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.)
Method 2
For intel i3, i5 and i7 based cpus there is a dedicated tool called i7z that shows current speed for all cpu cores.
From man page (description):
i7z runs the i7z, ncurses based, program without any options. i7z will
print out the C-states and temperature for i3, i5 and i7 based Core
processors from Intel (including Nehalems, Sandy Bridge and Ivy
Bridge).
For ubuntu-based distributions you can install it by issuing this command:
sudo apt-get install i7z
then just run it (tool needs to be run with sudo):
sudo i7z
Method 3
The Intel Core i7-4600U Processor supports Turbo Boost technology. It has a base frequency of 2.10GHz and a Max Turbo Frequency of 3.30GHz. That means that,
- If you disable the Turbo Boost (in the BIOS setup menu), the CPU will work at 2.10GHz all the time.
- When Turbo Boost is enabled and only one of the cores is working, the CPU will work at a maximum of 3.30GHz.
- If Turbo Boost is enabled and all the cores are working, the CPU will work at 2.10GHz.
Obtaining current frequency
To determine if the Turbo Boost is activated and which is the current frequency, you can use cpupower frequency-info. For instance, for an old Intel Core i5-660 with Turbo Boost enabled, you will get the following.
$ cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.20 GHz - 3.47 GHz
available frequency steps: 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 1.20 GHz and 3.47 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.87 GHz.
cpufreq stats: 3.47 GHz:82,67%, 3.33 GHz:0,00%, 2.53 GHz:0,00%, 1.87 GHz:0,06%, 1.20 GHz:17,28% (3)
boost state support:
Supported: yes
Active: yes
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
Note that the information states the hardware limits (1.20 GHz - 3.47 GHz), the possible frequencies (3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz) and the current frequency (1.87 GHz). You may find the technical information of these frequencies at the Intel website.
Frequency when TurboBoost is disabled
Note the difference when you run the same command with Turbo Boost disabled: In the boost state support section, the values for Supported and Active are no. Here, the CPU will be at the nominal/minimal value (1.20Ghz) all the time.
$ cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.20 GHz - 3.47 GHz
available frequency steps: 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 1.20 GHz and 3.47 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.20 GHz.
cpufreq stats: 3.47 GHz:40,86%, 3.33 GHz:0,01%, 2.53 GHz:0,06%, 1.87 GHz:0,22%, 1.20 GHz:58,85% (493)
boost state support:
Supported: no
Active: no
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
You can disable the Turbo Boost using the BIOS or some Linux options/commands. The kernel support can be enabled/disabled using the /sys/devices/system/cpu/cpufreq/boost file.
Method 4
CPU frequencies are kept in the kernel but they can be a little “off”. You can see them using:
$ cd /sys/devices/system/cpu $ paste <(cat cpu*/cpufreq/affected_cpus) <(cat cpu*/cpufreq/scaling_cur_freq) | column -s $'t' -t 0 833914 1 800021 2 800086 3 800029 4 800036 5 800460 6 800118 7 800141
If you don’t need to know the CPU #’s a shorter method is simply using:
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq 1396354 800058 800050 800024 800005 800017 800001 1392006
Method 5
To get informations about your CPU type the following command:
dmidecode -t processor | grep -i mhz
Method 6
$ sudo watch cpupower monitor
Output:
Every 2.0s: cpupower monitor
| Mperf || Idle_Stats
CPU| C0 | Cx | Freq || POLL | C1
0| 99.53| 0.47| 4390|| 0.00| 0.37
16| 98.73| 1.27| 4390|| 0.00| 1.21
1| 94.80| 5.20| 4390|| 0.00| 5.22
17| 99.79| 0.21| 4390|| 0.00| 0.12
2| 99.19| 0.81| 4390|| 0.00| 0.72
18| 99.80| 0.20| 4390|| 0.00| 0.11
3| 94.63| 5.37| 4390|| 0.00| 5.42
19| 93.49| 6.51| 4390|| 0.00| 6.56
4| 99.89| 0.11| 4390|| 0.00| 0.00
20| 99.77| 0.23| 4390|| 0.00| 0.15
5| 99.80| 0.20| 4390|| 0.00| 0.10
21| 98.73| 1.27| 4390|| 0.00| 1.20
6| 99.85| 0.15| 4390|| 0.00| 0.05
22| 99.86| 0.14| 4390|| 0.00| 0.06
7| 99.79| 0.21| 4390|| 0.00| 0.11
23| 93.81| 6.19| 4391|| 0.00| 6.26
8| 98.46| 1.54| 4390|| 0.00| 1.48
24| 97.19| 2.81| 4389|| 0.00| 2.80
9| 99.70| 0.30| 4390|| 0.00| 0.22
25| 99.27| 0.73| 4390|| 0.00| 0.67
10| 99.68| 0.32| 4390|| 0.00| 0.23
26| 98.57| 1.43| 4390|| 0.00| 1.38
11| 98.11| 1.89| 4390|| 0.00| 1.83
27| 74.72| 25.28| 4392|| 0.00| 25.65
12| 99.72| 0.28| 4390|| 0.00| 0.19
28| 99.20| 0.80| 4390|| 0.00| 0.73
13| 95.79| 4.21| 4390|| 0.00| 4.28
29| 95.80| 4.20| 4389|| 0.00| 4.21
14| 99.81| 0.19| 4390|| 0.00| 0.10
30| 99.16| 0.84| 4390|| 0.00| 0.77
15| 99.79| 0.21| 4390|| 0.00| 0.13
31| 97.08| 2.92| 4390|| 0.00| 2.90
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0