Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

ResponsiveLinuxDesktop

Prevent Desktop GUI from sluttering under high load

Step 1 - Choosing a Desktop oriented CPU Scheduler

What's a CPU scheduler anyway ?

The scheduler is responsible for keeping the CPUs in the system busy. The Linux scheduler implements a number of scheduling policies, which determine when and for how long a thread runs on a particular CPU core - Source.

How does changing the default scheduler improve desktop responsiveness?

The default CPU Scheduler in Linux is CFS, which gives every process a fair share of processor time. Which is exactly what we don't want in a Desktop. A Background CPU eater process shouldn't get a fair share of processor time while compromising the GUI responsiveness.

What's the solution? How to do it?

Switch to a CPU Scheduler specifically designed for desktop use cases. scx_lavd is one such CPU Scheduler, which is very easy to set up as well, thanks to SCX.

  1. Install scx for your Distribution.
  2. sudo nano /etc/default/scx to configure SCX_SCHEDULER=scx_lavd
  3. sudo systemctl enable --now scx.service

What's the result?

Test it yourself? Hammer your CPU while playing a YouTube video in the background in Firefox, Open Webgl acquarium in another tab.

stress-ng --cpu 0

Now watch the CPU utilization in your favourite System Monitor software or top, while Firefox and your Desktop Environment is fairly responsive.

Why not BORE?

Difficult to setup than SCX, at least in openSUSE. Maybe it is readily available with a custom kernel in your distro in the form of linux-zen or something?

Step 2 - For NVME Root Drives and Under 16 GB RAM

Set up ZSWAP while keeping swappiness (60) and vfs_cache_pressure at the default settings.

About

Prevent Linux Desktop GUI from stuttering and lagging under high load

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors