diff --git a/knowledge base/lower the power consumption on linux.md b/knowledge base/lower the power consumption on linux.md new file mode 100644 index 0000000..3bf8918 --- /dev/null +++ b/knowledge base/lower the power consumption on linux.md @@ -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 diff --git a/knowledge base/sysctl.md b/knowledge base/sysctl.md index 62a8dac..6cc38b6 100644 --- a/knowledge base/sysctl.md +++ b/knowledge base/sysctl.md @@ -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] + +[documentation for /proc/sys]: https://docs.kernel.org/admin-guide/sysctl/ + + [how to reload sysctl.conf variables on linux]: https://www.cyberciti.biz/faq/reload-sysctl-conf-on-linux-using-sysctl/