1834202 Members
3267 Online
110066 Solutions
New Discussion

Using Nice

 
SOLVED
Go to solution
Vito Sarducci
Regular Advisor

Using Nice

I have the following process and i want to use nice to give it a different priority. How can i do this?

CPU TTY PID USERNAME PRI NI SIZE RES STATE
2 ? 11340 patrol 255 30 1020K1444K run

TIME %WCPU %CPU COMMAND
81:47 99.84 99.66 dcm

How?
Lifes too short to stress out, Enjoy every day you have on earth!
4 REPLIES 4
Shahul
Esteemed Contributor
Solution

Re: Using Nice

Hi

nice is the command to alter the default priority while executing itselg. See this example

sam's default priority is 20. If I am running like this

#nice -n 5 sam

Now sam's priority will be 25.

#nice -n -5 sam

Now sam's priority will be 15.

In ur case U can use renice command. This is for altering the priority of running application. See example

suppose sam is running with a priority of 20 with process id 8702. Then do like this

#renice -n -5 8702

Now sam' priority will get change to 15

#renice -n 5 8702

Now sam's priority will change to 25 from 20.

Use the same in ur application..And see man page of nice and renice.

Best of luck

Shahul
eran maor
Honored Contributor

Re: Using Nice

Hi . the DCM is a process of
DCE Configuration Manager .

you cant change the prio that he is running but you need to deside if you need the DCE at all .

most of the software that i kmow that use the DCE is OPENVIEW software of HP .

but i dont think that you can change the prio of the process .

you can remove the DCE or disable it .
love computers
Victor BERRIDGE
Honored Contributor

Re: Using Nice

Hi,
If I agree with Shahul on nice usage, I think think its more a kill of the process you need!
(Mind you Im pleased to see Im not the only one having to deal with such a bad product, why didnt you get sysload?...)
More seriously I wrote to our patrol administrator that IF I see patrol resources exceed 30% on one of the boxes I administer, I will just kill all patrol processes AND no I wont give him the root passwd on install...
Up to BMC to tune correctly their product...
So this is what I have on an HP box:
TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
? 21051 patrol 154 24 7892K 5812K sleep 5379:38 1.50 1.50 PatrolAgent
? 26970 patrol 154 28 1448K 1688K sleep 47:51 0.07 0.07 dcm

Its nothing like your results....

All the best

Victor
Ravi_8
Honored Contributor

Re: Using Nice

Hi,
All the process started by users will be running with system defualt priority of 20.
Normally, all processes inherit the system nice value of their parent process when they are spawned.
At boot-up, the system starts the init process at a system nice value of 20 (system default). On most systems, all processes (down to the
login shells) inherit this priority. Starting from their individual login shell processes, users can alter the system nice value of
descendent processes to as much as 39, or, with appropriate privileges, as little as 0. A system nice value of 0 establishes an
extremely high priority, whereas a value of 39 indicates a very low priority.

So in order to run your script at high priority (0) you need to issue the command #nice --20 dcm(your command)
never give up