最近覺得 AMD x2 5200+ 那台主機 cpu 總是很吃緊
心血來潮看了一下 /proc/cpuinfo
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
stepping : 2
cpu MHz : 1000.000
呃~~ 1GHz !!?? 不對吧, 查了一下 CPU 表應該是 2.70GHz才對啊 orz
爬了一下估狗, 原來是系統使用最低的速度來跑, 用 cpufreg-set 可以設定速度
系統是 CentOS 5.2 x86_64
# yum install cpufreq-utils
........
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
cpufreq-utils x86_64 1:005-1.el5 base 38 k
Transaction Summary
=============================================================================
安裝後會有兩個工具程式..
cpufreq-set 設定 cpu 速度
cpufreq-info 查看目前 cpu 的資料
# cpufreq-info
cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 2.70 GHz
available frequency steps: 2.70 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1000 MHz and 2.70 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1000 MHz (asserted by call to hardware).
analyzing CPU 1:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 2.70 GHz
available frequency steps: 2.70 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1000 MHz and 2.70 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1000 MHz (asserted by call to hardware).
這是原來的資料, 目前是用 1GHz 在跑, 最大可以到 2.70GHz
然後用 cpufreq-set 設定 cpu 速度為 2.0GHz..
# cpufreq-set -f 2.0GHz
# cpufreq-info
cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 2.70 GHz
available frequency steps: 2.70 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1000 MHz and 2.70 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 2.00 GHz (asserted by call to hardware).
analyzing CPU 1:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 2.70 GHz
available frequency steps: 2.70 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1000 MHz and 2.70 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 2.00 GHz (asserted by call to hardware).
/proc/cpuinfo 也可以看到 cpu MHz : 2000.000
用 top 觀察原來在跑的程式, 本來 cpu 使用 4x%~50%, 設定後大約是 30% 上下
只是很奇怪, 為何會用最低的速度來跑
另一台是 4 核 2.20GHz, 系統是 Ubuntu 8.04 server
這台直接就是 cpu MHz : 2200.000