How To Speed Up Linux Ubuntu and Debian Based Computers By Improving CPU Performance and Changing the CPU Governor

I used to believe that for Desktops especially that the "ondemand" CPU frequency changing that kernels included with Ubuntu and Debian based distros have would be sufficient for snappy performance.

However, you can feel the lack of performance on the fastest computer if you have ondemand.  A lot of times even under high load 100% of your CPU frequency in MHz will not be used.

For example a 2.8Ghz CPU may only run at 1.8MHz or even .9GHz.  Now the frequency will scale up under high load but you can feel things in the OS aren't as snappy while you wait for the ondemand governor to increase the performance.  This can especially cause choppy sound and video if you are conferencing.

The solution is to change the governor to "performance" so the cores always run at the highest frequency.

How To Check Your CPU Performance Governor Settings

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

ondemand

In this case it is already set to ondemand which is generally the default slow performance mode.

If you do this you will see your CPU is set lower in frequency:

cat /proc/cpuinfo |grep MHz
cpu MHz        : 900.000
cpu MHz        : 1200.000
cpu MHz        : 1400.000
cpu MHz        : 1100.000
cpu MHz        : 1000.000
cpu MHz        : 980.000
cpu MHz        : 1112.000
cpu MHz        : 1484.000
 

How Do We Fix CPU Performance

The below will set up to 100 CPU cores to performance mode.  Just change the 99 to higher number if you have more cores than 100.

for i in {0..99}; do echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor; done

Conclusion

Setting CPU governor to performance makes a huge difference in the responsiveness of your computer.

A lot of times you may falsely believe your CPU is underutilized when checking the current CPU frequency or top but it is kind of like "auto" settings on your GPU.  By the time the frequencies are adapted you may have usage issues such as audio cutting out and lag in video conferencing due to CPU throttling

After doing this I observed apps that were using 150% CPU go down to 85% CPU

So a lot of times the lack of optimized governor that doesn't scale to the highest frequency will make it seem like your PC is not powerful enough when that's not the case.


Tags:

linux, ubuntu, debian, improving, cpu, governori, desktops, quot, ondemand, frequency, kernels, included, distros, sufficient, snappy, fastest, mhz, ghz, os, aren, choppy, conferencing, cores, settings, sys, devices, cpufreq, scaling_governor, generally, default, mode, proc, cpuinfo, grep, echo, responsiveness, falsely, underutilized, auto, gpu, frequencies, adapted, usage, audio, lag, throttling, observed, apps, optimized, doesn, pc,

Latest Articles

  • Huion and Wacom Tablets How To Install in Linux Mint / Ubuntu and make the stylus work properly
  • ffmpeg how to cut certain parts of video out
  • ffmpeg how to concat and join two video clips
  • mencoder instead of ffmpeg to join or concatenate video files with different audio streams
  • Linux How To Stop Missing Drive from Halting Boot Process in fstab
  • How To Replace Audio Track of Video using ffmpeg
  • qemu-img convert formats vdi vmdk raw qcow2
  • Linux and Windows Dual Boot Crazy Time Issues
  • dynagen / dynamips 100% high CPU usage solution - how to set the idlepc value
  • How To Setup a Cisco CME (Cisco Manager Express) Virtual Router under Linux using dynamips and dynagen
  • Linux Mint Ubuntu Debian CentOS Dual Boot Install Issues
  • Linux Mint Ubuntu Debian Centos RHEL no sound solution
  • Linux Mint/Debian/Ubuntu/Centos Installer black grub screen and blank screen after trying to boot installer or main OS
  • Linux Mint Dual Boot Install Avoid Wiping our your Main C: drive /dev/sda MBR and EFI
  • QEMU-KVM soundhw deprecated how to enable sound in QEMU 4.x series
  • Virtualbox Error Cannot register the hard disk because a hard disk with UUID already exists solution
  • kernel: [549267.368859] mate-terminal[7871]: segfault at 2000000101 ip 00007f5d0a9548f0 sp 00007fff7012c610 error 4 in libgobject-2.0.so.0.4800.2[7f5d0a920000+52000]
  • apcupsd how to setup and monitor APC UPS units
  • How To Password Reset, Recover, Bypass, Remove and Unlock on Windows 10,8,7,Vista,XP,NT,2000,2003,2008,2012,2016,2019 Administrative Login Programs
  • Nvidia Ubuntu Linux Screentearing Video with solution driver