The cron job that saves you money - but is there a catch?

In my search to reduce the power consumption of my homelab TrueNAS box, I have come across the ‘cpupower’ command. However, this doesn’t seem to persist between reboots. So, as an experiment, I have added a cron job to force the lower power configuration at an hourly interval - so far, so good! It’s dropped from 95W to 72W average power draw. I have not noticed any issues with performance or reliability. But am I missing something? Is this safe to do?

1 Like

What you are doing here is simply changing the power settings of your CPU. This could be done via BIOS as well but this way it is more dynamic. This can’t[1] hurt your system. Remember that newer CPUs might ignore those settings. Arch Wiki has some good information on other settings you can try like powersave:


  1. Shouldn’t. There are absolutely no absolutes in IT. ↩︎

3 Likes

Thanks for the reassurance (caveat noted!).

It is an old CPU (2012-ish AMD A10-6790K), so not the most efficient and every little helps.

Good point about it being more dynamic than a BIOS setting. I might look into scheduling an even lower power setting overnight when it will be mostly idling.

You can also specify this as a one-time POSTINIT initscript instead of a cron job - I don’t think anything in the system will try to change it back after the system is up and running.

Only saves maybe 3 watts in my small home NAS setup taking maybe 30W in total (hard to tell exactly as it is not the only device on that meter) but yeah, why not :slight_smile: The tips of the short power consumption spikes dropped by 20W and the CPU runs 3 °C cooler. :+1: Let’s see whether there will be some perceived performance drop (probably not, this is mostly a backup target and a metrics collector, so rarely something interactive).

2 Likes

Yes, I think your suggestion of the Init script would be a better option than calling an hourly cron job.

But, I’ve actually changed it now to two cron jobs - one that sets the ‘powersave’ state at midnight and another that sets ‘conservative’ at 7am.

From what I read in the archlinux link above, the ‘powersave’ state caps the processor speed at its minimum. The only jobs that I have running overnight are housekeeping tasks. I am not particularly bothered about how long they take, so quite happy to keep the CPU performance throttled to save power. But during the daytime, I would like to benefit from increased performance when doing interactive tasks. We shall see over the next few days whether this results in any worthwhile energy saving (I’ve got a Tapo P110M monitoring the energy consumption).
edit: the ‘powersave’ setting has saved me another 5W on the power draw average overnight, small but worthwhile keeping.