It’s easy to track your battery’s performance, but it’s more difficult to get the right settings. However, you can find out what settings are best for your system, along with various low-level statistics, through an application called PowerTOP.
On Linux laptops, one of the most common complaints is that the battery life isn’t quite as good as one would hope. It’s true that with default settings, Linux gets decent battery life, but not as fine-tuned as say laptops that come with Windows.
PowerTOP is an application developed by Intel that is all about finding the best power settings on Linux systems. It’s not Intel’s only foray into power savings applications — it also has an application called the Intel Thermal Daemon. It’s difficult to describe what the thermal daemon does in layman’s terms, but just know that it only works with Intel processors. PowerTOP, on the other hand, works with all processors as it looks at general settings of not only the processor but other components in your system.
Installation of PowerTOP
PowerTOP can be installed on your system by searching for “powertop” in your respective package manager. Ubuntu users can install it with the command:
sudo apt-get install powertop
Fedora users can install it with:
sudo yum install powertop
On occasion, however, the version that is included in distribution repositories is a bit outdated — you can compile the absolute latest version yourself by getting the source code.
PowerTOP doesn’t have a graphical user interface, so you’ll need to run it by launching a terminal and running the command:
This will launch the program, and place you in the tab that displays the various wakelocks that currently keep your processor awake. It’s a good idea to check this on a regular basis to make sure that there isn’t a program or service that is constantly using your processor (and thereby battery power) when it shouldn’t be. This tab is solely for monitoring — there’s nothing you can do here besides identify what’s going on. Measures need to be taken on the program or service in question that’s causing the trouble. To move on to the next tab, hit the Tab button.
The Idle Stats tab shows you various information about processor C-states. For us, there’s little that we can learn from this tab although it doesn’t hurt to learn more about it if you’re interested.
Roughly the same applies to the Frequency Stats and Device Stats tabs.
Although, the Device Stats tab can be a bit more helpful in determining what’s using up more juice.
The last tab displays all of your tunables. These are the different system settings that you can tweak to reduce power usage. You can go through each item by pressing the down arrow key, and you can temporarily change the setting by hitting the spacebar or Enter on each item that says “Bad” to turn it into “Good”. Note that I said this change is temporary, because they disappear as soon as you restart the system.
To actually keep those settings so you won’t have to change them every time you boot your system, you’ll need to exit out of PowerTOP by pressing Esc and then running the command:
sudo powertop --html
This will take a moment to generate an HTML report of your system. In here, it’ll give you various commands that you can use to permanently change those tunables to the desired values. You can copy each one (yes, it’s a bit tedious) and paste it into the
PowerTOP Really Helps Battery Life
Without using PowerTOP, you risk not being able to identify whether there are any applications that are using power when they shouldn’t be. Thanks to the Tunables tab, it can also let you check up on common system settings that could be changed to yield better battery life. So although you might be using other tools or tricks like laptop-mode-tools and TLP or the now-defunct Jupiter, it’s still a good idea to check PowerTOP.
Share with us your battery life improvements you’ve gained thanks to PowerTOP. Or do you think it’s pointless? Let us know in the comments!