On 2022-11-20, Schwibinger Michael <h...@hotmail.com> wrote: > > 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 > > Regards Sophie
I suppose it does what it says in the comment at the front, and fails to work because you need to define $LIMIT beforehand. -l, --limit=N percentage of CPU allowed from 1 up. Usually 1 - 100, but can be higher on multi-core CPUs. (mandatory) # cpulimit -l 20 firefox Launch Firefox web browser and limit its CPU usage to 20%