Get Better Desktop Responsiveness Under Heavy CPU Load Using CFS Zen Tweaks

CFS Zen Tweaks is a bash script and systemd service that tweak the Linux CPU scheduler for better desktop responsiveness when under heavy CPU utilization.

The default kernel settings are not tweaked for desktop usage, with high throughput being prioritized over latency, notes the CFS Zen Tweaks author. This results in a less responsive desktop under heavy CPU load. Using CFS Zen Tweaks, you should notice an improved desktop responsiveness - for example, its author mentions that before using this, YouTube would lag while compiling code, and that's no longer the case using the CFS Zen tweaks.

The CFS Zen Tweaks project adjusts the default kernel CPU scheduler (CFS or Completely Fair Scheduler) for better desktop responsiveness. The CFS CPU scheduler settings come from Linux ZEN kernel, which was created to provide a better Linux kernel for everyday systems. 

Note that only the CFS CPU scheduler tweaks are used from the ZEN kernel, while this custom kernel also has other tweaks.

The advantage of using these tweaks over installing a custom kernel is that you get to keep your Linux distribution's official kernel packages (so you get official updates and there's no risk of breaking stuff).

It's important to note though, that using these tweaks will increase the battery drain on laptops, due to more context switches.

Download CFS Zen Tweaks

CFS Zen Tweaks is packaged as a DEB (for Debian, Ubuntu, Linux Mint, Pop!_OS, etc.), RPM (Fedora), and it's also available on AUR for Arch Linux / Manjaro users. If you just want the script and systemd service, visit the project GitHub repository page. To use it, you'll need bash, gawk, and systemd to apply the settings on boot (these will be installed as dependencies if you're using the prebuilt packages).

After installing the package, enable the tweaks to be applied on boot (and apply them right now) by using:

systemctl enable --now set-cfs-tweaks.service

via Reddit; Tux image via Wikipedia