Linux

우분투 CPU 클럭 조정기로 전기세 절약하기

behonestar 2015. 4. 1. 17:05

1. 현재 cpu 클럭 확인

$ grep "MHz" /proc/cpuinfo

cpu MHz         : 800.421

cpu MHz         : 800.121


2. 현재 cpu freq scaling 정책 확인

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

performance


3. 사용 가능한 cpu freq scaling 정책

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

performance powersave


4. powersave 모드로 변경

$ echo powersave | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

$ echo powersave | sudo tee /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor


5. 부팅 시 자동으로 powersave 모드로 적용하고 싶다면 rc.local에 등록

$ sudo vi /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo powersave | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo powersave | sudo tee /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

exit 0


참고

  1. http://www.xpenology.nl/control-cpu-power-state/
  2. http://askubuntu.com/questions/20271/how-do-i-set-the-cpu-frequency-scaling-governor-for-all-cores-at-once