简体   繁体   English

默认情况下,将“ nice”值设置为具体过程

[英]Set 'nice' value to concrete processes, by default

I would like to set specific "nice" values to several processes in a laptop. 我想为笔记本电脑中的多个进程设置特定的“ nice”值。 For example, I would like the window manager to run at -10, and keep the default at 0. 例如,我希望窗口管理器在-10上运行,并保持默认值为0。

I know that "renice" can change the niceness of a processes, but this is a-posteriori, and I do not want to "renice" my window manager process every time that I open the computer. 我知道“ renice”可以更改进程的美观程度,但这是后验的,我不想每次打开计算机时都“ renice”我的窗口管理器进程。 Similarly, "limits.conf" allows to specify default niceness for specific users or groups, but not (as far as I know) specific processes. 同样,“ limits.conf”允许为特定用户或组指定默认值,但(据我所知)不能指定特定进程。

So my question is whether there is a way to define niceness for concrete processes, without having to change the default for the user and without having to renice the process once it runs. 因此,我的问题是,是否有一种方法可以为具体流程定义精美性,而不必为用户更改默认值,也不必在流程运行后就放弃它。

Use nice(1) eg 使用nice(1)例如

 nice --5 x-window-manager

or more commonly 或更常见

 nice make -j 2

You probably need root privileges to give an unnice adjustment (eg a negative one which raises the chance of being scheduled). 您可能需要root特权才能进行合理的调整(例如,否定的调整会增加被安排的机会)。 See nice(2) . 参见nice(2)

See also ionice(1) 另请参见ionice(1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM