Modern Intel CPUs employ a technology called TurboBoost which works in conjunction with Intel’s SpeedStep technology to temporarily overclock specific cores (sometimes at over 2x the advertised speed) when thermal and power limits allow.

SpeedStep is the selective and rapid slowing down, idling and possibly even sleeping of cores which are not being used or used much. This increases the power and thermal windows for TurboBoost to work effectively as slowing down/idling little-used cores means more thermal dissipation and power to boost busy cores with. Much like HyperThreading, windows of opportunity quickly close and open, and the CPU and OS work in rapid conjunction to calculate and exploit them.

TurboBoost will not engage if SpeedStep information is not being received from the OS, so it is crucial to enable the powerd(8) service and ensure that SpeedStep is performing properly. For the latest Xeon processors (for example the E5-2620s) this nets over a 12% performance gain because these newer CPUs are heavily optimized for TurboBoost, but it can’t engage without SpeedStep.

If your work load is bursty in nature, or you have a few applications or services which tend to only use a few cores, the practical performance increase can be much higher than this.  The 12% increase figure was taken via UNIX Bench and completely loading all cores during testing. Lots of hosting providers turn off power management in the BIOS which can result in SpeedStep not being properly recognized by FreeBSD even if powerd is enabled. In dmesg boot if you see lines similar to this:

est: CPU supports Enhanced Speedstep, but is not recognized.

Power management must be enabled in the BIOS. Using AMI’s server BIOS as an example, the option is located under the Advanced tab, then go to CPU Configuration and then CPU Power Management Configuration and set Power Technology to “Energy Efficient” and then Energy/Performance Bias to “Performance”.  Each BIOS is different obviously so some poking around might be needed for your servers. You can verify this change has worked by checking that the kernel recognizes SpeedStep:

# grep -i speedstep /var/run/dmesg.boot
est0: <Enhanced SpeedStep Frequency Control> on cpu0
est1: <Enhanced SpeedStep Frequency Control> on cpu1
est2: <Enhanced SpeedStep Frequency Control> on cpu2
est3: <Enhanced SpeedStep Frequency Control> on cpu3
est4: <Enhanced SpeedStep Frequency Control> on cpu4
est5: <Enhanced SpeedStep Frequency Control> on cpu5
est6: <Enhanced SpeedStep Frequency Control> on cpu6
est7: <Enhanced SpeedStep Frequency Control> on cpu7

And of course enable powerd by adding these lines to /etc/rc.conf:

powerd_enable="YES"
powerd_flags="-a hiadaptive"

This turns on powerd and sets it’s bias to be high performance, but not “max performance” which is deceptive.  Max performance simply locks all cores to the max frequency, which we want to avoid as we want cores to be able to slow down as needed. The key is that both these BIOS changes need to be made and powerd needs to be enabled otherwise there is no gain (we tested it … a lot).

Our extensive testing showed that for the newer Xeon CPUs this always nets a significant (12% or more) gain via UNIX Bench.  At worst for older CPUs the results are the same, so there is no down side to doing this.

Enjoy a free and easy performance boost!

Call 1-828-376-0458 to Work With Professionals Who Truly Understand FreeBSD

A-Team Systems is a proud supporter of the FreeBSD Foundation and many of our administrators are direct project contributors.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.