mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
3.7 KiB
3.7 KiB
Lower the power consumption
- TL;DR
- Disable unused services
- Improve battery performance
- Tune power-related settings
- Further readings
TL;DR
- Disable unused services.
- Tune power-related settings.
- [if using a battery] Improve battery performance.
- Turn off the NMI watchdog hardlockup detector.
The NMI watchdog is a debugging feature to catch hardware hangs that cause a kernel panic. On some systems it can generate a lot of interrupts, causing a noticeable increase in power usage. - Bump SATA Active Link Power Management to a higher setting.
- Increase the virtual memory dirty writeback time to help aggregating disk I/O.
This reduces spanned disk writes.
# Summarize performance of the last boot.
sudo systemd-analyze
# Show last boot performance.
# Also shows the process tree.
sudo systemd-analyze critical-chain
# Check power stats.
sudo powertop
# Set all tunable options to their `GOOD` setting.
# Calibration is interactive.
sudo powertop --calibrate && sudo powertop --auto-tune
# Turn off the NMI watchdog hardlockup detector.
echo '0' > '/proc/sys/kernel/nmi_watchdog'
# Bump SATA Active Link Power Management to a higher setting.
echo 'med_power_with_dipm' > '/sys/class/scsi_host/host0/link_power_management_policy'
# Increase the virtual memory dirty writeback time to help aggregating disk I/O.
# Value is in 1/100s of seconds. Default is 500 (5 seconds).
echo 6000 > '/proc/sys/vm/dirty_writeback_centisecs'
sudo sysctl vm.dirty_writeback_centisecs=6000
Disable unused services
$ sudo systemd-analyze
Startup finished in 13.129s (firmware) + 5.413s (loader) + 1.746s (kernel) + 7.903s (userspace) = 28.192s
graphical.target reached after 1.239s in userspace
$ sudo systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @1.239s
└─multi-user.target @1.239s
└─ModemManager.service @1.154s +84ms
└─polkit.service @937ms +215ms
└─basic.target @928ms
└─sockets.target @928ms
└─dbus.socket @928ms
└─sysinit.target @924ms
└─systemd-backlight@backlight:acpi_video0.service @2.273s +8ms
└─system-systemd\x2dbacklight.slice @2.272s
└─system.slice @197ms
└─-.slice @197ms
Improve battery performance
# Enable automatic power management.
# See `tlpui` on GitHub for UI.
sudo systemctl enable --now 'tlp.service'
sudo vim '/etc/tlp.conf'
# Check power stats.
sudo 'powertop'
Tune power-related settings
sudo powertop --calibrate
sudo powertop --auto-tune