powertop : mendiagnosa konsumsi daya

PowerTOP adalah ‘command line tools’ untuk mendiagnosa masalah dengan konsumsi daya dan manajemen daya. Selain menjadi alat diagnostik, PowerTOP juga memiliki modus interaktif di mana pengguna dapat melakukan percobaan berbagai pengaturan manajemen daya untuk kasus-kasus di mana distribusi Linux belum memungkinkan pengaturan ini.1

Kebetulan saya lagi pakai openSUSE 13.1, powertop ini menampilkan hasil diagnosanya selain update di konsol, powertop juga bisa menampilkan hasil diagnosanya dalam bentuk file html.

  1. install powertop su -c 'zypper install powertop'
  2. sebagai root ketik di konsol powertop
      Powertop menampilkan banyak informasi tentang keaadaan  komputer kita, dari proses CPU, proses yang sedang berjalan, prosesor, daya, terus informasi optimalisasi perangkat yang terdapat di komputer kita seperti VGA, lan card, wireless dan lain-lain.
  3. beberapa opsi powertop di keyboard, 'esc' untuk keluar, 'tab' untuk bergeser ke tab/tabel selanjutnya dan 'r' untuk refresh powertop, di menu ‘tunables’ tombol ‘enter’ bisa merubah parameter dari ‘bad’ menjadi ‘good’ dan sebaliknya.
  4. menampilkan hasil diagnosa powertop dalam bentuk file html ketik di konsole, powertop -html perintah ini akan menghasilkan file bernama tml.html yang bisa dibuka dengan browser.

Berikut hasil dari powertop komputer saya untuk informasi ”tunables” .

PowerTOP 2.4 Overview Idle stats Frequency stats Device stats Tunables

Bad VM writeback timeout
>> Bad Enable SATA link power Managmenet for host0
Bad Enable SATA link power Managmenet for host1
Bad Enable SATA link power Managmenet for host2
Bad Enable SATA link power Managmenet for host3
Bad Enable SATA link power Managmenet for host4
Bad Enable SATA link power Managmenet for host5
Bad Enable Audio codec power management
Bad NMI watchdog should be turned off
Bad Autosuspend for USB device TouchStrip Fingerprint Sensor [UPEK]
Bad Autosuspend for USB device Flash Card Reader/Writer [Generic]
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller
Bad Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor DRAM Controller
Bad Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor Graphics Controller
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2
Bad Runtime PM for PCI Device Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Bad Runtime PM for PCI Device Broadcom Corporation BCM43142 802.11b/g/n
Bad Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port
Bad Runtime PM for PCI Device Intel Corporation HM77 Express Chipset LPC Controller
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2
Bad Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller
Bad Runtime PM for PCI Device NVIDIA Corporation GF119M [GeForce 610M]
Bad Runtime PM for PCI Device Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
Bad Wake-on-lan status for device enp4s0
Good Autosuspend for USB device Integrated Camera [Chicony Corp.]
Good Autosuspend for unknown USB device 1-1 (8087:0024)
Good Autosuspend for unknown USB device 2-1 (8087:0024)
Good Autosuspend for USB device EHCI Host Controller [usb1]
Good Autosuspend for USB device EHCI Host Controller [usb2]
Good Autosuspend for USB device xHCI Host Controller [usb3]
Good Autosuspend for USB device xHCI Host Controller [usb4]
Good Wake-on-lan status for device wlp3s0
Good Using 'ondemand' cpufreq governor

Exit | Toggle tunable | Window refresh

dan ini setalah di ‘tunning’ dari hasil melihat report file tml.html

PowerTOP 2.4 Overview Idle stats Frequency stats Device stats Tunables

Good Enable SATA link power Managmenet for host0
Good Enable SATA link power Managmenet for host1
Good Enable SATA link power Managmenet for host2
Good Enable SATA link power Managmenet for host3
Good Enable SATA link power Managmenet for host4
Good Enable SATA link power Managmenet for host5
Good Enable Audio codec power management
Good NMI watchdog should be turned off
Good VM writeback timeout
Good Autosuspend for unknown USB device 1-1 (8087:0024)
Good Autosuspend for unknown USB device 2-1 (8087:0024)
Good Autosuspend for USB device Flash Card Reader/Writer [Generic]
Good Autosuspend for USB device Integrated Camera [Chicony Corp.]
Good Autosuspend for USB device TouchStrip Fingerprint Sensor [UPEK]
Good Autosuspend for USB device xHCI Host Controller [usb3]
Good Autosuspend for USB device xHCI Host Controller [usb4]
Good Autosuspend for USB device EHCI Host Controller [usb1]
Good Autosuspend for USB device EHCI Host Controller [usb2]
Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1
Good Runtime PM for PCI Device Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4
Good Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor Graphics Controller
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2
Good Runtime PM for PCI Device Broadcom Corporation BCM43142 802.11b/g/n
Good Runtime PM for PCI Device Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller
Good Runtime PM for PCI Device Intel Corporation HM77 Express Chipset LPC Controller
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1
Good Runtime PM for PCI Device NVIDIA Corporation GF119M [GeForce 610M]
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2
Good Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor DRAM Controller
Good Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
Good Wake-on-lan status for device wlp3s0
Good Wake-on-lan status for device enp4s0
>> Good Using 'ondemand' cpufreq governor

<ESC> Exit | <Enter> Toggle tunable | <r> Window refresh

Dan berikut saran yang keluar ketika membuka file tml.html sebelum di ‘tuning’.

VM writeback timeout echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
Enable SATA link power Managmenet for host0 echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy';
Enable SATA link power Managmenet for host1 echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy';
Enable SATA link power Managmenet for host2 echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy';
Enable SATA link power Managmenet for host3 echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy';
Enable SATA link power Managmenet for host4 echo 'min_power' > '/sys/class/scsi_host/host4/link_power_management_policy';
Enable SATA link power Managmenet for host5 echo 'min_power' > '/sys/class/scsi_host/host5/link_power_management_policy';
Enable Audio codec power management echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
NMI watchdog should be turned off echo '0' > '/proc/sys/kernel/nmi_watchdog';
Autosuspend for USB device TouchStrip Fingerprint Sensor [UPEK] echo 'auto' > '/sys/bus/usb/devices/1-1.3/power/control';
Autosuspend for USB device Flash Card Reader/Writer [Generic] echo 'auto' > '/sys/bus/usb/devices/2-1.6/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control';
Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor DRAM Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control';
Runtime PM for PCI Device Intel Corporation 3rd Gen Core processor Graphics Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control';
Runtime PM for PCI Device Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller echo 'auto' > '/sys/bus/pci/devices/0000:04:00.0/power/control';
Runtime PM for PCI Device Broadcom Corporation BCM43142 802.11b/g/n echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control';
Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port echo 'auto' > '/sys/bus/pci/devices/0000:00:01.0/power/control';
Runtime PM for PCI Device Intel Corporation HM77 Express Chipset LPC Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.3/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control';
Runtime PM for PCI Device NVIDIA Corporation GF119M [GeForce 610M] echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control';
Runtime PM for PCI Device Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control';
Wake-on-lan status for device enp4s0 ethtool -s enp4s0 wol d;

Supaya setingan ‘tuning’ sesuai saran powertop tidak berubah saat komputer restart, kita harus memasukan script startup. sebelum memasukan script start up nya kita buat dulu script filenya dan kita simpan di /usr/local/bin misalkan kita kasih nama startup.sh, berikut scriptnya seusai saran powertop.

echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host4/link_power_management_policy';
echo 'min_power' > '/sys/class/scsi_host/host5/link_power_management_policy';
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
echo '0' > '/proc/sys/kernel/nmi_watchdog';
echo 'auto' > '/sys/bus/usb/devices/1-1.3/power/control';
echo 'auto' > '/sys/bus/usb/devices/2-1.6/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:04:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:01.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.3/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control';
ethtool -s enp4s0 wol d;
script ini relatif, sesuaikan dengan laporan yang keluar di file tml.html tab 'tuning'

kemudian kita sisipkan script berikut di file /etc/init.d/after.local supaya startup script kita berhasil.

/usr/local/bin/startup.sh
exit

enable service after-local.service dengan ketik systemctl enable after-local.service.2

lalu restart untuk mencoba startup script kita berjalan atau tidak.
sekarang sudah bisa lihat laporan tml.html dengan pretasi ‘good’.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s