Energy Vampires: Measuring the Cost of a Homelab
Phase 2 · The Network Matrix
The bill that turned a lab from a set-and-forget environment into a power-managed one, and the Wake-on-LAN scripts that pay for themselves.
The first few months of running a lab, you think about CPU cycles and disk throughput. You forget about the boring number that actually governs infrastructure: watts. The moment that reminded me was the electricity bill for the quarter that followed the ZFS pool going in. Two hundred and forty Australian dollars higher than the same quarter the year before. Same flat, same climate, same appliances. The only new thing on the meter was the rack in the cupboard under the desk.
If you are building a homelab out of old enterprise gear, you will meet the same bill eventually. Decommissioned corporate hardware was designed for data-centre operation: constant load, constant power, cooling somebody else paid for. Consumer electricity tariffs punish that profile. A lab that runs twenty-four hours a day at a couple of hundred watts idle is a small, continuously-billed purchase you forgot to cancel. The fix is not to shrink the lab. The fix is to let it sleep.
The Analogy
A domestic fridge is on a duty cycle. The compressor runs for a few minutes, the insulation holds the cold for a while, the compressor cuts back in. Nobody thinks of the fridge as energy-hungry, because the steady-state draw is low, even though the peak draw is high. Uptime alone does not tell you the cost. Duty cycle does.
A homelab in its factory configuration is a fridge with the compressor glued on: constant peak draw, no cycling. The job is to add the cycling back in, without losing the capability of the lab when you need it. Wake-on-LAN is the switch the fridge never had.
The Tech Translated
Almost every motherboard built in the last twenty years keeps a tiny portion of the network card powered even when the machine is “off”. That power lets the card sit in a receive mode, listening for a specific packet called a magic packet: six bytes of FF followed by the target machine’s MAC address repeated sixteen times. When the card hears its own MAC in that pattern, it signals the motherboard to power up. The spec is boring, mature, and widely supported. All you have to do is enable it on both sides: BIOS and operating system.
From there, sleeping a node is conventional (systemctl poweroff). Waking it is a one-line command from another machine on the same broadcast domain. The whole protocol predates cloud computing by a decade and costs nothing.
The piece people miss is that Wake-on-LAN is a local-network tool, not an internet tool. The magic packet is broadcast at Ethernet layer 2, which means it does not cross routers. If you want to wake a machine in one VLAN from another, you either run a small daemon that listens on both sides, or you set up a directed broadcast rule on the router. For a home lab, the simpler answer is to keep one always-on “orchestrator” node (the router itself, or a tiny Raspberry Pi-class box) and let it forward wake commands where needed.
What I measure, and how
Before writing any automation, I measured. A single smart plug with a watt readout on each power-hungry branch of the rack for two weeks. The numbers were more honest than any spec sheet:
| Node | Idle draw | Under load | Hours/day actually used |
|---|---|---|---|
| Hypervisor tower | 95 W | 165 W | 6 |
| Storage appliance | 82 W | 120 W | 24 (required) |
| Network + router | 14 W | 18 W | 24 (required) |
| AI / GPU node | 145 W idle, fans on | 480 W | 2 |
| Backup appliance | 38 W | 62 W | 0.5 (nightly job) |
Total idle: 374 W. Total if every machine ran at my observed load profile for its actually-used hours per day: about 68 kWh per month. At roughly 35 ¢/kWh in my tariff, that is $24/month, which had been north of $80/month when everything idled 24/7. The delta is the room between “this hobby pays for itself in knowledge” and “this hobby costs me a streaming service every week”.
The AI node is the loudest vampire: idling a GPU box to do nothing is expensive, because modern GPUs refuse to fully power-gate while the driver is loaded. The right design is to keep that node fully asleep and wake it on demand.
The Action
Enabling Wake-on-LAN
Two sides to configure. In the BIOS, find the “Power” or “Advanced” section and enable Wake On LAN, Resume on PCI-E, or the vendor’s equivalent. Save. Reboot once so the firmware applies the setting.
On the Linux side, ethtool controls the NIC’s wake flags. Persist them through reboots with a tiny systemd service rather than a one-off command that forgets itself every power cycle.
# Find your interface name first.
ip -brief link
# Confirm the NIC supports WoL and see which flags are set.
sudo ethtool enp3s0 | grep -E "Wake-on|Supports Wake-on"
# Enable magic-packet wake. 'g' = wake on magic packet only.
sudo ethtool -s enp3s0 wol g
Wrap that in a systemd unit so the setting survives reboots:
# /etc/systemd/system/wol-on-boot.service
[Unit]
Description=Enable Wake-on-LAN on enp3s0
Requires=network.target
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ethtool -s enp3s0 wol g
[Install]
WantedBy=multi-user.target
sudo systemctl enable --now wol-on-boot.service
Waking the node from anywhere on the LAN
From any other Linux box on the same network, a magic packet is one command:
# On the "orchestrator" box. Replace with the target machine's MAC.
wakeonlan aa:bb:cc:dd:ee:ff
# Or, if you prefer the alternative:
etherwake -i eth0 aa:bb:cc:dd:ee:ff
Put that behind a shell alias you will actually use:
# ~/.bashrc on the laptop
alias lab-wake='ssh orchestrator.internal "wakeonlan aa:bb:cc:dd:ee:ff"'
alias lab-sleep='ssh hypervisor.internal "sudo systemctl poweroff"'
Two typed words bring the rack up; two typed words put it down. A month of using those aliases turned the AI node’s average duty cycle from 24 hours a day to under two.
What broke
The first automated sleep schedule killed a backup run. I had written a cron entry on the hypervisor that powered the AI node off at 01:00. The backup server, unrelated machine, was configured to pull virtual-machine images from the hypervisor between 02:00 and 03:00. That part worked. But the AI node also held a large local cache that the backup job was meant to snapshot via NFS. The snapshot arrived at an unreachable host. proxmox-backup-client logged a clean failure, an alert went to my inbox at 06:00, and the morning started with coffee and an apology email to myself.
The fix was the kind of thing you only learn by breaking it: order the sleep schedule against the backup schedule, not against the clock. I changed the cron entry to fire after the backup job signalled completion via a small file on the shared volume. If the backup had not finished by 03:30, the sleep entry skipped the cycle and tried again the next night. A two-line change; a lesson I now apply everywhere: power management must be ordered against the work, not against the wall clock.
The metric to watch
I built a tiny dashboard that reads the smart-plug meters once a minute and plots watts over a rolling 30-day window. The number I care about is not peak but the area under the curve. Cutting idle hours turns the graph from a flat plateau into a series of short spikes with long valleys between them. The plateau was $80/month. The spikes-and-valleys is $24. Nothing about the lab’s capability changed. Only its dwell time.
The homelab had stopped being a hot block that hummed at the wall. It had become a set of tools that turned on when I reached for them, and turned off again when I put them down. The fridge had finally learned its duty cycle.
Footnotes
-
Wake-on-LAN was standardised by the Advanced Manageability Alliance in 1998 and has been part of PCI/PCI-E power management ever since. Linux-side configuration lives in
ethtool(8); the magic-packet format is described in the Wikipedia entry for Wake-on-LAN. ↩