Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
At work we have a Linux server (Ubuntu server 7.10) with 8 CPUs for doing heavy calculations. There are several users on the server and we need to prioritize the jobs we run. We are trying to do this using the nice command, but it is not working the way it is supposed to. Below, a screenshot from 'top' is included in a situation where the users andreas and bruger2 are running jobs. Both users have set up their calculations to use all 8 CPUs simultaneously (using MPI or similar), but andreas' processes are set to nice=0 while bruger2 uses nice=19.
Why do andreas' processes (mdrun) only get 4 CPUs when the nice levels are set as above?
It should get all 8 CPUs and bruger2's processes should wait until andreas' are done...
Regards
Andreas
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6989 bruger2 39 19 4572m 2.8g 3132 R 400 72.2 1746:45 l914.exe
7294 andreas 25 0 641m 19m 13m R 100 0.5 0:46.27 mdrun
7295 andreas 25 0 641m 18m 12m R 100 0.5 0:45.40 mdrun
7297 andreas 25 0 641m 18m 12m R 100 0.5 0:45.50 mdrun
7298 andreas 25 0 641m 18m 12m R 100 0.5 0:45.53 mdrun
1 root 18 0 5144 140 68 S 0 0.0 0:03.88 init
2 root 11 -5 0 0 0 S 0 0.0 0:00.02 kthreadd
3 root RT -5 0 0 0 S 0 0.0 0:00.10 migration/0
4 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
5 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/0
i am not an expert on schedulers but this will never happen. the kernel will distribute time more often to processes with hier priority other processes to slow to craw but still work.
you will need to send a kill -stop pid and kill -cont pid to make that happen.
please be aware that most problems occur when two processes will fight for (heavy) disk access
causing a lot of waitstates.
i am not an expert on schedulers but this will never happen. the kernel will distribute time more often to processes with hier priority other processes to slow to craw but still work.
you will need to send a kill -stop pid and kill -cont pid to make that happen.
please be aware that most problems occur when two processes will fight for (heavy) disk access
causing a lot of waitstates.
Thanks for you answer. You claim that the situation I described above will never happen? But it IS happening - take a look at the output from top...? It is not a matter of two processes fighting for disk access - this is evident from the 'S' column in the top output which states that all the processes are in the 'R' mode (if they were writing to the disk they would display a 'D' in this column as far as I know).
'nice' is just a suggestion to the kernel. Its inherently designed to multi-task if possible. If a high priority task has to wait eg for disk access, then an equal or lower priority task will get some cpu time while its waiting for the data to arrive.
Quote:
A niceness should not be confused with a scheduling priority, which
lets applications determine the order in which threads are scheduled to
run. Unlike a priority, a niceness is merely advice to the scheduler,
which the scheduler is free to ignore.
Thanks for you answers (grumpf and chrism01). Since a nice level is just a suggestion to the kernel (according to chrism01's post), is there a way that one can actually change the kernels priority of a process?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.