On 05/27/18 13:07, Maximilian Pichler wrote:
Is it possible to limit the CPU usage of a given process to, say, 20%?

I'd like to slow down the web browser since it is draining my laptop's
battery. With enough tabs open it's often consuming ~50% of CPU but
not doing anything productive. Apparently with RLIMIT_CPU in
setrlimit(2) the total CPU time of a process can be limited. Can a
similar limit be set for the percentage?

Honest question… Have you tried blocking ads with something like uBlock Origin? I use several approaches to make web browsing palatable on old hardware, and blocking ads is what makes the biggest difference for me. (Using NoScript or equivalents to selectively enable JavaScript for sites where I actually need it is a distant second.)

Capping CPU resources is not the way to go on a laptop in my opinion, unless you have some demanding job that always runs in the background in your browser, and that's a problem by itself in your scenario. Capping will not change the fact that you'll still spend the same resources on loading web pages, however it will slow you down and annoy you.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to