nuttige links: |
inhoudstafel: snelkoppelingen |
get to know linux ps command: http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/ top command examples: http://www.thegeekstuff.com/2010/01/15-practical-unix-linux-top-command-examples/ |
Het commando top geeft een dynamisch beeld van de processen gerangschikt op cpu gebruik.
$ top
top - 13:10:10 up 3 days, 22:18, 3 users, load average: 0.33, 0.35, 0.21 Tasks: 161 total, 1 running, 160 sleeping, 0 stopped, 0 zombie Cpu(s): 2.0%us, 1.3%sy, 0.0%ni, 96.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 2595140k total, 955504k used, 1639636k free, 276k buffers Swap: 4883752k total, 0k used, 4883752k free, 526988k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 16370 bert 20 0 286m 106m 22m S 1 4.2 0:52.24 firefox-bin 16452 root 20 0 2308 1148 852 R 1 0.0 0:00.22 top 14797 root 20 0 117m 23m 9700 S 0 0.9 2:01.36 Xorg 1 root 20 0 1812 832 608 S 0 0.0 0:01.38 init 2 root 15 -5 0 0 0 S 0 0.0 0:00.00 kthreadd 3 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/0 4 root 15 -5 0 0 0 S 0 0.0 0:00.10 ksoftirqd/0 5 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/0 6 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/1 7 root 15 -5 0 0 0 S 0 0.0 0:00.04 ksoftirqd/1 8 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/1 9 root 15 -5 0 0 0 S 0 0.0 0:01.48 events/0 10 root 15 -5 0 0 0 S 0 0.0 0:02.04 events/1 11 root 15 -5 0 0 0 S 0 0.0 0:00.00 khelper 47 root 15 -5 0 0 0 S 0 0.0 0:00.06 kblockd/0 48 root 15 -5 0 0 0 S 0 0.0 0:00.04 kblockd/1 51 root 15 -5 0 0 0 S 0 0.0 0:00.00 kacpid 52 root 15 -5 0 0 0 S 0 0.0 0:00.00 kacpi_notify 131 root 15 -5 0 0 0 S 0 0.0 0:00.00 kseriod 165 root 20 0 0 0 0 S 0 0.0 0:00.00 pdflush |
PID |
Process ID: het nummer (1 tot 65535) dat elk uniek proces identificeert |
USER |
de gebruiker die eigenaar is van het process |
PRI |
de "priority" zoals ingesteld door de kernel. Normaal gezien een waarde tussen 0 en 100; RT betekent real-time |
NI |
de "nice value" van een process; dit is een waarde van -20 tot +19 waar -20 de hoogste prioriteit is. Met de nice value wordt de actuele prioriteit door de user bijgeregeld |
VIRT |
het totaal aantal virtueel geheugen (physiek RAM + SWAP) dat door het process wordt gebruikt |
RES |
(resident) het gedeelte physiek RAM dat door een proces wordt gebruikt |
SHR |
(share) stuk gebruikt geheugen dat door andere processen kan worden gebruikt |
S |
Process Status: 'D' = uninterruptible sleep - 'R' = running - 'S' = sleeping - 'T' = traced or stopped - 'Z' = zombie |
%CPU |
percentage cpu gebruik |
%MEM |
percentage geheugen gebruik |
TIME+ |
tot hiertoe gebruikte cpu tijd |
COMMAND |
het ingetikte commando |
addendum: NICE and PRIORITY (voor de bollebozen) |
As of Linux v2.6, the kernel uses internally 140 priorities for the scheduling (referred in the sequel as scheduling priority), ranging from 1 to 140. The kernel selects the KSE with the lowest priority to run first. Note that these priorities are only known by the kernel. The relationship with priority / nice value as defined by POSIX is given below. Real-time KSE have a scheduling priority ranging from 1 to 99. The relationship with POSIX priority is 100-p, where p is the priority as defined by POSIX. In other words, a KSE with the lowest POSIX priority (1 on linux) has a scheduling priority of 99 and the KSE with the highest POSIX priority (99 on Linux) has a scheduling priority of 1. Non real-time KSE maps linearly from 100 to 140 depending on the nice value following the formula 120+n, where n is the nice value (the nice value is comprised between -20 and 19 on Linux). In other words, a traditional KSE with a default nice value of 0 has a scheduling priority of 120. Note that the priority of a non-real time KSE is dynamically adjusted using a heuristic that includes, among other, the nice value and the current KSE activity. On the other hand, the priority of a real-time KSE is never adjusted dynamically by the kernel. This assures that a real-time KSE always preempts a non-real time one. More information about scheduling for Linux kernel v2.6 might be found in the excellent book from Robert Love "Linux Kernel Development", par.3 pp31-5, ISBN 0-672-32512-8. |