How to illustrate use of smaller nice value of process in Linux?

331 Views Asked by At

I want to see the real change in process launch and execution after changing nice value. When i allocate lower nice value to process, what changes should i see.

$ps -l |head -2
  UID   PID  PPID        F CPU PRI NI       SZ    RSS WCHAN     S        
  501 25164 25144     4006   0  31 10  4280144   1584 -      SN+   

I executed

$renice -6 25164

and i got new value of NICENESS as -6 ,it was 10 before

ps -l |head -2
  UID   PID  PPID        F CPU PRI NI       SZ    RSS WCHAN     S        
  501 25164 25144     4006   0  31 -6  4280144   1584 -      S<+    

So, what changes i should see now. i.e Should it increase processing speed . or launch time will be less.

$renice -6 pid

I want to see the changes in process execution time, as it gets higher priority .What benefit user will get?

1

There are 1 best solutions below

0
maschaub On

You will only see a difference in execution time if the cpu is fully utilized since the niceness affects the priority of a process. So to benchmark a difference you will need to run some other program that fully utilizes the cpu and then run the program you are benchmarking. Then change the niceness so that the priority is now more or less than the other program and you will then see a difference in execution time.