Limit CPU Usage for all processes
I am trying to find a way to limit all processes to use a maximum of 90% of the CPU. I know I can use cpulimit to limit one specific process, but I would like to have this for every process, automatically.
E.g. I open 25 tabs in the morning to check several news sites, and the system simply gets stuck for about a minute. I want to keep it responsive, and therefore have to reduce CPU usage (that's the bottleneck).
Any help or idea would be appreciated, thanks!
About this post
- Posted
- Archived
- Score
- 2 · 100% up
- Kind
- Text
- ID
- 77eb7k
9 comments
In theory, your scheduler should already do that. In practice, CFS sucks for desktop use and nothing will make the system actually snappy.
Linux-ck contains a different scheduler, MuQSS, that's optimized for desktops and should help with your particular use case.
Thanks for the hint, I am already using linux-zen, (also for responsiveness), but under high load it is far from perfect. I think I'll linux-ck a try!
Still, I am a bit confused by your argument, a scheduler or CFS as one of them is regulating the IO not the CPU to my knowledge?
Zen apparently includes MuQSS too, so check if it's enabled. If that doesn't improve things, well… not much you can do.
CPUs and I/O both need schedulers; CFS is the standard CPU scheduler in Linux, and CFQ the standard I/O queue scheduler. -ck replaces the former with MuQSS (successor to BFS) and the latter with BFQ.
Also consider looking into how to use cgroups to control resource usage across users.
I might be wrong, but limiting all process to 90% might worsen the problem. Wouldn't it be like if you have a 10% slower CPU?
Have a read:
http://www.akitaonrails.com/2017/01/17/optimizing-linux-for-slow-computers
https://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that
Just an FYI, I am running linux-ck now since 4 day with MuQSS - and it is f*cKING amazing O.O My t440s (2013) feels as responsive as the Macbook Pro 13 (2015) I use at work - under 100% load. The MuQSS scheduler is absolutely amazing, this should be the default for every non-server installation!
Huge thanks to /u/Creshal !