Which distros are energy efficient? I have a capable desktop, and I mean to push it, but I don’t want to be using energy if it’s not necessary. I’m not looking to rescue an old laptop, for example.

I hear CachyOS is fast. Does that translate to energy efficient?

(Does the OS even matter that much for efficiency?)

  • diaphragmwp@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    7 hours ago

    I was writing a really long answer but it disappeared, fuck me.

    Anyways, I guess I am going to skip the scientific explanation, but CachyOS’s optimizations most of the time mean energy efficiency. Most of the time. It’s not a hard guarantee, could make things much worse depending on what’s running.

    Now, as for distributions. Load one of the following with a copy of sway-git or hyprland (or if your box is old enough to have 2D acceleration, better use TWM, DWM…).

    If you want a “traditional” distribution, like when you can just run some random binary from the interwebs and meet most of it’s assumptions to let it “just run”, I suggest Arch Linux (yes, really) with a thing called “ALHP.go” (basically repos that provide optimized packages just like CachyOS, except that this is the original). I don’t know of anything like CachyOS and ALHP elsewhere anywhere, so this may be the most performing option.

    If you are fine with having to run a container for the unity shovelware friends send you, look into Adelie Linux and Alpine. They are energy efficient, but for the wrong reasons: lighter weight component alternatives just means less work to do. In Alpine, the packages are also optimized for storage rather than performance, which has a side effect that your CPU can load whole chunks of programs into cache and use RAM less. If you are fine with a virtual machine on non-Linux, you probably wouldn’t need this advice, but there’s midnightBSD and OpenBSD and such. OpenBSD is meant for security and not performance (even blocks multi threading by default), but it comes with the side effect of being very small and thus energy efficient.

    Technically, a source distribution like T2 or Gentoo would be the most performant AND energy efficient, but you need to burn quite a lot of electricity to get there first and to install updates. Using clang instead of GCC makes this a bit less painful but still. UNLESS you just rent a server and offload everything there with something like distcc.

    Now, a few little remarks:

    • What the other person said about the web is true, the modern web sucks balls. You could use browsers like Chawan, Netsurf (git since last release is old) and Dillo (git), then play videos with mpv + yt-dlp and stuff. However, you will eventually run into one of the abominations of websites that have 3 language translations on top of each other and require the latest of technologies. Also, you would be locked out of most Lemmy instances (some have JSless old.{domain} but not mine :/). Now, ALHP has optimized Firefox, but most of the most important routines have been turned into hand crafted assembly for each generation of CPU (yes, really), so the performance (and energy) impact isn’t as good as you would expect. Your web browser will be using the most power regardless. Although you can make it slightly better with UBlock Origin and decentraleyes (both included in Arch repos)… I’ve heard the Firefox people are starting to upstream a native adblock engine which means it will be faster, though it’s not quite there yet.
    • Sometimes, the Linux kernel will set the minimum CPU frequency above the actual minimum and I couldn’t find a proper reason for it. My workaround is running this script in a few places on startup as root: echo "1" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq.
    • Avoid running flatpak, snapd…
    • Disable daemons you don’t need (like Avahi).
    • Avoid running web browser wrappers (Element, Discord, Jitsi meet…), just use your default browser. When you need them (Steam, Signal), stop them after you are done.
    • You may have luck turning off devices physically with “acpi_call”.

    You can also make scripts like this (example is for Arch):

    scripts

    minimize_network_services.sh

    #!/bin/sh
    sudo systemctl stop snowflake-proxy
    sudo systemctl stop i2pd
    sudo systemctl stop ipfs@alex.service
    sudo systemctl stop zerotier-one
    sudo systemctl stop gnunet
    sudo systemctl stop tor
    akonadictl stop
    pkill -9 akonadi
    pkill -9 Telegram
    pkill -9 signal-desktop
    pkill -9 steam
    

    no_network_services.sh

    #!/bin/sh
    . ./minimize_network_services.sh
    sudo systemctl stop NetworkManager
    sudo rfkill block wlan
    sudo systemctl stop ntpd
    

    min_network_services.sh

    #!/bin/sh
    sudo rfkill unblock wlan
    sudo systemctl start NetworkManager
    sudo systemctl start ntpd
    

    yes_network_services.sh

    #!/bin/sh
    . ./min_network_services.sh
    sudo systemctl start snowflake-proxy
    sudo systemctl start i2pd
    sudo systemctl start gnunet
    systemctl --user start ipfs