Linux进程优先级调整

Linux中,PR值表示进程的实际优先级,由NI值(优先值)加上20得出。NI是用户层面的概念,PR是内核视角的优先级。普通进程PR=NI+20,实时进程显示为RT。nice值可调范围为-20~19,root用户可以调整任意程序的nice值,而普通用户只能调整自己的程序,且只能调高。调整方法包括使用nice和renice命令。通过修改/etc/security/limits.conf可以设置用户的所有进程优先级。
摘要由CSDN通过智能技术生成
1. Linux top命令输出中PR值和NI值有什么不同
NI 是优先值,是用户层面的概念, PR是进程的实际优先级, 是给内核(kernel)看(用)的。
一般情况下,PR=NI+20, 如果一个进程的优先级PR是20, 那么它的NI(nice)值就是20-20=0。
可以通过改变NI来改变PR: PRI(new) = PRI(old) + nice

NI is the nice value, which is a user-space concept. PR is the process's actual priority, as viewed by the Linux kernel.

For normal processes, the kernel priority is simply +20 from the nice value. Thus a process with the neutral nice value of zero has a kernel priority of 20. This offset-by-20 is done so that a process with a nice value of -20, the highest priority nice value, receives a kernel priority of zero. Lower numeric values equal higher scheduling priority.

For realtime processes, the kernel priority is the process's real-time priority, but thePR column will simply print RT.

In some versions of the Linux kernel, the kern
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值