locxter.net

Optimizing battery life under Linux with TLP

2024-06-23

As an average consumer, we take quite a lot of tedious tuning and optimization of the tech products we use for granted. One area that is especially sensible to this is battery life, since there always is only a limited amount of energy stored in the physical cells installed in a device and modern CPUs offer quite fine control over their allowed power budgets and sleep modes, which opens the door for amazing power savings and thus extended runtimes. Since I have been running Linux as my exclusive desktop operating systems mostly on laptops (used ThinkPads to be specific) for quite a few years now , I have more than a bit of experience with utter lack of this optimization and terrible battery life. Luckily, there's a tool to at least somewhat improve the situation...

First and foremost, I want to make it clear that this article isn't meant to bash against Linux on mobile devices or anything remotely related. I truly love Linux as well as its free and open source nature and run it personally on all device I reasonably can. But as mentioned above, getting great battery life out of a device requires many man-hours of tuning, which is something the manufacturer can easily invest, but that's almost impossible to achieve for a community project like Linux with its various distributions, desktop environments and ultimately countless different devices to run on. Thus it's just natural that the battery life of most laptops will suffer quite a bit by running Linux, even though it is clearly less resource hungry than other operating systems (I'm looking at you, Microsoft) unless the manufacturer also spent little to no time tuning the software.

The situations has certainly improved over the last few years with the inclusion of power profile daemons in Gnome and KDE as well as quite solid sleep-state support for some models, but it still is far away from meeting the in this regard seemless experience of the OS a device ships with. Thankfully, there is the command-line power management utility TLP , which optimizes the power consumption of various components of the system with great default settings that allow for an "install and forget" use case while also offering many fine controls for advanced tweeking. Personally, I haven't spent the time on any of my device to fine-tune TLP's settings, but just the defaults already provide such a meaningful improvement (at least on the hardware I run) that any further optimization seems like a diminishing returns situation to me. Under the hood, TLP doesn't do anything not possible otherwise, but almost perfects the challenge of abstracting the technical details while still providing granular control. Here's how to get started with it:

With that said, I hope you enjoyed this small article, as always feel free to share your thoughts in the comments down below and have a lovely day...

RSS feed