Wednesday, January 9, 2013

Disabling CPU speed scaling in CentOS 5

If you are using CentOS, you may notice that with the cpuspeed daemon, you will find that somehow you do not get the full CPU Frequency as specified in the CPU model.

To check whether you have discrepancy, do fire the command
# grep -E '^model name|^cpu MHz' /proc/cpuinfo

model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000

You can stop CPU throttling by disabling the cpuspeed daemon
# service cpuspeed stop

But if you do a closer check, you realise that if you have dual CPU socket, the disabling of the daemon seems to only impact 1 CPU socket..... Notice the figures below.....Hmmmm

model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 2501.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000
model name      :        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
cpu MHz         : 1200.000

No comments: