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
    5 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
    
    • diaphragmwp@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      3
      ·
      6 hours ago

      Yes, but the user doesn’t want it. To quote them:

      I have a capable desktop, and I mean to push it

      Also, Raspberry are greedy bastards, shit’s overpriced. May as well use another SBC for a much smaller price. Or one of the Chromebooks that would otherwise be e-waste.

  • Knoxvomica@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    6 hours ago

    So I do suggest you get some sort of energy monitor plug for your desktop and realize that it probably already uses less power than you think it does. I was very surprised at the efficiency once I did that.

  • sudoer777@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    8 hours ago

    IDK what exactly your goal is, but with distros like Arch, background services are opt-in and there’s documentation on fine-tuning the power settings.

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    10 hours ago

    OS matters, linux is probably the most efficient. The distribution matters less. But it also depends on what you want to do. Use it as a desktop?

    As others have said, disable services you don’t need, close programs you aren’t using.

    Actually that does make me think, there might be distros that automatically clean up unused programs and turn down the frequency of the CPU when it’s not in use. Haven’t done a thorough search though.

    • diaphragmwp@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      10 hours ago

      Turn down the frequency

      Kernel already does.

      Clean up unused programs

      ??? So it would close my IRC client when I look away? Fuck that.

      • onlinepersona@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        8 hours ago

        Kernel already does.

        Depends on which governor you have active

        ??? So it would close my IRC client when I look away? Fuck that.

        Don’t be daft. Look at what Android provides.

        • diaphragmwp@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          6 hours ago

          Depends on which governor

          Default one.

          Android

          That’s also bad, but there’s a difference: developers on Android know about this and do workarounds like keeping a notification open. Because Android is Android, it always has this. No existing program elsewhere is designed around this.

  • fuckwit_mcbumcrumble@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    13
    ·
    15 hours ago

    I guess whatever distro uses the least resources.

    The power difference is going to be negligible though. Unless you’re running a pentium 4 and all you do is boot the OS, check mail, then shut it down you’d never notice a difference. As soon as you open a web browser any savings goes out the window. The web will destroy any savings a distro has.

    Also performant doesn’t necessarily mean more efficient. It could mean it better utilizes the hardware, but because it’s using more of the hardware it’s using more power.

  • undrwater@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    15 hours ago

    Stop services you don’t need. Doesn’t matter the distro.

    You can also turn off devices right at the bus.

    Powertop is a great tool.

  • jollyrogue@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    12 hours ago

    The distro doesn’t really matter. Buying more efficient hardware and running efficient software matters.

    A 65w proc is going to use less electricity then a 240w proc. Native software is more efficient then running lots of web browsers.

    If you really want to know how much power the desktop is using, measure. Measure the power coming out of the wall. Measure how much time the system is active, and feed that into a time series database with a something like Grafana for visualizations.

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    14 hours ago

    There is no such thing in the way you’re imagining it. You can tune any distro to use as little power as possible, but there’s only so much you can do if the hardware platform you’re running isn’t very efficient.

    What are you currently running?

  • NM_Gringo@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    16 hours ago

    I have Ubuntu running with a sound bar and monitor that only pulls 40 watts. My processor is one of those vanilla box mini computers…GMKTech. I’m able to run it off a 1 kwh solar power station and it lasts a laughably long time. How much more efficiency do you need? I have fans that use more power than my desktop.

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

      I don’t know how your monitor is this efficient, mine consumes around that exact amount (40 watts) according to “displayspecifications.com”.

      Anyways, with my laptop eDP panel instead (driven by sway), external keyboard, external mouse, I have running:

      • systemd, glibc, NetworkManager, all that evil ass background crap
      • mpv playing a .ogg to headphones
      • Firefox with this website, typing rn
      • weechat connected to 3 servers
      • toxic
      • claws mail
      • Tor daemon
      • Wi-Fi through 2 walls

      Let’s look at upower -d:

      energy:              35,926 Wh
      energy-empty:        0 Wh
      energy-full:         35,926 Wh
      energy-full-design:  53,049 Wh
      (...)
      energy-rate:         5,64 W
      time to empty:       6,3 hours
      (...)
      capacity:            67,7223%
      technology:          lithium-ion
      

      roflmao (no, I don’t know why my battery is already this dead, or at least is counted as such)

      EDIT: before anyone mentions how a laptop is cheating, mini PCs all have laptop CPUs/APUs anyway

  • yaroto98@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    14 hours ago

    Nobody was really answering, but steamos makes tweaking the effeciency easy. It should be like the steam deck where you can tweak the tdp limit for the cpu and setting clock speed for the gpu. I believe this currently only works with amd cpu/gpu, but I believe they’re working with nvidia.