issue104:tutoriel4
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue104:tutoriel4 [2015/12/28 18:45] – créée auntiee | issue104:tutoriel4 [2016/01/17 17:24] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Many programs are available to help in identifying the reasons why a computer is running slowly. Top goes a step further and enables the user to intervene in running processes. | + | **Many programs are available to help in identifying the reasons why a computer is running slowly. Top goes a step further and enables the user to intervene in running processes. |
What is a process | What is a process | ||
Ligne 7: | Ligne 7: | ||
With the help of control groups (cgroups), we can arrange single processes into groups, and allocate system resources to them based on the priority of the group. This is the work of the scheduler, which creates a queue that handles the processes based on their priorities. | With the help of control groups (cgroups), we can arrange single processes into groups, and allocate system resources to them based on the priority of the group. This is the work of the scheduler, which creates a queue that handles the processes based on their priorities. | ||
- | To identify, control and manipulate processes, the operating system assigns a PID (Process ID) to each of them. Usually the PID's are assigned in ascending order and remain unchanged as long the system is running. | + | To identify, control and manipulate processes, the operating system assigns a PID (Process ID) to each of them. Usually the PID's are assigned in ascending order and remain unchanged as long the system is running.** |
- | The program ‘top’ | + | Beaucoup de programmes existent pour aider à identifier les raisons pour lesquelles un ordinateur tourne lentement ! Top va un pas plus loin et permet à l' |
+ | |||
+ | Qu' | ||
+ | |||
+ | Un processus est une instance d'une ou plusieurs taches connectées, | ||
+ | |||
+ | Avec l'aide de groupes de contrôle (cgroups), | ||
+ | |||
+ | Pour identifier, contrôler et manipuler les processus, le système d' | ||
+ | |||
+ | **The program ‘top’ | ||
To start top, we have to open a terminal and simply type in " | To start top, we have to open a terminal and simply type in " | ||
Ligne 19: | Ligne 29: | ||
load average: 0.97, 1.11, 1.08: shows the load average (workload) of the CPU during the most recent 1.5 and 15 minutes. For better accuracy, divide it by the number of CPU cores so that for example 1.08 divided by 2 cores means that the work for each core is 0.54. If this number > 1, then a queue exists, and the scheduler must be invoked to allocate computing time. | load average: 0.97, 1.11, 1.08: shows the load average (workload) of the CPU during the most recent 1.5 and 15 minutes. For better accuracy, divide it by the number of CPU cores so that for example 1.08 divided by 2 cores means that the work for each core is 0.54. If this number > 1, then a queue exists, and the scheduler must be invoked to allocate computing time. | ||
- | Tasks: 140 total, 1 running, 138 sleeping, 0 stopped, 1 Zombie: The second row displays the number of processes currently running, sleeping and stopped. The Zombie is a so-called child process, once started by a parent process, but not ended when the parent process was stopped. It's harmless, but if many are present, they may consume some memory and PID's. | + | Tasks: 140 total, 1 running, 138 sleeping, 0 stopped, 1 Zombie: The second row displays the number of processes currently running, sleeping and stopped. The Zombie is a so-called child process, once started by a parent process, but not ended when the parent process was stopped. It's harmless, but if many are present, they may consume some memory and PID's.** |
- | The third row shows the CPU workload for different clients: | + | Le programme « Top » |
+ | |||
+ | Pour démarrer top, nous devons ouvrir un terminal et taper simplement « top ». Maintenant, l' | ||
+ | |||
+ | top - 20:14:42 up 57 min : donne l' | ||
+ | |||
+ | 1 user (utilisateur) : nombre d' | ||
+ | |||
+ | load average (charge moyenne) : 0.97, 1.11, 1.08 : montre la charge moyenne du CPU pendant les dernières 1,5 et 15 minutes. Pour une meilleure précision, divisez-le par le nombre de cœurs du CPU ; ainsi, dans notre exemple, 1,08 divisé par 2 cœurs signifie que le travail de chaque cœur est de 0,58. Si le chiffre est > 1, alors une queue existe et l' | ||
+ | |||
+ | Tasks (tâches) : 140 total, 1 running (en cours), 138 sleeping (dormante), 0 stopped (arrêtée), | ||
+ | |||
+ | **The third row shows the CPU workload for different clients: | ||
" | " | ||
Ligne 31: | Ligne 53: | ||
" | " | ||
- | The fourth and the fifth rows show the usage of the memory and swap - the amount in use and the amount that’s still free. | + | The fourth and the fifth rows show the usage of the memory and swap - the amount in use and the amount that’s still free.** |
- | Below the system information we find the process list. It is structured in 12 parts: | + | La troisième ligne montre la charge des CPU pour différents clients : |
+ | |||
+ | « us » l' | ||
+ | « sy » le noyau ; | ||
+ | « ni » des travaux utilisateurs à faible priorité ; | ||
+ | « id » le mode Idle (inactif) (s'il est haut, la charge est faible et vice-versa) ; | ||
+ | « wa » le pourcentage de travaux attendant du temps de calcul. | ||
+ | Les interruptions sont affichées dans « hi », interruptions matériel et« si », interruptions logiciel | ||
+ | « st » (steal time - temps volé) montre la quantité de puissance CPU utilisée par une machine virtuelle. | ||
+ | |||
+ | Les quatrième et cinquième lignes montrent l' | ||
+ | |||
+ | **Below the system information we find the process list. It is structured in 12 parts: | ||
• PID the process ID | • PID the process ID | ||
Ligne 54: | Ligne 88: | ||
• A sorts the process list in order of resource usage. | • A sorts the process list in order of resource usage. | ||
• f the user can decide what task details should be displayed by top. | • f the user can decide what task details should be displayed by top. | ||
- | • o the user may configure the order of the list by his own needs. | + | • o the user may configure the order of the list by his own needs.** |
- | Working with top | + | Sous les informations système, nous trouvons la liste des processus. Elle est construite en 12 parties : |
+ | |||
+ | • PID Identifiant du processus ; | ||
+ | • USER | ||
+ | • PR | ||
+ | • NI | ||
+ | • VIRT | ||
+ | • RES mémoire physique ; | ||
+ | • SHR mémoire partagée ; | ||
+ | • S statut ; | ||
+ | • %CPU | ||
+ | • %MEM | ||
+ | • TIME+ temps écoulé depuis le démarrage du processus ; | ||
+ | • COMMAND | ||
+ | |||
+ | Il y a quelques raccourcis clavier pour personnaliser l' | ||
+ | |||
+ | • t cache/ | ||
+ | • m cache ou affiche les quatrième et cinquième lignes (mémoire, swap, etc.) ; | ||
+ | • A trie la liste des processus par ordre d' | ||
+ | • f l' | ||
+ | • o l' | ||
+ | |||
+ | **Working with top | ||
To manipulate a process, top offers two ways: | To manipulate a process, top offers two ways: | ||
Ligne 65: | Ligne 122: | ||
The ‘r’ command may be unknown to many users, so these details may help: | The ‘r’ command may be unknown to many users, so these details may help: | ||
- | If a system is running slowly, top may help to analyze the reason. Mostly it will be sufficient to stop one or more processes to fix the problem. If this is not possible – because none of the running tasks can be terminated – their priority can be reduced and the priority of more important process can be raised. A higher priority means more computing time from the processor, and vice versa. | + | If a system is running slowly, top may help to analyze the reason. Mostly it will be sufficient to stop one or more processes to fix the problem. If this is not possible – because none of the running tasks can be terminated – their priority can be reduced and the priority of more important process can be raised. A higher priority means more computing time from the processor, and vice versa.** |
- | Linux, based on UNIX, works with the UNIX system to determine priorities. The highest level is -20, the lowest 19. That means the more important a process is the lower is the assigned number. This number is called the ‘Nice Value’ and is displayed, as mentioned before, in the column NI in the process list. | + | Utiliser top |
+ | |||
+ | Pour manipuler un processus, top offre deux solutions : | ||
+ | |||
+ | • Pour arrêter un programme dont on n'a plus besoin, ou qui a planté, la commande k (kill - tuer) est très utile. Une fois la commande k envoyée, top nous demande le PID du programme que nous voulons arrêter. Après saisie du PID, top nous demande de confirmer l' | ||
+ | • Pour modifier la priorité d'une tâche, nous utilisons la commande r (renice - renouveler nice). Elle rend possible la réduction et l' | ||
+ | |||
+ | Puisque la commande « r » est peut-être inconnue de beaucoup d' | ||
+ | |||
+ | Si un système tourne lentement, top peut aider à analyser la raison. En général, il suffit d' | ||
+ | |||
+ | **Linux, based on UNIX, works with the UNIX system to determine priorities. The highest level is -20, the lowest 19. That means the more important a process is the lower is the assigned number. This number is called the ‘Nice Value’ and is displayed, as mentioned before, in the column NI in the process list. | ||
To raise a ‘nice value’, top must be started as root. To renice an owner (user) process, it is possible to do this without root power – but only to raise the priority, not to reduce it. For experimentation, | To raise a ‘nice value’, top must be started as root. To renice an owner (user) process, it is possible to do this without root power – but only to raise the priority, not to reduce it. For experimentation, | ||
Ligne 73: | Ligne 141: | ||
Conclusion | Conclusion | ||
- | Top is easy to understand, so everybody can use it. It has not only display functions, it also enables the user to intervene in processes. | + | Top is easy to understand, so everybody can use it. It has not only display functions, it also enables the user to intervene in processes.** |
+ | |||
+ | Basé sur UNIX, Linux travaille avec le système UNIX pour déterminer les priorités. Le plus haut niveau est -20, le plus bas 19. Ceci signifie que, plus le processus est important, plus le nombre attribué est bas. Ce nombre est appelé la « Valeur nice » et est affichée, comme indiqué plus haut, dans la colonne NI de la liste des processus. | ||
+ | |||
+ | Pour augmenter la « valeur nice », top doit démarrer comme root. Il est possible de renouveler le nice d'un processus du propriétaire (l' | ||
+ | |||
+ | Conclusion | ||
+ | |||
+ | Top est facile à comprendre, de sorte que chacun peut l' | ||
+ | |||
+ | **BIO : Jürgen is the former author of the now defunct YALM (Yet Another Linux Magazine) and a Linux user since 2007.** | ||
- | BIO : Jürgen is the former author of the now defunct | + | Bio : Jurgen est l' |
issue104/tutoriel4.1451324719.txt.gz · Dernière modification : 2015/12/28 18:45 de auntiee