修改进程优先级
chrt
- 具体细节查看man
chrt -r -p priority pid ,例子如下
chrt -r -p 99 pidxxx chrt -p pid-f, --fifo Set scheduling policy to SCHED_FIFO. -i, --idle Set scheduling policy to SCHED_IDLE (Linux-specific). The prior‐ ity argument has to be set to zero. -p, --pid Operate on an existing PID and do not launch a new task. -r, --rr Set scheduling policy to SCHED_RR. When policy is not defined the SCHED_RR is used as default.
You can also retrieve the real-time attributes of an existing task:
chrt -p pid 可以查看实时进程的优先级调度策略
nice
调整优先级
-n, –adjustment=N
add integer N to the niceness (default 10)
renice
man renice
查看调度策略
ps
- ps -eo pid,tid,class | grep 23126
To see every process with a user-defined format:
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
ps -Ao pid,tt,user,fname,tmout,f,wchan
查看进程在哪个cpu
top
- top命令
- 按f
- 选择需要display的内容,按d