Linux 进程相关的一些命令

来源:互联网 发布:相册制作软件哪款好用 编辑:程序博客网 时间:2024/05/18 00:29

修改进程优先级

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
原创粉丝点击