0

Blog on solariz.de - Tech & Thoughts · 1mo · discuss

This is a followup to my previous two articles, first My Homeserver is dying in slow motion and then the old box got replaced in My homeserver is new again…. One of the decisions I made is going Proxmox as Base instead of a bare metal linux with services. Way easier to maintain. But Proxmox by default isn’t built for powersaving at all. Powersaving Homeserver For many of you some kWh a day may not matter, but in Europe where I’m from the electricity prices are terrible expensive for homeusers. In my Region the average home user price per kWh is about 0.38 EUR. So cumulated over the whole year this can make a difference, this is also why the general usage of Devices and standby here is way different compared to some Friends in US or some Asian countries. If I go to Dinner or just 20min to the local market nearby I normally shutdown my desktop. Even if it would be way more convenient to just keep it running. But on my desktop even in idle this is easy alot of Watts a year I could save. For the new Homeserver the saving potential is not that critical, because the new one already consume less than the old one, but after some weeks of running proxmox on the new Hardware I realized it is still around 42W even in absolute idle times like 3 AM. Time to check why… For the Background, I run a setup with a ZFS pool on 3 Spinning HDDs with one SATA SSD for cache and M2 NVMe drive for the OS and another one for some experiments non critical fast VMs. So usually the NVMe and Sata SSD you do not need to care, but having 3x WD Red’s in my Pool can drive the power up. Reducing Proxmox Powerconsumption Well Proxmox is Linux at the end, a Debian 13 Trixie to be more precise. So why not looking where I normally would look. Spindown time of the HDDs first, CPU governor, potential other power toggles. The Status Quo quickly showed that Proxmox wants performance not powersaving. All settings by default priorizing performance over efficiency. This is of course not optimal for my Idea of a powersaving homeserver. So I checked: governor: performance epp: power driver: acpi-cpufreq eee: off wifi+bt: on nmi_watchdog: on Ok first I tried to set governor to powersave, changing the driver to force AMD pstate, hdparm all spinning disks to spindown after 10 Minutes of no activity. This quickly showed promising results. As you can clearly see after the setting changes the Powerconsumption dropped from ~42W to ~22W which is in percentage a huge difference. This is about 175.20 kWh saved / year which sounds not much but this is more than 60€ a Year for just some settings changed. Of course the system is not idle 100% a Year, so the actual saving will be less. Automating it Of course I do not want to re-apply those things after each reboot. So I decided to create a small bash script which handle all powersettings for my specific hardware to go to powersave or balanced. It will be started after each reboot automatically and re-run every day at 11 PM via a simple cron. The Script is mostly built to be dynamic and unspecific so it should run well on any proxmox installation, but tested only with my Homeserver Hardware at home. As for every script from the big internet, check it before you run it. #!/bin/bash # pve-powersave.sh # # Re-applies my idle power settings on the Proxmox box # (Ryzen 7 5825U, PVE 9 / Debian 13). Everything here is a runtime # sysfs/ethtool/hdparm setting, nothing survives a reboot, so run it # at boot (systemd oneshot or cron @reboot) and re-run whenever you like. # # pve-powersave.sh apply everything # pve-powersave.sh --status just show what is set right now # set -u PATH="/usr/sbin:/usr/bin:/sbin:/bin" # ---- knobs, change here ------------------------------------------------- EPP="balance_power" # power | balance_power | balance_performance ASPM="powersave" # powersupersave broke a NIC for me once, stay here SATA_LPM="med_power_with_dipm" HDD_STANDBY=180 # hdparm -S: 120 = 10 min, 0 = never spin down HDD_APM=127 # 1-127 allows spindown, 128+ does not EEE=1 # set to 0 …