Wednesday, January 16, 2013

Enabling CPU Scaling for Dual socket.

My earlier blog entry that shutting the cpuspeed daemon somehow only impact the first socket, but the second socket is still running at a reduced speed. There is a write-ups which was obtained from Experts-Exchange "Avoiding CPU speed scaling in modern Linux distributions. Running CPU at full speed Tips."

Firstly, do what was written at Disabling CPU speed scaling in CentOS 5

On CentOS 5, you may want to use the script and place it at /etc/init.d/cpuperf.

#! /bin/bash
#
# cpuperf sets cpu govermor
#
# chkconfig: 2345 10 90
#
# description: Set the CPU Frequency Scaling governor to "performance"
#
### BEGIN INIT INFO
# Provides: $ondemand
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
    start)
        for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
        do
                [ -f $CPUFREQ ] || continue
                echo -n performance > $CPUFREQ
        done
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac                                    

Type the command and you will see that the CPUSpeed are all at performance level.
# grep -E '^model name|^cpu MHz' /proc/cpuinfo

No comments: