Determining Values for NIce and Priority items in limits.conf file


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Operating Systems Linux Determining Values for NIce and Priority items in limits.conf file
# 1  
Determining Values for NIce and Priority items in limits.conf file

I've been looking online trying to find the correct value nice and priority can take in the limits.conf file. ON the man page it says;
Quote:
Priority - the priority to run user process with (negative values boost priority)
Does this mean priority can be any negative number and any positive?

Then
Quote:
Nice - maximum nice priority allowed to raise to (Linux 2.6.12 or higher) values: [-20, 19]
Does this mean any number between -20 and 19 also what does the definition of nice mean when it mentions Linux 2.6.12 or higher? Does the definition mean you can only set the nice value if you have Linux 2.6.12 or higher?

Sorry if this seems straight forward. I am just a little stuck on these two.

Moderator's Comments:
Mod Comment edit by bakunin: as this has seemingly nothing to do with "Shell Programming and Scripting" i am going to transfer this thread to the Linux forum. You might consider editing in your OS and version so that we can help you more specifically.

Last edited by bakunin; 03-02-2013 at 01:19 PM.. Reason: missing a word
# 2  
Reading the Googled bits, user priority might not be a working facility in all kernels!

Try some modest numbers like +5 and -5. See if it changes the default nice of a new login process (normally 20) or allows nice --5 (permission to raise your priority to nice=15).

Semantically, the - sign haunting nice comes from the use of "nice -19 ....", which does not say set my nice to 19 or -19, but - says option and 19 is what is added to nice. root can go "nice --19" and get a nice=1 child.
# 3  
Quote:
Originally Posted by matthewfs
Does the definition mean you can only set the nice value if you have Linux 2.6.12 or higher?
I'm sure process priority has been a feature of Linux for much longer than that.

The way it's traditionally worked, though, is that any user can lower their own priority. If you want to create processes of higher priority, you need root access -- partly because you don't want self-important software(or users!) clogging your machine with high-priority processes, partly because ignorantly running things at extremely high priority can be dangerous -- making user mode software higher priority than, say, an interrupt handler would be a Very Bad Thing.

This 2.6.12 feature apparently allows users to raise their own priority without root access, if granted by the system limits file. What's new is this feature in the config file, not process priority itself.

It looks like a good feature to me. There are occasional things which truly need high priority (CD burning, etc) and having to run them as root all the time has always struck me as a bit dicey.
# 4  
Yes, it's a bit short sighted that UNIX ts mode login goes to the highest allowed priority, rather than somewhere in the middle, like 30. Then, users could tweak their background or other-terminal processes up or down using nice and renice. It's all relative, after all. I guess the real trick is to get out of time sharing into real time mode, like Windows' Realtime!

They even put a 'bgnice' option in ksh at some point, so you could make all background processes nicer by default.
# 5  
Quote:
Originally Posted by DGPickett
Yes, it's a bit short sighted that UNIX ts mode login goes to the highest allowed priority, rather than somewhere in the middle, like 30.
I don't know, it just looks like human nature to me. If you give humans or software the option to raise their priority, they'll all abuse it. Especially since users who don't, are punished by users who do. It's not a go-faster setting after all, it's a give-everyone-else-less setting... Tragedy of the commons again.

If someone wants to lower their priority, however, their intentions are going to be honest.

So you might as well enforce them to be the same, unless they can make do with less.

If you allow for special cases I think it's a good default.

Last edited by Corona688; 03-06-2013 at 04:48 PM..
# 6  
In a more perfect world, the dispatcher would get the CPU to programs that do not hog it and that do i/o on an expedited basis. I remember amazing operators who were copying tape with the difference if I made the job APRIOR, which meant real time. The drive went from "bup bup bup" to "ZZZZZZZZ", and nobody suffered, because it was i/o bound. Programs like that need to take their 1% off the top, which is no harm to the 99%, especially when there is still idle time. Writing dispatches is a big deal some places. One sysadmin refused to kill a looping pg for me, because he said their very custom dispatcher ensured that the CPU it took was off the bottom, so they had a policy to just wait for the periodic reboot.
# 7  
Quote:
Originally Posted by DGPickett
In a more perfect world, the dispatcher would get the CPU to programs that do not hog it and that do i/o on an expedited basis.
I believe many schedulers do; I've always been impressed by how well UNIX in general timeshares, compared to Windows' nonstop stuttering. (Not even quad cores helps.) But it only works when they're equal priority... High priority will be favored over low priority regardless of how polite they are. That's what priority's for.

A runaway higher-priority process can lock lower-priority ones out quite harshly; users with the ability to raise their priority can badly affect other users. Starting them at maximum relative to each other prevents them from stalling each other.

Last edited by Corona688; 03-06-2013 at 06:47 PM..
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #679
Difficulty: Medium
IEEE 802.3 CSMA/CD, CSMA/CD stands for Carrier Sense, Multiple Authorization with Collision Detection.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Soft and hard limits for nproc value in /etc/security/limits.conf file (Linux )

OS version : RHEL 6.5 Below is an excerpt from /etc/security/limits.conf file for OS User named appusr in our server appusr soft nproc 2047 appusr hard nproc 16384 What will happen if appusr has already spawned 2047 processes and wants to spawn 2048th process ? I just want to know... (3 Replies)
Discussion started by: kraljic
3 Replies

2. Shell Programming and Scripting

Call Nice command (priority) from /bin/ksh

Hello, I am just starting with shell scripting, as everyone will soon see from my question. What I'm trying to do is call the Nice command to set the script process priority from /bin/ksh. The difference is I'm running it not directly through the shell, but through Bigfix (very similar to... (3 Replies)
Discussion started by: solly119
3 Replies

3. Red Hat

max/ideal value of items in limits.conf in rhel5?

i want to set limits in /etc/security/limits.conf.My os is rhel 5.2. It was giving continuous messages in in /var/log/secure like : continuously. I have changed values of priority and nice to "0" from unlimited and messages are not comming. But i want to know what is the ideal/maximum... (3 Replies)
Discussion started by: pankajd
3 Replies

4. Red Hat

Modifying limits.conf & pam.d

Hello all, I'm running Oracle 10.2 on RHEL5. Current value of ulimit -n is set to a low value of 1024. I need to increase it to 65536 using the following procedure. cat >> /etc/security/limits.conf <<EOF oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard... (3 Replies)
Discussion started by: luft
3 Replies

5. Solaris

Solaris counterpart of /etc/security/limits.conf

Hi, How can we set per user core file size, etc in solaris, i.e. I want solaris counterpart/equivalent of linux /etc/security/limits.conf. TIA (0 Replies)
Discussion started by: slash_blog
0 Replies

6. UNIX for Advanced & Expert Users

/etc/security/limits.conf

HI, To restrict the number of files and number of processes used the user we use the following configuration in the file /etc/security/limits.conf. oracle soft nofile 65572 oracle hard nofile 65572 oracle soft noproc 16384 oracle soft noproc 16384 My question is what do the 'soft' and... (1 Reply)
Discussion started by: praveen_b744
1 Replies

7. HP-UX

urgent help required on changing process priority using nice

Hi folks, Hope you can help me. I have a process that is currently running at nice 20 and need it to run faster (-10?). How do I change the process using nice? I have the process number and thought it would be along the lines of; nice -10 process_id but it doesn't seem to like that. (1 Reply)
Discussion started by: gshuttleworth
1 Replies

8. UNIX for Dummies Questions & Answers

limits.conf

I have line in this file that says: username - maxlogins 1 and user can login 2 times instad of one. does enybody know why? and how can I fix that? (2 Replies)
Discussion started by: shooroop
2 Replies

9. Linux

limits.conf

Hello! How do make the limits.conf parameters work for a normal user. Ive changed both the hard and soft parameter for the specific user. It used to be 4096 and i changed it to 16384. But when i use the ulimit -n, all i got is permissen denied. Witch i can understand. But my question is? how... (1 Reply)
Discussion started by: dozy
1 Replies

Featured Tech Videos