<s>
nice	O
is	O
a	O
program	O
found	O
on	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
such	O
as	O
Linux	B-Application
.	O
</s>
<s>
It	O
directly	O
maps	O
to	O
a	O
kernel	B-Operating_System
call	B-Operating_System
of	O
the	O
same	O
name	O
.	O
</s>
<s>
nice	O
is	O
used	O
to	O
invoke	O
a	O
utility	B-Application
or	O
shell	B-Language
script	I-Language
with	O
a	O
particular	O
CPU	B-General_Concept
priority	O
,	O
thus	O
giving	O
the	O
process	B-Operating_System
more	O
or	O
less	O
CPU	B-General_Concept
time	O
than	O
other	O
processes	O
.	O
</s>
<s>
The	O
default	O
niceness	O
for	O
processes	O
is	O
inherited	O
from	O
its	O
parent	O
process	B-Operating_System
and	O
is	O
usually	O
0	O
.	O
</s>
<s>
Linux	B-Application
systems	O
document	O
a	O
niceness	O
of	O
19	O
as	O
the	O
lowest	O
priority	O
,	O
BSD	B-Operating_System
systems	O
document	O
20	O
as	O
the	O
lowest	O
priority	O
.	O
</s>
<s>
Niceness	O
value	O
is	O
a	O
number	O
attached	O
to	O
processes	O
in	O
*	B-Operating_System
nix	I-Operating_System
systems	O
,	O
that	O
is	O
used	O
along	O
with	O
other	O
data	O
(	O
such	O
as	O
the	O
amount	O
of	O
I/O	B-General_Concept
done	O
by	O
each	O
process	B-Operating_System
)	O
by	O
the	O
kernel	B-Operating_System
process	B-Operating_System
scheduler	O
to	O
calculate	O
a	O
process	B-Operating_System
 '	O
'	O
true	O
priority'which	O
is	O
used	O
to	O
decide	O
how	O
much	O
CPU	B-General_Concept
time	O
is	O
allocated	O
to	O
it	O
.	O
</s>
<s>
The	O
program	O
's	O
name	O
,	O
nice	O
,	O
is	O
an	O
allusion	O
to	O
its	O
task	O
of	O
modifying	O
a	O
process	B-Operating_System
 '	O
niceness	O
value	O
.	O
</s>
<s>
The	O
term	O
niceness	O
itself	O
originates	O
from	O
the	O
idea	O
that	O
a	O
process	B-Operating_System
with	O
a	O
higher	O
niceness	O
value	O
is	O
nicer	O
to	O
other	O
processes	O
in	O
the	O
system	O
and	O
to	O
users	O
by	O
virtue	O
of	O
demanding	O
less	O
CPU	B-General_Concept
powerfreeing	O
up	O
processing	O
time	O
and	O
power	O
for	O
the	O
more	O
demanding	O
programs	O
,	O
who	O
would	O
in	O
this	O
case	O
be	O
less	O
nice	O
to	O
the	O
system	O
from	O
a	O
CPU	B-General_Concept
usage	O
perspective	O
.	O
</s>
<s>
nice	O
becomes	O
useful	O
when	O
several	O
processes	O
are	O
demanding	O
more	O
resources	O
than	O
the	O
CPU	B-General_Concept
can	O
provide	O
.	O
</s>
<s>
In	O
this	O
state	O
,	O
a	O
higher-priority	O
process	B-Operating_System
will	O
get	O
a	O
larger	O
chunk	O
of	O
the	O
CPU	B-General_Concept
time	O
than	O
a	O
lower-priority	O
process	B-Operating_System
.	O
</s>
<s>
Only	O
the	O
superuser	B-Application
(	O
root	O
)	O
may	O
set	O
the	O
niceness	O
to	O
a	O
lower	O
value	O
(	O
i.e.	O
</s>
<s>
On	O
Linux	B-Application
it	O
is	O
possible	O
to	O
change	O
/etc/security/limits.conf	O
to	O
allow	O
other	O
users	O
or	O
groups	O
to	O
set	O
low	O
nice	O
values	O
.	O
</s>
<s>
The	O
exact	O
mathematical	O
effect	O
of	O
setting	O
a	O
particular	O
niceness	O
value	O
for	O
a	O
process	B-Operating_System
depends	O
on	O
the	O
details	O
of	O
how	O
the	O
scheduler	O
is	O
designed	O
on	O
that	O
implementation	O
of	O
Unix	B-Application
.	O
</s>
<s>
A	O
particular	O
operating	B-General_Concept
system	I-General_Concept
's	O
scheduler	O
will	O
also	O
have	O
various	O
heuristics	O
built	O
into	O
it	O
(	O
e.g.	O
</s>
<s>
to	O
favor	O
processes	O
that	O
are	O
mostly	O
I/O	B-General_Concept
-bound	O
over	O
processes	O
that	O
are	O
CPU-bound	O
)	O
.	O
</s>
<s>
As	O
a	O
simple	O
example	O
,	O
when	O
two	O
otherwise	O
identical	O
CPU-bound	O
processes	O
are	O
running	O
simultaneously	O
on	O
a	O
single-CPU	O
Linux	B-Application
system	O
,	O
each	O
one	O
's	O
share	O
of	O
the	O
CPU	B-General_Concept
time	O
will	O
be	O
proportional	O
to	O
20	O
−	O
p	O
,	O
where	O
p	O
is	O
the	O
process	B-Operating_System
 '	O
priority	O
.	O
</s>
<s>
Thus	O
a	O
process	B-Operating_System
,	O
run	O
with	O
nice	O
+15	O
,	O
will	O
receive	O
25%	O
of	O
the	O
CPU	B-General_Concept
time	O
allocated	O
to	O
a	O
normal-priority	O
process	B-Operating_System
:	O
(	O
20	O
−	O
15	O
)	O
/	O
( 20	O
−	O
0	O
)	O
=	O
0.25	O
.	O
</s>
<s>
On	O
the	O
BSD	B-Operating_System
4.x	O
scheduler	O
,	O
on	O
the	O
other	O
hand	O
,	O
the	O
ratio	O
in	O
the	O
same	O
example	O
is	O
about	O
ten	O
to	O
one	O
.	O
</s>
<s>
The	O
related	O
renice	B-Device
program	O
can	O
be	O
used	O
to	O
change	O
the	O
priority	O
of	O
a	O
process	B-Operating_System
that	O
is	O
already	O
running	O
.	O
</s>
<s>
Linux	B-Application
also	O
has	O
an	O
ionice	B-Device
program	O
,	O
which	O
affects	O
scheduling	O
of	O
I/O	B-General_Concept
rather	O
than	O
CPU	B-General_Concept
time	O
.	O
</s>
