Live data from Hacker News

Making a Linux home server sleep on idle and wake on demand – the simple way

dgross.ca

111–120 of 244 posts

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#111
I've already made this into a all-in-one program: https://github.com/nikp123/wake-on-arp/

but i do agree with the others in this thread, it's quite a hassle to keep this setup working as intended.

I'd advise against wherever possible, consider investing into an efficient PC:

My current home server thing runs at only 22W while idle and costed me (including storage and networking) about 150eur.

But if it's done for the fun of it, I have nothing against it.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#112
post #20
post #3

Another option, if your needs are relatively modest, is to choose a low power mini PC. The one I chose idles at around 5W under Linux before any tweaking. It is based on the Intel N5105. I have a few 2.5” external HDDs attached for backup which are configured to sleep after a short time.

I'm curious if you have measured power at the well (e.g. smart plug with energy metering or Kill-a-watt.) I just set up a test server with a J1900 (10W TDP.) With 8GB RAM and running from an SSD it uses 25W. Add 4 7200RPM HDDs and it's up to 65W idling. I have another test server based on a Raspberry Pi 4B. The Pi boots from SD card and uses about 5W. Add 2 drives in a USB drive bay and power for the setup is now up…

2.5" hard disks actually use way less power than the 3.5" drives, but if you spin down the bigger drives they get down to about 1watt.

My server at home I actually use a 2.5" drive for the torrent scratch disk since I don't really need speed there I just need something that is always spun up with a moderate amount of space that doesn't use much power.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#113
This feels like the sort of functionality that ought to just work now. Its a clearly useful thing for PCs all over the planet and it would be nice if they just went to sleep almost completely when idle and woke up on network or USB/PS2 input. The power savings would be enormous.

Yet today I still have issues with power saving features, performance is lowered by having power saving on instead of flat out and various things don't work like Keepass looses connection to my browser for my passwords and one of the USB devices that came on the motherboard crashes the entire computer on some power transitions. Its taking an awful long time for power saving features to mature.

I would love to have this for my NAS/server, it has a lot of performance for when its needed but its also idle a lot. This is not the way.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#114

So, fun story. I've got an "AI" server which has three P40s and a M40 in it. I'm doing my own version of "off while idle". I discovered that if the server gets hard shutdown by killing the power it will automatically start back up when the power turns on. As a result I just set up home assistant with a power toggle and when I want the server off or on I can start it up by restoring the power. Way more brute force tha…

https://www.home-assistant.io/integrations/wake_on_lan/ and https://www.home-assistant.io/integrations/shell_command/ with `ssh server poweroff` if you want something a bit less risky measure the power draw from your smart plug when the machine is on & off, then use that to set up https://www.home-assistant.io/integrations/switch.template/ which combines all of this

Oh man, that shell command is awesome. I could set it up to run some of the services I have to manually do from my phone right now.

Thanks for that information.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#115

Very nice, I didn't know that you could wake computers with unicast packets. For my use case, I run a Raspberry Pi that is on the same local network as my PC. When I connect to the Pi to forward my PC's RDP port to my laptop's loopback interface, the Pi sends a normal magic packet to wake my PC. All that was needed was an entry like this in my laptop's .ssh/config: Host remote-desktop HostName raspberry-pi User pi Po…

There's also the "exec" keyword that lets you run a command in a "Match" block like so:

  Match host my-pc.local exec "wakeonlan -i 192.168.178.255 11:22:33:44:55:66"
This doesn't cover the case when the connecting machine is in another network but it does avoid a hop. Perhaps you could also run another SSH command in the exec condition that connects to the Pi and has it send the WoL packet.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#116

Earlier quoted context omitted.

Meh, I struggled to get my pi to work as a time machine server. It would work for a few weeks and then just stop working and I would have to start the backup from scratch previous backups becoming unusable. In the end I just plugged an external hard disk into the mac. I have had similar issues in the past even with such simple things as SSH to a Mac. It would be easy to blame the pi or Linux, but as far as I can tell…

Time Machine over NAS has always been unstable for me. As you experienced, my backup would be regularly corrupted and would need to restart. Alternatively, a normal I eventually gave up on the NAS and now backup to external drives at home. This site has excellent articles on Time Machine - scroll down to Time Machine Problems: https://eclecticlight.co/mac-troubleshooting-summary/

I had the exact same problem and ended up with the same solution. I know people who have had somewhat better experiences backing up to something like a Synology, but the $Xk investment wasn't worth it for me without also needing it for big file storage or media serving or whatever.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#117
post #50

Earlier quoted context omitted.

Especially when the reality is… you can almost go IPv6 only nowadays if you wanted to. I went down the rabbit hole recently, switching my network to IPv6 primary with IPv4 as the fallback. The ultimate test was disabling IPv4 for a weekend to see what, if anything, broke. I had set up DNS64, NAT64 and 464XLAT. The only weirdness is how Windows clients handle IPv6 literals in UNC paths, which is super ugly, and how so…

> you can almost go IPv6 only nowadays if you wanted to. I think that is the reason why many aren't enthusiastic about it.

Again, I disabled IPv4 purely for testing reasons, to guarantee nothing was using IPv4 without me knowing it. There’s no reason to actually disable IPv4 as a fallback.

Over 99.999% of traffic through my home network is IPv6 now. The tiny remainder that has to use IPv4 does, without issue. 5 months on, and nary a complaint. Just works.

The world is ready for IPv6 as your primary, with IPv4 as the fallback.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#118
post #82

> Disable IPv6: this approach relies on ARP, which IPv6 doesn't use I wish more people would care about IPv6.

Especially when NDP covers all of the features of ARP

> Especially when NDP covers all of the features of ARP

... and more.

and lots of options with varies level of support. Too many switch and flags to fiddle with.

Someone in IEEE need to publish a Current Best Pratice list and deprecate all other options.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#119

I just let my computer run all the time. Disable all sleep functionality except monitor sleep. Then it always works when I need it to. My life is way too short to fool around with stuff like this to save $5 in electricity and have to deal with the inevitiable "won't wake up" or "wakes up in a brain-damaged state" situations.

I've used Suspend-to-RAM for years on Windows, and it's always worked reliably, rarely needed fooling around with...

Try to control it remotely with SSH and wake-on-lan. Not so reliable.

Re: Making a Linux home server sleep on idle and wake on demand – the simple way

#120
What would happen if after long period of inactivity the server become a “silent” device i.e. device that does not transmit traffic for extended periods of time because can result in a loss of service binding? These periods of inactivity, thus making the device effectively unreachable (for example for a WAKE-ON-LAN packet) [1].

The diagrams in the article are just gorgeous, can you share the drawing tools being used here?

[1] Shortest Path Bridging Architecture guide:

https://www.al-enterprise.com/-/media/assets/internet/docume...

Post reply on HN