夏天到了如何為linux降溫節能

來源:互聯網
上載者:User

夏天到了如何為linux降溫節能

--lihn1987(轉載請註明出處,謝謝)   
夏天到了,各位的本本肯定要到了面臨崩潰的邊緣,而台式機cpu風扇的聲音可以與F1賽車的聲音有的一拼了。。。。

那麼如何為我們的CPU降溫呢?我們的做法就是為CPU節能
以下是我的做法:

測試環境
作業系統:ubuntu10.04
CPU       :AMD X4 630 (四核處理器)
首先安裝
sudo apt-get install cpufrequtils
該軟體可以用來查看cpu的運行模式以及當前頻率
運行
cpufreq-info
結果如下所示

cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 2.80 GHz
available frequency steps: 2.80 GHz, 2.10 GHz, 1.60 GHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 2.80 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 2.80 GHz.
cpufreq stats: 2.80 GHz:10.37%, 2.10 GHz:0.14%, 1.60 GHz:0.56%, 800 MHz:88.93%  (6395)
analyzing CPU 1:
driver: powernow-k8
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 2.80 GHz
available frequency steps: 2.80 GHz, 2.10 GHz, 1.60 GHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 2.80 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 2.80 GHz:37.15%, 2.10 GHz:0.10%, 1.60 GHz:0.70%, 800 MHz:62.04%  (3481)
analyzing CPU 2:
driver: powernow-k8
CPUs which run at the same hardware frequency: 2
CPUs which need to have their frequency coordinated by software: 2
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 2.80 GHz
available frequency steps: 2.80 GHz, 2.10 GHz, 1.60 GHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 2.80 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 2.80 GHz:12.35%, 2.10 GHz:0.13%, 1.60 GHz:0.65%, 800 MHz:86.87%  (7569)
analyzing CPU 3:
driver: powernow-k8
CPUs which run at the same hardware frequency: 3
CPUs which need to have their frequency coordinated by software: 3
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 2.80 GHz
available frequency steps: 2.80 GHz, 2.10 GHz, 1.60 GHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 2.80 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 2.80 GHz:32.48%, 2.10 GHz:0.12%, 1.60 GHz:0.35%, 800 MHz:67.06%  (3615)

我們要做的就是調節cpu的模式
使用
suod cpufreq-set -g 《模式》
powersave,是無論如何都只會保持最低頻率的所謂“省電”模式;
userspace,是自訂頻率時的模式,這個是當你設定特定頻率時自動轉變的;
ondemand,預設模式。一有cpu計算量的任務,就會立即達到最大頻率運行,等執行完 畢就立即回到最低頻率;
conservative,翻譯成保守(中庸)模 式,會自動在頻率上下限調整,和ondemand的區別在於它會按需分配頻率,而不是一味追求最高頻率;
performance,顧名思義只注重效率,無論如何一直保持以最大頻率運行。

假如你選擇的是自訂模式的話可以通過sudo cpufreq-set -f 你所需要的頻率

注意,此處的頻率必須是以KHz為單 位,並且是可以達到的頻率(也就是用cpufreq-info查看到的各個頻率),cpu頻率=倍頻x外頻。以下凡是涉及頻率的一律如此。


而在自動調節下,也可以設定其上限和下限

sudo cpufreq-set -d 頻率下限 sudo cpufreq-set -u 頻率上限
這個可以用來超頻哦~~~~~~
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.