This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
informatique:linux:monitoring_linux [2016/09/21 19:10] pteu [vnstat] |
informatique:linux:monitoring_linux [2018/08/03 08:33] (current) pteu |
||
---|---|---|---|
Line 23: | Line 23: | ||
<code bash> | <code bash> | ||
htop | htop | ||
+ | </code> | ||
+ | |||
+ | ====pidstat==== | ||
+ | |||
+ | **pidstat** affiche l'activité des processus actifs | ||
+ | <code bash> | ||
+ | # "-d" report IOSTAT ; "-l" list process cmd name & args ; 1 interval [ 30 count ]) | ||
+ | pidstat -d -l 1 30 | ||
+ | </code> | ||
+ | |||
+ | ====ps==== | ||
+ | |||
+ | <code bash> | ||
+ | # lister les processus bloqués en state=D (Disk sleep (uninterruptible)) | ||
+ | for x in `seq 1 1 10`; do ps -eo state,pid,cmd | grep "^D"; echo "---"; sleep 5; done" | ||
</code> | </code> | ||
Line 63: | Line 78: | ||
https://zmap.io | https://zmap.io | ||
+ | |||
+ | =====System===== | ||
+ | |||
+ | ====mpstat==== | ||
+ | |||
+ | <code bash> | ||
+ | mpstat -P ALL 5 | ||
+ | Linux 3.10.0-514.26.2.el7.x86_64 (ldri601z) 02/08/2018 _x86_64_ (8 CPU) | ||
+ | 10:39:05 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle | ||
+ | 10:39:10 all 1,20 0,00 0,98 61,32 0,00 0,00 0,00 0,00 0,00 36,50 | ||
+ | 10:39:10 0 3,41 0,00 4,22 92,37 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | 10:39:10 1 0,80 0,00 0,60 98,60 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | 10:39:10 2 2,81 0,00 0,40 0,00 0,00 0,00 0,00 0,00 0,00 96,79 | ||
+ | 10:39:10 3 2,20 0,00 2,20 0,00 0,00 0,00 0,00 0,00 0,00 95,59 | ||
+ | 10:39:10 4 0,00 0,00 0,00 100,00 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | 10:39:10 5 0,20 0,00 0,20 99,60 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | 10:39:10 6 0,20 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 99,80 | ||
+ | 10:39:10 7 0,00 0,00 0,20 99,80 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | [..] | ||
+ | </code> | ||
+ | |||
+ | ====vmstat==== | ||
+ | |||
+ | <code bash> | ||
+ | vmstat 1 | ||
+ | procs -----------memory------------ ---swap-- -----io---- -system-- ------cpu----- | ||
+ | r b swpd free buff cache si so bi bo in cs us sy id wa st | ||
+ | 0 9 147484 1129764 16 1345452 0 0 1 4 16 19 2 1 91 7 0 | ||
+ | 0 9 147484 1129640 16 1345420 0 0 0 1388 693 1545 1 1 37 61 0 | ||
+ | 0 9 147484 1128876 16 1345420 0 0 0 44 639 1566 2 1 37 60 0 | ||
+ | </code> | ||
+ | La première ligne n'est pas à prendre en compte puisqu'il affiche les stats depuis son dernier lancement. | ||
+ | |||
+ | Ici on voit un fort %age d'IOwait (60 "wa") ce qui correspond au temps d'attente ("perdu" càd s'il est IDLE) d'accès au disque du processeur. | ||
=====IO===== | =====IO===== | ||
+ | |||
+ | Voir les stats d'IO d'un processus : ''cat /proc/<PID DU PROC>/io'' | ||
+ | |||
+ | ====iostat==== | ||
+ | |||
+ | <code bash> | ||
+ | iostat -x 2 5 | ||
+ | Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util | ||
+ | sda 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | sdb 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | sdc 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 | ||
+ | </code> | ||
====iotop==== | ====iotop==== | ||
+ | |||
<code bash> | <code bash> | ||
iotop -p PID -k | iotop -p PID -k | ||
+ | |||
+ | # afficher le cumul des IO des processus actifs | ||
+ | iotop -oa | ||
</code> | </code> | ||