LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /etc/security/limits.conf and nice (https://www.linuxquestions.org/questions/linux-newbie-8/etc-security-limits-conf-and-nice-863736/)

Mr. Alex 02-19-2011 09:31 AM

/etc/security/limits.conf and nice
 
If I add
Code:

user - nice -20
to /etc/security/limits.conf, what exactly will it change?

"user" will have right to run all apps down to "-20" nice
or
all apps from "user" will automatically start with nice "-20"?

goodhombre 02-19-2011 10:00 AM

Hi,

From limits.conf man page
Quote:

nice
maximum nice priority allowed to raise to (Linux 2.6.12 and higher)
In your case :

"user" will have right to run all apps down to "-20" nice.

Reuti 02-19-2011 10:39 AM

Nevertheless I wouldn't allow a user to run something at nice -20. User processes should be in the range 0 to 19 to leave room for kernel tasks. As long as there are more cores than active processes all will run at maximum speed anyway (there are are no processes to be nice to in this case). And even if a machine is oversubscribed, the nice values are relative: e.g. whether all user processes have a nice value of 0 or all have a nice value of 19 wouldn't change anything for them.

Mr. Alex 02-19-2011 02:38 PM

I run Firefox with nice -4, is it better then 0?

Reuti 02-19-2011 04:44 PM

What do you mean by “better”? As the name implies, it means to be nice to other processes. When there are none additional (user-) processes, there is noone to be nice to. With a negative value you could transcribe it with “cheecky”, as it might block important kernel tasks.

From a user experience on an otherwise empty machine, you shouldn't see any difference between nice 0 and nice 19 anyway.


All times are GMT -5. The time now is 08:05 AM.