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
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.
-
Plasma Desktop 6.1.4 Release Includes Improvements and Bug Fixes
The latest release from the KDE team improves the KWin window and composite managers and plenty of fixes.
-
Manjaro Team Tests Immutable Version of its Arch-Based Distribution
If you're a fan of immutable operating systems, you'll be thrilled to know that the Manjaro team is working on an immutable spin that is now available for testing.