Hacker News new | ask | show | jobs
by alex3305 1048 days ago
> 5-10 years ago I would think this is perfectly fine. I believe I was not alone in this, but maybe I was. The energy would have cost pennies too and why whine about it?

When I moved into my own home (8 years ago) I brought my 'homeserver' with me. Which was just a simple i5-2600 build with some shucked drives in it. I never thought about electricity prices when I lived with my parents. But that changed rather fast. With the server gobbling up a constant 90W, I quickly realized that, even back than, it would cost me 15 euro's a month on electricity alone.

I than proceeded to put a Pi next to it, that would listen to incoming Plex requests and would start up and shut down the server with WoL. That only reduced costs by about a third. The next couple of years I would move on to a NUC with a NAS that would only consume about 29W/h on average. Which was decent, but not great considering the poor performance of both machines (J4105 and J1800).

Last month I have gone back to the DIY route. Now with a i5-13500. I'm still in the process of optimizing it for power efficiency. Although much more stressful than the prebuilts, I love the hunt for the last watt.

Anyway, what I wanted to say is that I notice that family and friends don't really care about saving power in general. They mostly just pay for it and there's that. While my house runs 100% on electricity and I'm really proud if I can get 9kWh/day on average. Even when I see that (for example) the 8-bit guy uses 100kWh/day on average [1]. Which seems out of this world for me.

1. https://www.youtube.com/watch?v=bXd-aP06lug&t=45s

2 comments

>I than proceeded to put a Pi next to it, that would listen to incoming Plex requests and would start up and shut down the server with WoL.

How hard is this to configure? I have a server at home I use to run a database and computational heavy code, however I am the only user so realistically it is only in use 8 hours a day and some weekends etc. However in the fear of forgetting to turn it on before I go to work (or if I suddenly find time to work while away) I find that I default to leave it on. Being able to control it would be fantastic.

> How hard is this to configure?

Not at all. Just ensure that you have WoL enabled on the host machine and than proceed to send a magic packet. You could even do this with Home Assistant [1] if you are into that. I did this with a script that used tcpdump to monitor for incoming traffic [2] for Plex with an additional (dummy) Plex server on the Pi. I also remember faintly that I had to add 1 library and 1 video file to make this work though.

Powering down - or sleep - is a bit harder. I built a 'Sleep on LAN' app [3] for myself years ago that could power down (or sleep) a system on demand using a REST API. I used this and Tautulli [3] with Home Assistant that would check if there were any active streams and if there wasn't any activity for a specified amount of time I would send a SoL request to my service.

As you can see it isn't super hard or complicated, but a bit cumbersome to find all the moving bits and make it work. But when it does, it's IMHO fantastic.

1. https://www.home-assistant.io/integrations/wake_on_lan/

2. https://gist.github.com/alex3305/8cc73ddd2c8ca6328f20235480a...

2. https://github.com/alex3305/sleep-on-lan

3. https://tautulli.com/

If it's just that, you can have a Pi next to it and just ssh in to send a WoL command. Basically nothing to configure.

You can make it simpler to use by making an alias in your shell, or a button on your phone (with one of the countless "ssh button" apps). Or even make a web page for it (some php or python that just calls the WoL function).

OP describes a more transparent (and complex) setup where the Pi presumably acts as a reverse proxy. I'd be curious to know the exact setup too, one of the simplest ways would be to use wake on unicast: https://news.ycombinator.com/item?id=35627107

Other ways include wrapping some scripts around socat, writing your own proxy, systemd socket activation, etc.

I used tcpdump with a dummy Plex server that listened to incoming requests [1]. Because those request are automatically generated when a user opens up the Plex app. And I than proceeded to send a WoL request.

A reverse proxy would of probably worked too, but I didn't want to be limited by the 100Mbps network interface of my Pi 3B.

1. https://gist.github.com/alex3305/8cc73ddd2c8ca6328f20235480a...

Hold on a second - how large of a household are we talking? House or apartment? What consumes all that power? Electric vehicle? Work from home?

I'm environmentally conscious (0 cars, 0 pets) but I haven't spent any time measuring and optimising electricity usage.

I've had a look at my own electricity usage every once in a while, now averaging 48 kWh/month (between 38 and 68) for a larger than average apartment for two people.

48 kWh / month is amazing! That's 4 kWh / day. Just cooking on our induction burner and instant pot can use up 1 kWh on a day with lots of meal prep.
Isn't 48 kWh/month = ~1.6 kWh/day? That seems impossible. Even 4kWh / day seems impossible for me. I exclusively use electricity, except for heating. My water heater alone consumes about 2kWh/day. Not even talking about cooking, using my computer or watching tv.
Interesting. Maybe our brand new kitchen appliances are more energy efficient?