Added notes on how to lower the power consumption on Linux devices

This commit is contained in:
Michele Cereda
2022-10-23 13:49:31 +02:00
parent 2e4df94ab5
commit 29ce02a92c
2 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1,19 @@
# Lower the power consumption on Linux
```sh
echo '0' > '/proc/sys/kernel/nmi_watchdog'
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
# together. This reduces spanned disk writes.
# 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
```
## Sources
- Arch Wiki's [power management][arch wiki power management] page
<!-- -->
[arch wiki power management]: https://wiki.archlinux.org/title/Power_management

View File

@@ -12,24 +12,25 @@ Default configuration files locations:
## TL;DR
```sh
# see the value of a single setting
# Show the value of a single setting.
sysctl kernel.ostype
sysctl vm.swappiness
# see the values of all settings
# Show the values of all settings.
sysctl -a
# change the current value of a setting
# Change the current value of a setting.
sudo sysctl vm.swappiness=10
sudo sysctl -w net.ipv4.ip_forward=1
# reload settings from a single configuration file
# Reload settings from specific configuration files.
sudo sysctl -p
sudo sysctl -p /etc/sysctl.d/99-swappiness.conf
# reload settings from the default configuration files locations
# Reload settings from the default configuration files locations.
sudo sysctl --system
# persistent configuration
# Set up persistent settings.
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
echo 'vm.swappiness = 5' | sudo tee -a /etc/sysctl.d/99-swappiness.conf
```
@@ -37,5 +38,10 @@ echo 'vm.swappiness = 5' | sudo tee -a /etc/sysctl.d/99-swappiness.conf
## Further readings
- [How to reload sysctl.conf variables on Linux]
- [Documentation for /proc/sys]
<!-- official documentation -->
[documentation for /proc/sys]: https://docs.kernel.org/admin-guide/sysctl/
<!-- forums -->
[how to reload sysctl.conf variables on linux]: https://www.cyberciti.biz/faq/reload-sysctl-conf-on-linux-using-sysctl/