How do I change CPU scheduler?

I don’t know your problem, but as I see it, it’s a bigger issue.

Let me ask you. What is happening to your CPU that you are having such performance problems? Stuttering voices or longer pauses when performance is lacking are nothing unusual, but stopping in the sense of “stop”?

Playing with priority per process is a bit like playing the lottery sometimes. Not every process likes being degraded.
A lower priority does not always mean that overall performance will improve. If there is an extreme lack of CPU resources, even -20 will not help much.

Personally, I set the governor to performance.
But if you have a large process that takes up your CPU and you want to limit this process a bit, you can always run it on a limited number of cores (taskset -c 0,1,2), and lighter processes only on released cores. For me, this always gives better system/application responsiveness than changing the priority.

To change the governor, you can use cpupower and if you use gui, additionally cpupower-gui. Also make sure that the CPU always runs at the appropriate clock speed and does not go to a lower clock speed.

If the core of the problem is running Firefox, and it overloads the machine so much that the sound stops, then you either have extremely old hardware or something very wrong with the OS.

Maybe you have other processes that are loading your CPU/disk, or you’re low on RAM?
Restore FF to factory settings, new profile, maybe some component generates load.

Are you on the stable version of FF? Check how the ESR behaves.
Run ff limited to the last core taskset -c X firefox (X the number of your last core counting from 0) and watch what happens…

PS
I read your other thread about this matter and… look what happens to the resources when the anomaly starts. Although with HDD it’s not that impossible.

When you run out of free RAM and swap comes into play or it doesn’t exist at all in the case of the hdd, it’s theoretically possible that something is lagging.

Contrary to appearances, the lack of swap with a small amount of memory on a loaded machine with a modern OS can be very lagging. I would rather use a small amount of swap. Also remember that FF eats some memory.

Or it’s time to invest in an SSD.

PS2
You can also experiment with FF variables and try to limit hdd usage mainly for cache. Personally, however, I have never noticed the difference.

1 Like