Stop your CPU frequency governor from lying to your applications
By Saket Jain Published Linux/Unix
Stop your CPU frequency governor from lying to your applications
Technical Briefing | 10/11/2026
You spend hours optimizing your application code, only to find that latency spikes during traffic bursts for no apparent reason. You check top, check iostat, and everything looks sane. But under the hood, the CPU frequency scaling governor might be jittering between P-states because it thinks your server is idling during the milliseconds between requests. This bit me hard on a fleet of database nodes where the transition latency was high enough to cause queue depth spikes.
Why the powersave default is often a trap
Most server distros default to powersave or schedutil governors. These are designed to be green, not fast. The governor monitors CPU load and shifts frequency accordingly. When a burst hits, there is a physical delay while the silicon scales up. On modern hardware, this is fast, but it is not free. If you have low-latency requirements, this constant hunting for the right frequency is the last thing you want.
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do echo performance > $cpu/cpufreq/scaling_governor; done
- Use the performance governor to lock the clock speed to the max base frequency
- Verify your changes persist after reboot as many cloud images reset this on startup
- Check /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq to see if it actually stuck
Don’t blindly apply this to every machine in your rack. If you are running static, low-utilization monitoring agents or simple web frontends, you’re just wasting power and increasing heat for no performance gain. But for your database nodes or high-concurrency caches, pinning the frequency is often the difference between a smooth 5ms response and a jittery 50ms tail latency spike. Test it under load before and after, then keep the graphs on your dashboard to prove it actually helped.
