🔥 R710 quieter

Summer is coming and my R710 server, is ... quite noisy. Fans become disturbing at 4k RPM, and ...

firefox_2018-07-07_15-03-50
5.2k RPM !

I get fan info from iDRAC, with another machine, i'll make an article if you ask

I decided to investigate how to make him more Silence-I-Kill-You !

Grab the temp

My first problem comes from iDRAC : I can't grab the CPU temp info from it

putty_2018-07-07_15-13-51

My first thought was it was an hardware problem and I didn't want to spend so much time on it. A friend advised me to try lm-sensors, so I installed it :

apt-get install lm-sensors
after the installation, run
sensors-detect
Follow the instructions to detect your hardware, this will search for all the sensors that could be available on your machine.

A simple sensors command and ...
The_Greatest_Showman_TADA
We got the core temp !
firefox_2018-07-07_15-23-14
Only need the highest value, so ... cut/grep/sed
firefox_2018-07-07_15-31-13
Final command : sensors|grep high|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p

So, I can :

  • Grab CPU temp
  • Grab highest CPU temp

Reduce fan speed

I can set the fans to manual mode with :
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null

And change the fan speed to 3.2k with
ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x13 >> /dev/null
and 3.6k with ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x17 >> /dev/null

So, I can :

  • Set my fans to manual
  • Change the fan speed

Put everything in scripts

Here's my final version :

#!/bin/bash

# Read the max CPU temp from sensors (lm-sensor) 
tempCpu=$(sensors|grep "high"|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p)
# Define CPU limie

# Set variables

host="idrac01.pla01.lbdg.lan"
user="ipmi_read"
password="ipmi_read_password"

minCpu="50"
medCpu="56"
maxCpu="61"

if [ $tempCpu -le $minCpu ] ; then

	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x13 >> /dev/null
	# Set to 3200 RPM

elif [ $tempCpu -le $medCpu ] ; then

	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x17 >> /dev/null
	# Set to 3600 RPM

elif [ $tempCpu -le $maxCpu ] ; then

	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x00 >> /dev/null
	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x02 0xff 0x20 >> /dev/null
	# Set to 5000 RPM

else
	# Let the server decide
	ipmitool -I lanplus -H $host -U $user -P $password raw 0x30 0x30 0x01 0x01 >> /dev/null

fi

/etc/telegraf/cpu_temp.sh

The script uses LAN communication, because, I use non-root user to send the ipmitool command.
The user ipmi_read was created in the iDRAC settings, and only have right to write / read commands on ipmi :
firefox_2018-07-07_15-47-36

Run the script every 30 seconds

The script is one time execution, so I decide to schedule it every 30 seconds.
The best way to run this script every 30 seconds is to use my existant telegraf agent, so, I could set an execution interval :

[[inputs.exec]]
  commands = [
    "/etc/telegraf/temp_fans.sh"
  ]
  interval = "30s"
  timeout = "14s"
  data_format = "influx"

Graphical result : when reach 51°C, fan goes 3700 RPM
firefox_2018-07-12_17-42-24

Bonus

And you might notice the /etc/telegraf/cpu_temp.sh at the end, this is a script that formats data to be sent to InfluxDB :

#!/bin/bash

tempsCpu=$(sensors|grep high|cut -d "+" -f2|cut -d "." -f1)
echo -n "hardware_info,host=idrac01.pla01.lbdg.lan "

c=0
for tempCpu in $tempsCpu ; do
	if [ $c != 0 ] ; then
		echo -n ",core$c=$tempCpu"
	else
		echo -n "core$c=$tempCpu"
	fi
	c=$(($c + 1))
done

max_cpu=$(sensors|grep "high"|cut -d "+" -f2|cut -d "." -f1|sort -nr|sed -n 1p)
echo -n ",core_max=$max_cpu"

And, displayed with grafana (orange and blue lines)
firefox_2018-07-07_15-55-14

Results

firefox_2018-07-07_15-55-34
The problem is : with less noise from the server, I can hear my neighbour noise T-T