kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Why the niceness is not always taken into account ?
@ 2013-04-16  8:35 Alexandre Laurent
  2013-04-16 11:03 ` Kristof Provost
  2013-04-16 15:58 ` michi1 at michaelblizek.twilightparadox.com
  0 siblings, 2 replies; 10+ messages in thread
From: Alexandre Laurent @ 2013-04-16  8:35 UTC (permalink / raw)
  To: kernelnewbies

Hello,

I have some questions about nice and programs scheduling.
My machines have an 8 cores CPU. I am using an CPU intensive test,
using OpenMP and running on the 8 cores for the experiments.

When I am running my test it is taking around 12s. If I am starting at
the same time two instances of this test it takes 24s which is totally
fine and expected.

I wanted to prioritize one instance of the test with nice. To do this,
I am applying a niceness of -20 to privileged one, and setting a
niceness of 20 to "slow down" the second one.
This is usually working well. The privileged one with run around 12s
(so, at full speed) and the other one 24s (-> paused for 12s and 
running
the 12 last seconds at full speed).

My problem is that in some cases it is not working at all. It works
fine if I am running both programs in the same instance of the 
terminal,
or from a script (so, same instance of interpreter). But this is not
working if I am running the instances in separate SSH session. When I
say it is not working, both instances will take 24s to run and the CPU
usage is just shared between the tasks. More precisely :

I am running the same test, but connecting twice on the remote machine
(one connection by test instance). I am using exactly the same commands
than during the others experiments. But, by using two SSH instances, 
the
niceness will not be taken into account. The CPU will be shared equally
between both instances even if htop is showing a niceness of 19 / -20
for the low priority program and the privileged program respectively.

(For information, if I am running my program throught SSH using a
script, and even by running the commands directly throught the SSH
terminal it will work as expected. So, the cause is not on SSH.)

Can you explain me, why in such case, the niceness is not taken into
account ?
Can you tell me how I can workaround this problem to effectively set
niceness and get it respected by the system ?

Best regards,

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-19 12:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16  8:35 Why the niceness is not always taken into account ? Alexandre Laurent
2013-04-16 11:03 ` Kristof Provost
2013-04-16 15:38   ` Alexandre Laurent
2013-04-16 17:59     ` Kristof Provost
2013-04-18 14:57       ` Alexandre Laurent
2013-04-18 15:32         ` Valdis.Kletnieks at vt.edu
2013-04-18 15:56           ` Alexandre Laurent
2013-04-18 17:30             ` Valdis.Kletnieks at vt.edu
2013-04-19 12:20               ` Alexandre Laurent
2013-04-16 15:58 ` michi1 at michaelblizek.twilightparadox.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).