Powerd++

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
Hello,

Does anyone know if the following is possible:
  1. Installing and running powerd++ inside a jail? (I tried and I believe it won't work since it cannot get access to modifying cpu frequencies)
  2. Installing and running powerd++ inside the base OS? (My understanding is this is difficult to do because trueNAS should be treated as an appliance).

Anyone have any experience with this?

The reason I'm trying to use powerd++ is that my TrueNAS core system typically uses about 10% CPU. However, the overall load is greater than 1 CPU. Thus, powerd does not ever throttle a cpu down, even though every core is usually under 30-40% (most are under 10%). My understanding is that powerd++ will handle this better and result in thermal and power savings.

Specs in signature. Any input is appreciated!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Why don't you turn off powerd, try manually throttling your system down, and see if there's sufficient power savings to justify the effort?

Most vaguely modern CPU's are fairly efficient as it is, and you might not get the savings you are hoping for.
 

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
Thanks. I do get some good power savings, but throttling down permanently isn't a great option for me because I have some intermittent demanding tasks.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
So what's your baseline idle watts when running powerd, vs when throttled fully down?
 

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
Thanks for the responses jgreco. I really appreciate you taking the time.

I'm interested in trying out powerd++ on my system rather than troubleshooting whether it's worth the effort. It's a moot point if it's not possible anyway, right?

If there are other alternatives to powerd++ (powerd does literally nothing since it's locked to the first CPU core), you can let me know as well and I'll do my own research.

Again, much appreciated!
 

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
Answering your question nonetheless since you took the time to respond to mine:

Throttling from 2801 to 1200 gives me about 40-50 watts savings and a 10 degree temperature drop.

Regardless, I'd like to try out powerd++ on Truenas if that's technically possible. Thanks again!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I'm interested in finding out whether it is worth the effort. Since I know from past experience that powerd was really designed for mid-2000's CPU's that lacked the self-regulating power management functions of modern CPU's, and past experiments with powerd by forum users have not resulted in massive power savings, I am reasonably skeptical. Since I am not an employee of iXsystems or paid to do anything in relation to FreeNAS/TrueNAS, you are basically playing a game here to get me or someone else interested enough to go and look at this.

Throttling from 2801 to 1200 gives me about 40-50 watts savings and a 10 degree temperature drop.

Okay, that's sorta half the answer to half the question I asked. What does powerd throttle your system to when normally running? You can find this out by stopping the automatic "powerd" ("killall -9 powerd" is probably fine?) and then running it by hand ("powerd -v") with the -v argument. Let it run and just visually "average" it.

Because if powerd is already taking your system to a lower power state, there's a good chance that there isn't a lot of room for actual observed watt improvement.

You might be able to find a binary package of powerd++ for the equivalent version of FreeBSD, otherwise most other solutions are more complicated.
 

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
Thanks. Again, your answers are much appreciated.

Powerd is not running normally on my system. Thus, to run my test, I simply run a powerd command and observe the output.

My earlier answer was from running "powerd -v -n adaptive -a hiadaptive -b adaptive -m 1200 -M 1200" This resulted in the savings compared to my normal system (without powerd running). 1200 is the lowest clock cycle found from "sysctl -a | grep freq_settings"

Powerd running with default values "powerd -v" does nothing on my system. I see no power savings. This is because the calculated load demand exceeds that of a single thread (and also the mhz values are wrong). The output is something like: "load 328%, current freq 2801 MHz ( 0), wanted freq 5602 MHz" with varying values for the load. Nothing is ever throttled down because powerd throttles ALL the cores to the same value (see this writeup -- https://lonkamikaze.github.io/2016/04/07/powerdxx-better-cpu-clock-control-for-freebsd).

I'd like to try powerd++ because my load typically looks like the below image. According to the writeup I posted about how powerd++ works, one of the cores would be able to throttle down when it is idle, even though the other core may be working at 100%. This is not possible with powerd.

1645844247340.png


I'm able to install powerd++ in a jail, but it won't run due to permissions. (I've tried editing various jail permissions, including devfs ruleset, secure levl, and the other options that are available. My first question is directed at whether it's even possible to run powerd++ in a jail.

Powerd++ is available in freeBSD as a pkg. If it's possible to install on the base OS (I know that's not recommended) in a way that survives reboot, directions would be great. I've looked around already (extensively) for directions on installing packages on the base OS but the information is spotty.

Let me know if any other information would be useful!

Thanks again!
 

DATAstrm

Dabbler
Joined
Nov 24, 2021
Messages
14
So I'm not the guy that figured this out and didn't post a solution:

I managed to get powerd++ installed and running in a way that persists after reboot. I basically followed the directions here: https://www.truenas.com/community/threads/permanently-install-packages-onto-host-os.80352/

Steps included:
  1. Enabling FreeBSD repository (according to guide above)
  2. Downloading the pkg in fetch mode only (-F flag) (according to guide above)
  3. Copying it to /root (according to guide above)
  4. Creating a startup script to install and activate powerd++ on my main pool
  5. Script includes line to edit default rc.d powerdxx script command_args using sed
  6. Adding a system tunable enabling powerd++ as a service
Readings indicate an immediate, persistent 50watt saving and a 5 degree temperature drop under normal loads. Everything remains snappy since I get full cycles when needed. Nice!
 
Top