1821414 Members
2550 Online
109633 Solutions
New Discussion юеВ

Meaning of NICE CPU

 
Hiran Arias
New Member

Meaning of NICE CPU

Hello I would like to know when the CPU use the NICE CPU% that is showed in the top command:

System: xxxxxxx Wed Mar 26 15:05:03 2003
Load averages: 0.40, 0.39, 0.37
98 processes: 94 sleeping, 4 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.45 6.6% 12.6% 28.1% 52.7% 0.0% 0.0% 0.0% 0.0%
1 0.48 11.0% 9.0% 25.3% 54.7% 0.0% 0.0% 0.0% 0.0%
2 0.28 16.6% 15.0% 18.8% 49.7% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.40 11.4% 12.2% 24.2% 52.3% 0.0% 0.0% 0.0% 0.0%

Memory: 32148K (23292K) real, 39300K (27796K) virtual, 2109708K free Page# 1/10


CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
1 pts/tf 4821 movil2 152 20 6204K 0K run 0:00 57.07 2.78 java
0 pts/ta 16430 movil2 158 20 720K 360K sleep 1269:54 1.73 1.73 movil_vu
1 ? 33 root 152 20 0K 0K run 162:21 1.28 1.28 vxfsd
1 ? 261 root 154 20 32K 40K sleep 421:15 0.55 0.55 syncer
1 pts/ti 14143 movil2 178 20 2516K 500K run 0:01 0.15 0.15 top
2 ? 1260 movil2 158 20 196K 228K sleep 57:20 0.11 0.11 ksh
0 ? 1081 root 154 20 204K 276K sleep 44:10 0.10 0.10 pwgrd
2 ? 4777 daemon 168 20 124K 0K sleep 0:00 0.99 0.09 rmail
0 ? 1 root 168 20 400K 188K sleep 39:16 0.09 0.09 init
ReDsKuLL
2 REPLIES 2
Jeff Schussele
Honored Contributor

Re: Meaning of NICE CPU

Hi Hiran,

nice is a term for something running at other than the default priority.
The default nice value is 20.
If something is running at a value higher or lower, it is said to be "niced".

Anything started in the background - for EX

command &

has a nice value of 4 added to it & will then be at 24. These type processes & their usage will then show up in the Nice category of a top output. Also users can renice their own processes & of course root can renice anybody's processes.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sridhar Bhaskarla
Honored Contributor

Re: Meaning of NICE CPU

Hi,

This tells you that %utilization of CPU running the nice processes.

Nice process is one that is being nice to other processes. This means, they run at a lower priority. To find out such processes do

UNIX95= ps -e -o "nice args" |awk '$1 > 20 {print $0}'

There is a space before "ps".

The default nice value is 20.

The processes that started in background or through cron/at would have a higher nice values (lower priority).

To change the nice value, you need to use 'renice' commmand. Look at the man page of renice.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try