cpulimit
节流的语法是什么?请注意和Web Content
之间的空格。Web
Content
top - 09:16:00 up 1:09, 2 users, load average: 1.80, 1.70, 1.77
Tasks: 215 total, 2 running, 213 sleeping, 0 stopped, 0 zombie
%Cpu(s): 50.9 us, 3.1 sy, 0.0 ni, 45.8 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st
KiB Mem : 2038672 total, 555984 free, 890712 used, 591976 buff/cache
KiB Swap: 2084860 total, 1660224 free, 424636 used. 874444 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4990 thufir 20 0 1448076 515220 78576 R 92.7 25.3 14:42.98 Web Content
3797 thufir 20 0 1280048 272272 65268 S 11.6 13.4 5:23.12 firefox
错误:
thufir@doge:~$
thufir@doge:~$ cpulimit -z -b -l 22 -e web content
Error: You must specify exactly one target process
thufir@doge:~$ CPUlimit version 2.1
Usage: cpulimit TARGET [OPTIONS...] [-- PROGRAM]
TARGET must be exactly one of these:
-p, --pid=N pid of the process
-e, --exe=FILE name of the executable program file
The -e option only works when
cpulimit is run with admin rights.
-P, --path=PATH absolute path name of the
executable program file
OPTIONS
-b --background run in background
-c --cpu=N override the detection of CPUs on the machine.
-l, --limit=N percentage of cpu allowed from 1 up.
Usually 1 - 200, but can be higher
on multi-core CPUs (mandatory)
-q, --quiet run in quiet mode (only print errors).
-k, --kill kill processes going over their limit
instead of just throttling them.
-r, --restore Restore processes after they have
been killed. Works with the -k flag.
-s, --signal=SIG Send this signal to the watched process when cpulimit exits.
Signal should be specificed as a number or
SIGTERM, SIGCONT, SIGSTOP, etc. SIGCONT is the default.
-v, --verbose show control statistics
-z, --lazy exit if there is no suitable target process,
or if it dies
-- This is the final CPUlimit option. All following
options are for another program we will launch.
-h, --help display this help and exit
q
The program 'q' can be found in the following packages:
* python-q-text-as-data
* python3-q-text-as-data
Try: sudo apt install <selected package>
thufir@doge:~$