Software-based energy savings
Uncommunicative
Instead of patching the modules that regularly wake up the processor, you can simply unload them – of course, this assumes they are not needed.
If you do not need the computer to communicate in the next few minutes, just unload the modules for Bluetooth, WLAN, and Ethernet.
For Bluetooth, check first, by running the hciconfig command, to see whether a Bluetooth device is active.
Then stop the Bluetooth daemon and remove the module (you need to be root to do so):
# /etc/init.d/bluetooth stop # modprobe -r hci_usb
The same thing applies to WLAN adapters. To find out which module handles the wireless connection, run lsmod, and run iwconfig to discover the wireless device's name.
The next two commands down the adapter and unload the module for an Intel 4965AGN WLAN card:
# ifdown wlan0 # modprobe -r iwl4965
If you rely on a wireless connection, why not make use of the WLAN card's power-saving feature. For cards that use the ipw2100 or ipw2200 driver, you can enable the feature with the following command:
# iwpriv wlan0 set_power 7
To discover whether your card supports the set_power option, you can type iwpriv without parameters. More recent WLAN adapters that use the iwl3945 or iwl4965 drivers can be switched to power-saving mode as follows:
# echo 5 > /sys/bus/pci/ drivers/iwl4965/*/power_level
This setting does not affect the connection. The value that follows echo stands for the power-saving mode: 1 saves the least and 5 the most – 6 disables the function.
On our lab system (a Lenovo X61s), I saved around 1.4 watts (which is equivalent to 10 percent) by switching to the power-saving mode.
It might be worth your while to disable USB 1.1 on a notebook. USB mice and other USB 1.1 devices will not work after doing so, but integrated USB 2.0 devices such as touchpads or pointers will continue to provide normal service. To do this, unload the uhci_hcd module. On our lab machine, this reduced overall consumption by a further 10 percent, and it also helped to keep the heat down.
Deep Sleep
Unloading drivers switches off a computer's components individually. And if you will not be using the computer for an extended period of time, you can switch it to suspend mode. Suspend-to-RAM and Suspend-to-Disk typically work fine on more recent hardware. The advantage of saving the session data in RAM is that the computer boots extremely quickly when you need it. On the other hand, Suspend-to-Disk does not consume any power, and it prevents data loss in case of a power outage.
Hard Disk
The hard disk is another major power consumer. Depending on the amount of work it has to do, it would need a fair amount of power if the drive motor runs continuously. Again, this is a component that you can stop: type hdparm -S N /dev/sda. The value N multiplied by five is the inactivity span in seconds, after which the hard disk automatically switches off. A value of 0 disables this feature.
This does not mean that the hard disk automatically stops spinning: Just as in CPU sleep mode, some standard system settings keep on waking up the disk. One reason is the speed at which the kernel writes the disk cache out to the disk. To discover the value for your machine in hundredths of a second, you can check the /proc/sys/vm/dirty_writeback_centisecs file.
Set kernel access to 10 minutes with the following command:
# echo 60000 > /proc/sys/vm/dirt y_writeback_centisecs
Assuming your cache is big enough, the system will not even need to trouble the disk to write a file. But remember that buffered data will be lost in case of a power failure.
The syslog daemon can sabotage hard disk sleep mode. It regularly writes logs directly to disk without using the buffer, but you can add a - sign at the start of each entry in your /etc/syslog.conf file to tell the daemon to use the disk cache in the future. Again, remember the danger of data loss in case of power failure.
Mounting Ext3 filesystems with the noatime parameter – or for files that require the atime option, with the nodiratime or relatime parameters – avoids further power-hungry disk accesses [4]. By default, Linux uses the atime parameter when mounting Ext3 filesystems. This tells Linux to log the last file access times and record timestamps at short intervals, which in turn means regular disk access and power consumption.
The developers of Laptop Mode tools [5] advise against using this power-saving feature on desktop PCs: Hard disks for desktops differ from laptop models in that they are designed for non-stop use, but not for being powered on and off at short intervals [6].
The Laptop Mode tools are a big help if you need to enable the kernel's notebook support features and are easily customized by means of a file (see the "Laptop Mode Tools" box). The tool, which you will find in the repositories of many distributions, helps you save power by focusing mainly on the hard disk and its power-saving modes. If necessary, it will change system settings that cause the disk to start unnecessarily.
The tools support a number of additional power-saving options: they automatically enable the power-saving configuration when you switch to battery power and enable the Centrino WLAN adapter power-saving feature, support hibernation in case of a low battery state, start or stop daemons depending on the power supply, and modify the display brightness.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.