Ask HN: Better efficiency in laptops running Linux?

21 points by ge96 ↗ HN
So I have this laptop (nothing crazy) it's an Acer Cloudbook 14, I bought it mainly because of the insane purported battery life of something like 12 hours. Also it looked really nice/thin profile. Of course it's pretty much a piece of garbage eg. visible pixels, 2GB fixed ram, etc... Still it's not bad.

I found that running Windows 10 as it is, that's really good on power management.

I was running Ubuntu and Lubuntu on it for a bit and found the battery performance to suck. I'm primarily interested in using Linux to drop the idle RAM usage, as it sits at like 900+MB without anything open (except background tasks).

I'm a web developer so normally I have a local LAMP server setup with i3-wm.

I was looking through some forums and one thing mentioned was to modify the kernel regarding power management.

I'm just wondering if this is a lost cause eg. no point in trying.

I just think, for example the Macbook Air supposedly has really good software that manages the task management and what not and this helps with battery life and resource management. I was wondering if I could do something similar with Linux regarding battery life.

Going into standby when not in use, closing the lid, etc... ultimately though yeah I want to extend that 2GB.

I know... this computer is garbage, I bought it for $99 on eBay. Even with 8GB running VM on my desktop, 8GB is almost not enough with 2GB set for the VM. I remember the days when I had 16GB ha.

20 comments

[ 3.1 ms ] story [ 75.5 ms ] thread
A few of those can be already done by the distribution, but if not, the main points are:

- make sure TLP is installed

- disable Bluetooth if you don't use it

- disable services you don't care about (file indexing for example)

- use the right cpu scaling governor (you're likely interested in powersave)

- enable power management on all devices which support it without issues (tlp-stat will give you some hints)

- check powertop for some ideas about what exactly is using the most power

- update your system to the latest version (kernel gets power usage fixes all the time)

- there's often even more things to do - arch wiki (https://wiki.archlinux.org/index.php/Power_management) and ubuntu one (https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTw...) may give you some ideas, but keep in mind they may be out of date a bit

Your first link there is for Arch, are you suggesting to use Arch or just grabbed a link? I saw that you said "...done by distribution..."

Also file indexing, is that like a constant polling event to check for modifications?

Thanks for the check list

The hints are valid for any distribution. They usually rely on the kernel settings, not anything userland. So it doesn't really matter if you're looking at Arch, Ubuntu, or other guide. Even with specific services, the ideas usually hold between distributions - maybe you just need to correct a path or two.

File indexing services are things like locate, baloo, zeitgeist, etc. that try to save information about created files, so you can find them faster later on. On one hand side they give you faster results, but on the other they keep monitoring disk writes and impact your battery life.

So the file indexing services that you mentioned, often you have to go out of your way to install these, these would not be part of default file/folder management like pcmanfm?

I see Arch mentioned a lot. I used to be Linux Mint > Debian > tried Slackware > Ubuntu.... Slackware kind of sucked just because it was harder to setup/a lot of things didn't work like video playback. Not blaming it on them. Ubuntu I primarily switched to because they had drivers that Debian would sometimes not have like WiFi. Seems to make sense if more people use Ubuntu.

Anyway thanks.

Baloo comes by default with most KDE installations. Ubuntu used tracker (don't think it does anymore). So it's not that hard to find one of them running.
Thanks a lot for the information. Hopefully all of this will result in long battery life.
Generally a good place to start would be powertop[1]

1: https://github.com/fenrus75/powertop

(my memory is it's in the Ubuntu repos so you should be able to apt install it)

it has an "I'm feeling lucky" flag,

> powertop --auto-tune

which theoretically should make good choices for you.

Cool I will check that out. I do feel bad wiping the original OS though at least with Windows 10 there's no worry about serials, also I did use USB 3.0 as a "hard drive" For a bit, but the inability to sleep I think since it has to be constantly powered but I might be mistaken. I am using a USB 3.0 for a house web server, pretty cool. Thanks.
I run a T520 Lenovo on Ubuntu and had similar challenges until I started to manually turn my GPU on and off. Windows and Mac have excellent drivers which automatically control GPU while Linux does not.

At least on Ubuntu if you have a Nvidia GPU there is a handy widget you can install so simply toggle the GPU but it requires a logout/login each and every time.

Just not the same experience as Windows but in terms of battery life it does the job. I get about 3x battery life when in Intel Graphics vs my Nvidia.

This would be my first thought, I also have a laptop with Intel and nVidia graphics. Have you tried Bumblebee? I have it installed, but I don't see much difference. I didn't buy my laptop for the battery life, but it'd be nice if it lasted more than an hour!
I don't understand how if you turn off GPU, wouldn't your screen not work? I haven't heard of that before (not saying it's not true I just don't know)
One difference between Linux and Windows is that Linux will allocate pretty much as much RAM as the machine makes available and use it to avoid swapping pages to the swap disk versus Windows which performs similarly when a bunch of RAM is reported as free. Or to put it another way, Linux using all the RAM is a good thing for the same reasons that Windows not using all the RAM is...it means the system is running more or less optimally.

None of which directly relates to battery life. That's mostly a measure of Microsoft being the target platform of system designers and Linux not being the target. Linux power management will probably never be as good.

That's no longer the case for some time
Linux still caches stuff in RAM?..
yup, it still does

cat /proc/meminfo

MemTotal: 32884616 kB

MemFree: 344496 kB

MemAvailable: 20994872 kB

Buffers: 1796324 kB

Cached: 18710768 kB

SwapCached: 0 kB

Active: 12009748 kB

Inactive: 18639200 kB

I am taking about the windows side, it too now utilizes as much ram as you have for caches
(comment deleted)
(comment deleted)
I am running Arch Linux on the same laptop and have noticed a tremendous increase in performance.

While trying out the preinstalled win10 I wasn't even able to playback 720p YouTube videos without lags.

Well it does work well, I am idling around 150MB, as opposed to 900MB+, but it does suck with i3 when you resume, the wifi is off, screen dim isn't right, mouse pad isn't on (can't turn back on yet from what I've tried) I did modify /etc/rc.local ... other files regarding startup... I was able to set background with feh, but on restart this is also lost.... ahh well.

Battery consumption is good though, hard to believe this thing pulls around 3-4 watts and it has a ~5500WH battery but I think my battery only charges to ~5200WH