赞
踩
1.安装cpufrequtils:sudo apt-get install cpufrequtils
2.查看cpu:sudo cpufreq-info (本命令从内核/硬件中收集并报告CPU频率信息)
3.设置cpu模式:cpufreq-set –g {powersave, userspace, ondemand, conservative, performance} -c 序号
对应于{最省电(最低频率),用户控制,最高或最低,正常,最大性能}
模式就是执行cpufreq-info后看到的所支持的模式。
比如以下几种:powersave, userspace, ondemand, conservative, performance。
-c 就是CPU的序号 指代线程数
4.下面以一个具体例子演示下:
环境:双核CPU 要求全核心以最大频率运行
- #!/bin/sh
-
- cpufreq-set -g performance -c 0
- cpufreq-set -g performance -c 1
- cpufreq-set -g performance -c 2
- cpufreq-set -g performance -c 3
-
- exit 0
一个名为cpu.sh的脚本。执行:
chmod 777 ./cpu.sh
运行./cpu.sh即可
5.可以用sudo cpufreq-info 查看每个核心的频率状态,结合i7z(实时CPU报告工具)观察也不错
- #安装i7z
- sudo apt-get install i7z
-
- #运行i7z
- sudo i7z
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。