The origin of the nice program name in Linux
The role of the nice program in Linux must be known as a-20 to 19 number to control how much time the CPU is allocated to this process. The smaller the number, the more time slices the CPU allocates, that is, the higher the priority.
As a matter of fact, when I first saw the name of this program, I had a question: why is the smaller the number, the better the running (nice?
It turns out that nice not only represents a wonderful thing, but also "friendly and kind" when describing a person. Therefore, if the nice value of a process is higher, it means that the process (anthropomorphic method) is better, the more friendly, that is, the CPU time is used by others, therefore, the priority is low. These processes should be assigned a "good person card!
The nice processes with low or even negative values are very unfriendly. they occupy a lot of CPU time slices in a selfish manner. If the CPU can be provided, they can occupy up to 99% of the CPU time! Of course, nice with negative numbers can only be used by root users, and not everyone can be so selfish!
For example, if we extract a file from the server but do not want to affect the running of WEB services, we can:
Nice-n 19 tar xf archive. tgz
This article permanently updates the link address: