Am 20.11.2022 12:06, schrieb Schwibinger Michael:
To avoid problems by surfing
I tried
nice.
No good enough.
I did try
nice -n 19 chromium-browser
cpulimit -e chrome -l 30
But this also did not work,
cause URLS do open other URLs.
I found this.
2 Questions:
What does it do?
Why does it not work.
# Find and limit all child processes of all browsers.
for name in firefox firefox-esr chromium chrome
do
for ppid in $(pgrep "$name")
do
cpulimit --pid="$ppid" --limit="$LIMIT" &
for pid in "$ppid" $(pgrep --parent "$ppid")
do
cpulimit --pid="$pid" --limit="$LIMIT" &
done
done
done
(sorry I have not read the whole thread but as some hint for this
specific task:)
Probably the best solution may work on cgroups, limiting not only single
processes but groups of processes, including subprocesses created later
on. This way it's possible not only to limit several processes to some
value for their own but to have several processes combined not to exceed
a limit.
For example if all firefox processes share a cgroup which is limited to
512 cpu.shares, while all other processes in the system have their
default 1024 cpu.shares, firefox (in a whole, with all subprocesses)
will be limited to ~30% CPU time if any other task wants to access the
CPU.
But ad-hoc I do not have a working command example (cgcreate, cgset,
cgexec, ...).
hede