Nice (Unix)

Nice (Unix)

nice (pronEng|ˈnaɪs) is a command found on UNIX and other Unix-like operating systems such as Linux. nice directly maps to a kernel call of the same name. For a given process, it changes the priority in the kernel's scheduler. A niceness of −20 is the highest priority and 19 is the lowest priority. The default niceness for processes is inherited from its parent process, usually 0.

nice becomes useful when several processes are demanding more resources than the CPU can provide. In this state, a higher priority process will get a larger chunk of the CPU time than a lower priority process. If the CPU can deliver more resources than the processes are requesting, then even the lowest priority process can get up to 99% of the CPU. Only the superuser (root) may set the niceness to a smaller (higher priority) value.

The related renice command can be used to change the priority of a process that is already running.

The exact mathematical effect of setting a particular niceness value for a process depends on the details of how the scheduler is designed on that implementation of UNIX. A particular operating system's scheduler will also have various heuristics built into it, e.g., to favor processes that are mostly I/O-bound over processes that are CPU-bound. As a simple example, when two otherwise identical CPU-bound processes are running simultaneously on a single-CPU Linux system, each one's share of the CPU time will be proportional to 20-p, where p is the process's priority. Thus a process run with nice +15 will receive 1/4 of the CPU time allocated to a normal-priority process: (20-15)/(20-0)=1/4. On the BSD 4.x scheduler, on the other hand, the ratio in the same example is about ten to one.

Linux also has an ionice command, which affects scheduling of I/O rather than CPU time.

ee also

*GNU Core Utilities
*top
*ps
*kill
*PsExec

External links

*man|cu|nice|SUS|invoke a utility with an altered nice value


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Nice (Unix) — Pour les articles homonymes, voir Nice. nice est une commande disponible sur le système d exploitation UNIX et autres systèmes compatibles tels que Linux. Cette commande pointe directement vers un point d entrée du kernel portant le même nom,… …   Wikipédia en Français

  • nice (Unix) — Pour les articles homonymes, voir Nice. nice est une commande disponible sur le système d exploitation UNIX et autres systèmes compatibles tels que Linux. Cette commande pointe directement vers un point d entrée du kernel portant le même nom,… …   Wikipédia en Français

  • Nice (Unix) — nice планировщика задач. Если не указано ни одного аргумента, команда nice выводит текущий унаследованный приоритет для планировщика задач. В противном случае nice запускает указанную команду с измененным приоритетом. Если смещение не указано, то …   Википедия

  • nice (Unix) — Renice redirects here. For the Polish village, see Renice, Poland. nice (  /ˈnaɪ …   Wikipedia

  • Nice — Эта статья об утилите Unix; о британской прогрессив рок группе конца 1960 х см.: The Nice. nice  UNIX утилита, запускающая программу с измененным приоритетом для планировщика задач. Если не указано ни одного аргумента, команда nice выводит… …   Википедия

  • Nice (disambiguation) — Nice is a city located in the south of France. Nice may also refer to: Contents 1 Places 2 Politics 3 Artworks …   Wikipedia

  • nice — Эта статья об утилите Unix; о британской прогрессив рок группе конца 1960 х см.: The Nice. nice  UNIX утилита, запускающая программу с измененным приоритетом для планировщика задач. Если не указано ни одного аргумента, команда nice выводит… …   Википедия

  • Unix time — Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1 1970, not counting leap seconds. It is widely used not only on Unix like… …   Wikipedia

  • UNIX — UNIX, parfois écrit « Unix », avec des petites capitales, est un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par laquelle il offre de nombreux petits outils… …   Wikipédia en Français

  • Unix — (marque déposée officiellement comme UNIX, parfois aussi écrit comme Unix avec les petites capitalisations) est le nom d un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”