Live data from Hacker News

Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

maximiliangolla.com

71–80 of 230 posts

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#72

Earlier quoted context omitted.

Ok, the implementation wasn’t very fantastic cost wise. However I still think this could be a big area of improvement. How can we reduce energy usage of servers? There’s a lot of work with ARM lately, I’m curious if that could be used in server workloads like this.

The most effective way is to be able to dynamically distribute load across a large array of servers, turning some off at times of lower load. Anyone who runs a large datacenter probably already does this or something equivalent, either to save money or to service more customers with the same amount of hardware. It's more effective to optimize the hardware architecture, but it's worth noting that improvements in effic…

> Anyone who runs a large datacenter probably already does this or something equivalent, either to save money or to service more customers with the same amount of hardware.

Possibly, but few cloud providers actually do live migration[0] since it's risky to pause a VM for typically less than 1 second, but up to 5 seconds.

0: https://cloud.google.com/compute/docs/instances/live-migrati...

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#73
post #3

>Why isn't this build into every major operating system by now? Because no desktop OS besides MacOS can handle Sleep with any semblance of competency. >Why isn't this the default See above.

My usual comment: out of windows, macos and Linux only the Linux on laptop and on steamdeck can sleep and wake up reliably without draining all the battery for me. I know others have a different experience, but I'd just go with "none of the systems handle it reliably" if we're generalising.

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#74

Earlier quoted context omitted.

Reverse proxy on the Pi? If a request comes in for the server and x minutes have elapsed since last activity/WoL, send a new WoL. I'm a little out of my wheelhouse though. Maybe that would only work for HTTP which will not cover Time Machine? Does Time Machine run on a schedule? Add a cron job (whatever the Mac equivalent is) to send a WoL ~1min beforehand?

Reverse proxy means that your pi now has to handle all the traffic for Plex and any other services. It could also make other things difficult like CIFS/whatever else you're hosting. Depending on what Pi you're using, it's networking is over USB, and so is quite performance constrained.

You could use DSR (Direct Server Return) so that the pi only handles the initial connection. All the video traffic goes directly from the server to you without passing through the pi.

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#75
post #3

>Why isn't this build into every major operating system by now? Because no desktop OS besides MacOS can handle Sleep with any semblance of competency. >Why isn't this the default See above.

> Because no desktop OS besides MacOS can handle Sleep with any semblance of competency.

The Chromebook I'm using right now handles sleep perfectly, and always has.

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#76

Earlier quoted context omitted.

The most effective way is to be able to dynamically distribute load across a large array of servers, turning some off at times of lower load. Anyone who runs a large datacenter probably already does this or something equivalent, either to save money or to service more customers with the same amount of hardware. It's more effective to optimize the hardware architecture, but it's worth noting that improvements in effic…

> Anyone who runs a large datacenter probably already does this or something equivalent, either to save money or to service more customers with the same amount of hardware. Possibly, but few cloud providers actually do live migration[0] since it's risky to pause a VM for typically less than 1 second, but up to 5 seconds. 0: https://cloud.google.com/compute/docs/instances/live-migrati...

I was actually thinking about elastic AWS instances when I wrote that. IIRC they're meant to be spun up and then shut down as a service's demand varies.

VPS providers are already overprovisioned anyway, so they have less idle hardware to begin with.

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#77
You don't even need magic packets from a dedicated machine for wake on lan for some NIC's. For example on linux using `ethtool -s enp3s0 wol pug` will wake the system on p (PHY activity), u (unicast activity) and g (magic packet activity). Of course this is entirely dependent on how "noisy" your network is.

This is something I've been thinking about for some time as I'm working on re-building my homelab for a more powerful system with more storage. On of the big things I'm trying to find out is if there is a good way of truly shutting off hard drives when not in use or if the hit to longevity of the drives would be too much.

source https://wiki.archlinux.org/title/Wake-on-LAN

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#78
post #66

Earlier quoted context omitted.

Indeed, modern hardware is getting ridiculously efficient, and if you go the extra mile to disable hardware you don't use, as well as strip your configuration to run only the software you absolutely need, you can really drive it into the ground. The later hardware revisions (such as 1.5) of the Raspberry Pi 4B, even with 8GB of memory, can idle at ~1.33W on WiFi with everything unnecessary disabled -- 2GB versions ar…

> For those who go, "but I need real power" I think those usually also want real storage space, NVMe either can’t offer that, or it would make the build so expensive, electricity stops mattering. And in those cases, 4-12 24 TB HDDs will out-consume your other hardware anyway ;)

It depends how one uses the storage, but on my home server I didn't need to access the (external) HDD storage often so I created a systemd service that spun it down after set time of inactivity. The response when the HDD is needed again is not instant, but okay enough for what I needed.

/usr/sbin/hdparm -S 120 /dev/sdb

https://wiki.archlinux.org/title/Hdparm

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#79
This general concept is very similar to Apple’s Bonjour based “Sleep Proxy” service. Basically, if you have an Apple TV or something similar it will automatically wake up a sleeping device when someone requests its services. SSH or media sharing for example. While a device is sleeping the proxy will keep advertising its services via Bonjour. Low power always-on Apple devices are sleep proxies by default but you can turn any Mac into a Sleep Proxy by passing a flag to mDNSResponder.

More details: https://en.wikipedia.org/wiki/Bonjour_Sleep_Proxy

Re: Saving Energy: Home Server That Automatically Suspends to RAM and Wakes Up Again

#80
post #3

>Why isn't this build into every major operating system by now? Because no desktop OS besides MacOS can handle Sleep with any semblance of competency. >Why isn't this the default See above.

My usual comment: out of windows, macos and Linux only the Linux on laptop and on steamdeck can sleep and wake up reliably without draining all the battery for me. I know others have a different experience, but I'd just go with "none of the systems handle it reliably" if we're generalising.

Agreed. I find Macos on a fresh installation and new hardware will work fine, but over time it seems to fall apart somehow. The last Mac I used (when I worked for $FORMER_EMPLOYER) would sleep fine but whenever I woke it up several hours later I had a 50% chance of it being completly flat (and the other 50% it would have varying levels of charge). It got to the point I got into the habit of plugging my Macbook anytime I needed to wake it up after several hours of sleep to ensure it actually would wake up properly. This was because occassionaly it would wake up for a few seconds and durin that time it'd trigger another suspension which would itself fail to work and power-off part way through the suspension requiring a fresh boot. Battery supposely fine etc and would usually go for several hours no issues while still powered on. YMMV of course but I've had better experience with Linux and Windows on my Lenovo ThinkPads--if it goes to sleep at a certain level of battery charge then it usually wakes up only a few percentage points below that after several hours. shrugs
Post reply on HN