Live data from Hacker News

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

maximiliangolla.com

171–180 of 230 posts

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

#171

My old laptop is more than powerful enough for Plex and backups, and idles at around 3W. Why someone would use a desktop PC as a home server in Europe is beyond me.

Often because they need more than one disk installed. You could use a NAS, but then you've cost and additional energy consumption.

I use a USB 3 harddisk for that. Even my 8 year old "home server laptop" has usb 3.2 support which is faster than the disks can do anyway.

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

#172
post #15

Earlier quoted context omitted.

It's also worth mentioning that, by his own admission, OP only managed to save less than 2 euro cents per day (60 / 3360). Maybe he has different ideas, and that's perfectly fine, but personally I value reliability and uptime far more than 2 cents. EDIT: I failed at math. See below comments. :V

And you can have most of it with a banal sleeping/waking up by the schedule. Regular Joe sleeps at night and works at day. EDIT: btw, this solves "if Time Machine starts a backup" completely.

I have a backup box that wakes and does it's thing every night then shuts itself down when it's done.

I have a Plex box that turns on after work.

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

#173
post #140
post #93

I was using hdparm on my rpi home server to turn off the disk without unmounting it. It was just a cronjob to turn it off at night, and it would stay off until needed. The first request would then take over 5 seconds to turn it on again, and it would remain on.

You can set it to automatically spin down. No need for cron job.

But I don't want to pay the spin up price all the time.

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

#174

Smartphones can be connected for days on the internal battery, using well under a watt, and they can be ready to respond instantly, and they have an app container system that makes everything just work. I really think we need to start making Android servers a thing, at least for self hosting, maybe for everything. Judging by how WearOS seems to be able to run on 35mA or less, I think there's a good case for just maki…

but Android is just based on Linux, so in theory you could tweak a regular Linux server on ARM hardware to get good energy efficiency. The downside of Android is its reliance on Java, which adds a lot of overhead compared to bare-metal languages (I strongly believe - but have no sources or figures to back this up - this is why Apple phones have been faster and more energy efficient, especially in the earlier days (th…

Android has the NDK now, it can run native code with only tiny headers of java to launch it, plus ART compiles the Java anyway as I understand it.

Regular Linux could be tweaked, but I think it would be way easier to start on Android and add all the missing stuff you want for a server, than to start on Linux.

Regular Linux still uses a bit more power, and they don't have any kind of container+sandbox that works quite as well, on account of the very tiny userland API that requires containerized things to bring all their own libraries, making them like 800MB a lot of the time, can't really run more than a few apps in 16GB of cheap slow flash like that.

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

#175
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 ;)

Yep. I have a storage server, also with a 5750GE, 128GB ECC memory, 40Gbps (QSFP+, passive DAC), EIGHT 16TB drives off a modern HBA, two 2TB NVME SSDs (mirrored) as a cache/ingest tier, a SATA DOM to boot off of, and a BMC (which alone draws 3.2W).

132TB raw storage organized into 16TB and 64TB ZFS volumes, plus the 2TB ingest/cache tier. Can saturate 40Gbps up and down.

43-44W at the lowest idle state, about 55W with just the 16TB volume spinning. Though with all the memory and the cache/ingest tier, it doesn’t spin up often, and often it’s mostly spinning up just the two-disk volume. So most of the time it is completely silent — not even a fan whirr.

And that provides the bulk storage and backups (plus pushing offsite) to the PCs, a six-node Pi cluster, and those 9W virtualization servers by providing iSCSI volumes. Also lets any new device PXE boot, and if a device has no OS and no configuration, the hardware will self-install, then self-configure after the first boot. A lot of work, but very valuable experience that paid off at the day job.

A lot of VERY deliberate hardware choices to drive power consumption that low, and probably two weeks measuring power consumption of everything. Something people fail to realize that 10GbE Ethernet is rather power hungry if you’re using copper, but if you’re using fiber or (ideally) passive DACs, you can eke out lower latency, better performance, and drive power consumption into the ground. It matters when you consider you pay for that power consumption for 10GbE copper at every single RJ-45 port in the chain between the devices. You can pay < 10W for all the devices in a 40Gbps connection (four ports) with passive DAC, but with copper it’s more like 40-42W.

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

#176

Something's not right. I own both a passively cooled 2016 Mini PC OLOEY Intel Core i7-7500U (as a home media center) and a 2023 Minisforum UM690 (for work and it's amazing btw), and they both use about 7 watts when idling (screen off). How op is using 43 watts for an idling media center is just beyond me, he must be using a 1978 Intel 8086, right? Anyhow, 4 watts is still far better than 7 watts and this is a great a…

I've found that most desktop PC-s have idle power usage around 35-50W. That was the main motivation to look for alternative solutions like ASRock Deskmini, or the Dell/HP/Lenovo TinyMiniMicro form factor machines. Mini PC-s tend to have great idle power usage compared to big towers, which is probably down to the selection of the CPU, components on the motherboard and the power supply which usually has to only output…

ATX even needs -12V, which was useful for RS232 at that point I guess.

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

#177

Smartphones can be connected for days on the internal battery, using well under a watt, and they can be ready to respond instantly, and they have an app container system that makes everything just work. I really think we need to start making Android servers a thing, at least for self hosting, maybe for everything. Judging by how WearOS seems to be able to run on 35mA or less, I think there's a good case for just maki…

but Android is just based on Linux, so in theory you could tweak a regular Linux server on ARM hardware to get good energy efficiency. The downside of Android is its reliance on Java, which adds a lot of overhead compared to bare-metal languages (I strongly believe - but have no sources or figures to back this up - this is why Apple phones have been faster and more energy efficient, especially in the earlier days (th…

Android doesn't run apps in a Java VM. At build time, the Java bytecode is translated to DEX bytecode, which is designed specifically for Android. Today, at install time, the Android runtime compiles DEX bytecode to native code. You're probably right about this being true in the early days, but not so much anymore.

I think the power usage difference between Android and plain Linux on the same hardware is mainly due to the way Android aggressively puts the CPU into sleep states and uses timers (etc) to wake it up as needed.

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

#178
post #119
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" There's also the flip side, which is "well since I already have real power..." I.e., like many HNers, I own a powerful coding/gaming Linux desktop with plenty of HDD space, which gets regularly backed up to cold storage. It does however use a frankly obscene 90W when idling, due to the GPU, fans, and multiple hard drives and peripherals. Building a separate, power-efficient…

My workstation is a Zen 3 Threadripper Pro that mostly serves as a virtualized Spark cluster, an entire virtualized infrastructure stack, and video editing (plus occasional games). Wife lives in CAD tools on similar hardware with a bit less CPU and less memory. We already have real power.

- - - - -

However, we mostly prefer to have those off when we’re not doing work that requires them (I’m mostly on an iPad), plus there’s stuff that the entire family benefits from with the lab. Considering their performance the workstations are actually very power efficient setups for their capability, but they can noticeably change the temperature of a room in an hour when they’re under load, and both of them combined add about $35-40/mo to our electric bill (we pay ~$0.50/kWh in the Boston area) just for light loads, sometimes quite a bit more.

- - - - -

I will never suggest building something new JUST to reduce power consumption of existing stuff. ROI never makes sense. But when you DO build something new, I DO suggest looking hard at power consumption. There the savings can be quite material. Plus never having to hear any of the equipment EVER (barring the workstations going flat out) is a great thing. Silence is golden. You’ll also learn a lot more about your hardware.

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

#179
post #88

Smartphones can be connected for days on the internal battery, using well under a watt, and they can be ready to respond instantly, and they have an app container system that makes everything just work. I really think we need to start making Android servers a thing, at least for self hosting, maybe for everything. Judging by how WearOS seems to be able to run on 35mA or less, I think there's a good case for just maki…

Android servers - I've heard this idea before and I'm genuinely curious what it would take to make Android less painful for self-hosting. Currently automatic updates are an issue and remote management needs work. What else am I missing?

As I see it there's a few missing features, and they need to be solved anyway to make self hosting less painful in general, right now I don't see many good ways to do it at all unless you like stuff that unpredictabily needs maintenance.

Play store needs to be split into provider and interface APIs, so you can add your own repos and still have it work with existing tools.

Remote management needs to be a thing for sure, installing apps is the hard part of that. WearOS does it amazingly, just connected to BT and the host play store does it, but you'd need the split app store to make that work well with open source third party repos.

Automatic updates would be solved by that, just deploy your app on a repo, and update via the play store or your interface app of choice.

Finally you'd have to solve the biggest problem with ANY self hosting as far as I'm concerned, how to handle certs and domains with zero manual IT work(Has to be truly zero, no chance it needs maintenance while you're on vacation).

I've been saying this for a while, we need pubkey-based domains like .onion URLs, but without the onion routing, so there's no dependence on a CA or anything that might be hard to do in a fully automated "Scan the QR and connect" context.

Or, more likely, Google gives you a service.yoursubdomain.google when you buy Google One, and routes stuff ngrok style for you, with lots of spying, because P2P hasn't been their thing so far. Perhaps one of the forks could do it though.

Without eliminating domains and certs, I'll continue mostly ignoring self hosting, I don't want any chance it goes wrong while I'm too busy to fix it, since there's no dedicated support staff, just me.

It would also solve the other half of remote admin, apps could just declare a web interface for admin that you access if you have the secret URL.

Then you'd need some systemd alternative to manage processes. You'd have to be able to say "Start this on boot, restart it on failure, and never clear it out of RAM".

On the hardware side, phones are already close to perfect. Keep the screen and NFC and Bluetooth, for QR based connections and the like, keep the battery as a UPS, but add more USB ports, Thread/Matter, and ditch or downgrade the cameras.

The filesystem probably needs to support snapshots, and Android should get a Full Backup and Restore Provider API to make it easier to back up everything, just the home folder, just one app, just the settings, just the data, etc, to your chosen provider, maybe even with hooks for apps to respond to import and export, so that the state of your app is totally portable and needs only a few clicks to restore from auto backup.

Finally, we need a cpanel-like VPS management tool to migrate your stuff to cloud hosted if you want, that can take backup files, and show you what's on the remote device's virtual screen(Again, so QR stuff works) or at least what's being displayed via some "Admin screen API" if you don't want to drag the full graphics API into it(But keeping graphics all the time seems like a good plan for standardization, and for kiosk type stuff).

And then finally, you'd probably want a some of the features from a normal-ish Linux userland, or as close as you could get, to make porting existing stuff easier, but even without that, I'd say the porting would be worth it.

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

#180
post #28

Interesting solution. I wonder if you could make the 'wake up' a bit more advanced. Run tcpdump or something similar on the Pi, with a filter set for inbound packets to the media server on ports that Plex or Time Machine uses. If it sees those packets, send the WoL magic packet. This might not work if your switch does proper port isolation - but you could perhaps add port mirroring or something like that.

I think you could maybe just snoop for ARP - when you see something trying to discover the IP wake the machine up. Supposedly some Intel NICs [0] already support this, though they also wake on multicast which you wouldn't want here. [0] https://forums.unraid.net/topic/6455-how-to-wake-on-arp-unra...

Thinking of Icinga or other monitoring tools, they would trigger such a request everytime.
Post reply on HN