/better-fanoverlord

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

FanOverlord

(Better) FanOverlord

This is a Docker container that uses IPMI to monitor and control the fans on a Dell EMC Poweredge server through the iDRAC using raw commands.
This script will read the CPU temp sensor repetitively and then adjust the fan speed according to a user-defined function.
The script is based on orlikoski's project fanoverlord.

Why not let BIOS manages the fan speed?

This script actually manages to achieve lower power-efficiency than the default dell bios does. With the power of user-defined function, you can cutomize fan speed in different scenarios.

Also, in some models (like my R720xd) the bios actually functions incorrectly after plugin addtional PCI-E device such as a graphics card, see this, this and this

What if the script fails?

The script will give back the fan control to BIOS when force exit or malfunction.

Configure iDRAC

Choose Your TEMP-RPM Function

To make your fan speed adjustment as smooth as possible, you should choose a function that maps the relationship between CPU temperature and fan speed. The function is expected to have these features:

  • Continous - So the transition is smooth
  • Monotonically increasing - So the temperature always converages

The default function is , where s is fan speed and t is temperature.

This function works well when temperature is between 30 degrees and 80 degrees, and provides optimal power consumption in this range.

Choose your time condition

TIME_COND is an argument that sets the condition when fanoverlord should enabled according to time. This is to suit different usage senarios. For example, I only want fanoverlord to be enabled when I'm asleep to lower the fan noise to minimum, but I want the system manages fan for me at day for tasks with heavy CPU consumption.

Therefore, I can set the following enviroment variable:

-e TIME_COND="t.hour in [23,0,1,2,3,4,5,6,7,8,9]"

Notice that, t equals to datetime.now().time(), and only when the condition evaluates to true, fanoverlord is enabled. Otherwise fanoverlord gives control back to system and wait one miniute to check again.

If you don't care about time conditon and want fanoverlord to be always enabled, set TIME_COND to 1 to always enable fanoverlord.

Pull the image and Start the container

To pull the image:

docker pull https://hub.docker.com/r/justinhimself/better-fanoverlord

To start the container:

docker run \
    --name better-fanoverlord \
    --restart on-failure \
    --network host \
    -e TZ=Asia/Shanghai \
    -e CPU_NUM=2 \
    -e IPMI_HOST="192.168.0.120" \
    -e IPMI_USER="root" \
    -e IPMI_PW="calvin" \
    -e SPEED_FUNC="tanh((t-55)/10)*40 + 50" \
    -e TIME_COND=1 \
    -d justinhimself/better-fanoverlord