r/linuxquestions • u/beertown • 20m ago
Run processes at the lowest priority possible
Hi all! I have a little question for you.
Let's say my machine has 4 cores (4 physical and logical cores, no hyper-threading). I want to run 5 cpu-bound processes, but one of them should get CPU only when there's some to spare. I'm expecting seeing in top something like this:
process-1 99.9% cpu
process-2 99.9% cpu
process-3 99.9% cpu
process-4 99.9% cpu
process-5 0.4% cpuAll my processes are commands started from different terminals on my desktop.
On Ubuntu 22.04 (Linux 5.15.0) I can achive this setting sysctl kernel.sched_autogroup_enabled=0 and running my process 5 with nice -n 19. Works great.
Now I'm moving to Ubuntu 26.04 (Linux 7.0.0) and this doesn't work anymore, all my processes get 80% CPU no matter the niceness value.
I tried running process 5 with chrt --idle 0 , it has some effect but nowhere near what I'd like.
Why I want to to this? Because I regularily run many different cpu-bound workloads in different terminals, and I want some of them finish as soon as possible (normal priority), and others can last longer and I prefer them not to interfere (lowest priority) as long as there are normal priority processes running.
Is there a way to have truly low priority processes on recent kernels?