08:renice 设置sshd的优先级

#先查看sshd的优先级
[root@xj ~]# ps axo pid,command,nice|grep sshd
869 /usr/sbin/sshd -D 0
1194 sshd: root@pts/0 0
1307 sshd: root@pts/1 0
1574 sshd: root@pts/2 0

#设置sshd的优先级为-20
[root@xj ~]# renice -n -20 869
869 (进程 ID) 旧优先级为 0,新优先级为 -20

#再次查看sshd的优先级
[root@xj ~]# ps axo pid,command,nice|grep sshd
869 /usr/sbin/sshd -D -20
1194 sshd: root@pts/0 0
1307 sshd: root@pts/1 0
1574 sshd: root@pts/2 0

#一定要退出终端重新连接
[root@xj ~]# exit
登出

#再检查,就可以看到当前终端的优先级变化了
[root@xj ~]# ps axo pid,command,nice|grep sshd
869 /usr/sbin/sshd -D -20
1194 sshd: root@pts/0 0
1574 sshd: root@pts/2 0
2361 sshd: root@pts/1 -20

同理也可以针对其它进程,调整优先级

原文地址:https://www.cnblogs.com/jim-xu/p/11937069.html