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
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.