I’ve noticed that the my Intel Xeon E3-1230 v2
CPU runs at the maximum frequency on my TrueNAS Core, even at negligible load. This post describes how to
powerd daemon to shave off a few watts of idle power by allowin the frequencies to scale.
- Advanced configuration
You can monitor the CPU frequency by watching the
cmdwatch -n 1 sysctl dev.cpu.0.freq
powerd -v in the elevated shell. If you go this route – stop the monitoring before
proceeding, otherwise the actual service won’t start – it will think powerd is already running,
which is not wrong.
You may notice the frequency is pegged at max all the time; this is what we are going to fix today.
All you really need is read
man powerd and enable the RC Tunable in the TrueNAS UI to configure
the power management policy and launch the service at startup by adding the following two lines to
powerd_flags="-b min -a adaptive -n adaptive"
powerd to set performance to
minimum when battery is connected, and to
mode when on AC power, or when the power status is unknown.
Don’t directly edit the file, as the changes will be lost on restart; instead add the configuration
Tunables in the TrueNAS UI.
To add each variable, under
Add, input the variable name, value (sans quotes) into the
appropriate boxes, select type
rc.conf from the pull down, write some meaninful description,
Enabled flag on.
These changes will take effect upon reboot. To start the service in the current sesion and avoid rebooting, configure and start the service manually this one time:
sysrc powerd_flags="-b min -a adaptive -n adaptive"
service powerd onestart
Revisit Observation and confim that the clock is now being scaled properly.
Minimum and maximum frequencies
man powerd. Of interest are
-M flags that limit minimum and maximum
frequencies to throttle to.
-M freq Specifies the maximum frequency to throttle up to.
-m freq Specifies the minimum frequency to throttle down to.
The supported frequency ranges of your CPU are reported in the
% sysctl dev.cpu.0.freq_levels | tr " " "\n"
-M 2400 to the
powerd_flags would not be a bad idea?
Another useful flag worth considering is
-N Treat "nice" time as idle for the purpose of load
calculation; i.e., do not increase the CPU frequency if the
CPU is only busy with "nice" processes.