CPU governor is “performance”, but CPU frequency is low

It is important for a block producer node that the CPU is running at highest available frequency, so that block signing happens as fast as possible. As explained here,

Modern processors scale the CPU frequency, even in performance mode and as a function of the depth of the idle state they go into. If you really want to lock the CPU frequency then disable all idle states deeper than 0. However, note that it will cost a huge huge amount of power.

so, a server with “Intel(R) Xeon(R) CPU E5–1620 v4 @ 3.50GHz” was set to “performance” governor, but still the current frequency was 1.2GHz. The following commands help disabling the idle state at server startup, letting the CPU run at highest available speed:

# set "performance" as default governorapt-get install -y cpufrequtils
echo 'GOVERNOR="performance"' | tee /etc/default/cpufrequtils
systemctl disable ondemand
systemctl restart cpufrequtils

# test that the command works. If needed, install required
# packages, such as
# linux-tools-common linux-tools-4.15.0-65-generic
cpupower idle-set --disable-by-latency 0# make systemd run it at startup:
cat >/etc/systemd/system/disable_cpu_idle_states.service <<'EOT'
Description=Disable idle CPU states
ExecStart=/usr/bin/cpupower idle-set --disable-by-latency 0
systemctl daemon-reload
systemctl enable disable_cpu_idle_states
# if everything went well, reboot

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store