vmstat
vmstat ã¯ãCPUã»ã¡ã¢ãªã»I/Oã®å©ç¨ç¶æ³ã調ã¹ãã®ã«ç¨ããã³ãã³ãã
å®è¡ä¾
$ vmstat 1 5 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 864 45868 11164 1021700 0 0 8 36 66 144 4 1 95 0 0 0 864 45372 11164 1022112 0 0 0 8 204 639 1 1 98 0 0 0 864 45372 11164 1022340 0 0 0 0 198 605 2 0 98 0 1 0 864 45372 11164 1022412 0 0 0 0 170 586 2 1 97 0 0 0 864 45372 11164 1022380 0 0 0 0 185 594 1 0 99 0
ãã©ã¡ã¼ã¿ã®æå³
1è¡ç® | 2è¡ç® | 説æ |
---|---|---|
procs | r | CPUå²ãå½ã¦ä¸ãã¾ãã¯ãå²ãå½ã¦å¯è½ãªããã»ã¹æ° |
b | å²ãè¾¼ã¿ç¦æ¢(I/Oå¾ ã¡ãªã©)ããã¦ããããã»ã¹æ° | |
memory | swapd | 使ç¨ãã¦ããä»®æ³ã¡ã¢ãªãµã¤ãº(KB) |
free | 空ãã¡ã¢ãªãµã¤ãº(KB) | |
buff | ãããã¡ãã£ãã·ã¥(ãããã¯ããã¤ã¹)ã«å²ãå½ã¦ãããã¡ã¢ãªãµã¤ãº(KB) | |
cache | ãã¼ã¸ãã£ãã·ã¥ï¼ãã¡ã¤ã«ï¼ã«å²ãå½ã¦ãããã¡ã¢ãªãµã¤ãº(KB) | |
swap | si | ã¹ã¯ããINã¡ã¢ãªãµã¤ãº(KB/s) |
so | ã¹ã¯ããOUTã¡ã¢ãªãµã¤ãº(KB/s) | |
io | bi | ãããã¯ããã¤ã¹ã«éããããããã¯æ°(blocks/s) |
bo | ãããã¯ããã¤ã¹ããèªã¿åã£ããããã¯æ°(blocks/s) | |
system | in | ï¼ç§ãããã®å²ãè¾¼ã¿åæ° |
cs | 1ç§ãããã®ã³ã³ããã¹ãã¹ã¤ããåæ° | |
cpu | us | ã¦ã¼ã¶ã®CPUå©ç¨ç(%) |
sy | ã·ã¹ãã ã®CPUå©ç¨ç(%) | |
id | CPUã®ã¢ã¤ãã«ç(%) | |
wa | I/Oå¾ ã¡CPUå©ç¨ç(%) |
注ç®ãã¹ãç®æ
1.CPUã®ç¶æ³
procs/r ã®å¤ãCPUã®æ°ãã大ããå ´åãå®è¡ããã»ã¹ãCPUå¾ ã¡ããã¦ããã¨ãããã¨ã«ãªããCPU ãã©ã®å¦çã§å¤ããªã½ã¼ã¹ãå²ãã¦ãããã¯ãcpu/usãcpu/syãcpu/wa ã®å¤ã§ãããã
2.I/Oã®ç¶æ³
procs/b ã®å¤ã大ããå ´åãI/Oå¾
ã¡ããã¦ããããã»ã¹ãå¤ãã¨è¨ããã(é常㯠0)
io/bi, io/bo ã®å¤ã§HDDãªã©ã®èªã¿æ¸ãã®è² è·ç¶æ³ããããã
3.ã¡ã¢ãª/ã¹ã¯ããã®ç¶æ³
swap/si, swap/so ãçºçãã¦ããã¨å®ã¡ã¢ãªãä¸è¶³ãã¦ãããã¨ãããããå®ã¡ã¢ãªãä¸è¶³ããã¨ä»®æ³ã¡ã¢ãªãå©ç¨ãããããä»®æ³ã¡ã¢ãªã¯ä½éã§ããã©ã¼ãã³ã¹ã極端ã«ä½ä¸ãããåå ã«ãªãã
4.ãã®ä»
system/cs ã¯ãåä½ä¸ã®å¦çãããã©ã¼ãã³ã¹ãåºã¦ãããã©ããã®ææ¨ã«ãªããä¾ãã° DBã®ç¨¼åç¶æ³ã確èªãããæã«åèã«ãã¦ãããããã¤ãé©æ£ãªå¤ãã¯ä¸æ¦ã«è¨ããªãããç°å¸¸ãªç¶æ ã¨å¹³å¸¸ãªç¶æ ã§ã¯æããã«éãã
Linux ã·ã¹ãã ã®èª¿æ»ã§ãã使ãã³ãã³ã
Linux ã·ã¹ãã ã®èª¿æ»ããã©ãã«ãçºçããéã®æãããã«ãªãæ å ±ãå¾ãããã«ãã使ãã³ãã³ããã¡ã
netstat
netstat ã¯ããµã¼ãå ã®ãããã¯ã¼ã¯ç¶æ³ã表示ããã³ãã³ãã
ãªãã·ã§ã³
ããå©ç¨ãããªãã·ã§ã³
ãªãã·ã§ã³ | 説æ |
---|---|
-l | ãµã¼ããlistenãã¦ãããã¼ãã®æ å ±ã表示 |
-a | æ¥ç¶ç¶æ³ã connected 以å¤ã®æ å ±ã表示 |
-n | FQDNããããã³ã«ã®åå解決ãè¡ããªã |
-p | ãã¼ããã½ã±ããã使ç¨ãã¦ããããã°ã©ã åã表示ãã |
-u | UDPã®æ¥ç¶ç¶æ³ã表示 |
-t | TCPã®æ¥ç¶ç¶æ³ã表示 |
å®è¡ä¾
$ sudo LANG=C netstat -lanput Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 689/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1246/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1187/exim4 tcp 0 0 0.0.0.0:2401 0.0.0.0:* LISTEN 1224/xinetd
ãã©ã¡ã¼ã¿ã®æå³
ãã©ã¡ã¼ã¿ | 説æ |
---|---|
Proto | 使ç¨ãã¦ãããããã³ã«(tcp/udp/raw) |
Recv-Q | ãã®ã½ã±ããã«æ¥ç¶ãããã¦ã¼ã¶ããã°ã©ã ã«æ¸¡ãããªãã£ããã¼ã¿ã®ãã¤ãæ° |
Send-Q | ãªã¢ã¼ããã¹ãã«åãå ¥ããããªãã£ããã¼ã¿ã®ãã¤ãæ° |
Local Address | ãã¼ã«ã«å´ã½ã±ããã®ã¢ãã¬ã¹ã¨ãã¼ãçªå· |
Foreign Address | ãªã¢ã¼ãå´ã½ã±ããã®ã¢ãã¬ã¹ã¨ãã¼ãçªå· |
State | ç¾å¨ã®æ¥ç¶ç¶æ |
PID/Program name | 使ç¨ãã¦ããããã°ã©ã ã®PIDã¨ããã°ã©ã å |