俺ã®è©±ãèãï¼ï¼LTå¤§ä¼ #8ã§ãã¼ã¯ããè³æã§ã
glances ã¤ã³ã¹ãã¼ã« 使ãæ¹ ctop ã¤ã³ã¹ãã¼ã« 使ãæ¹ gtop ã¤ã³ã¹ãã¼ã« 使ãæ¹ htop ã¤ã³ã¹ãã¼ã« 使ãæ¹ vtop ã¤ã³ã¹ãã¼ã« 使ãæ¹ cpustat ã¤ã³ã¹ãã¼ã« 使ãæ¹ GitHubãçºãã¦ãããtopã®ä»£ããã¨ãã¦ä½¿ããããªã³ãã³ããè²ã ãã£ãã®ã§è©¦ãã¦ã¿ãã glances Glances - An Eye on your systemï¼å ¬å¼ãã¼ã¸ï¼ github.com glancesã¯è²ã ãªæ å ±ã表示ã§ããã¢ãã¿ãªã³ã°ãã¼ã«ã ã¤ã³ã¹ãã¼ã« pipã§ã¤ã³ã¹ãã¼ã«ã§ããã®ã§ä¸è¨ã³ãã³ããå®è¡ã $ pip install glances 使ãæ¹ glancesã§èµ·åã§ãããå³ã®ããã«è²ã ãªæ å ±ãã¾ã¨ãã¦è¡¨ç¤ºå¯è½ã ãã©ã¦ã¶ã§ç¢ºèªã§ããWebãµã¼ãã¢ã¼ããããªã¢ã¼ããã·ã³ãç£è¦ããã¯ã©ã¤ã¢ã³ãï¼ãµã¼ãã¢ã¼ããããããã ã ctop ctopï¼å ¬å¼ãã¼ã¸
ã¿ã¤ãã«ã¯é£ãã½ãã ä»æ¥ããã§æ¸ãã®ã¯ããããæè¿ç¥ã£ããã¨ã ã£ããããã®ãå¤ããã§ããããã£ãããªã®ã§æ¸ãã¦ãããããªãã¨æã£ã次第ã§ããLinuxã£ã¦æ¸ãã¦ããã©ãæ®éã«Macã§ã使ããããºã§ãã ç¥ã£ã¦ã人ã«ã¨ã£ã¦ã¯ã¢ã¿ãªãã¨ã®ãã¨ã§ããã©ãâ¦â¦ã ãã¡ã¤ã«ãµã¤ãºã®æ¡ã§ãããã¦ããããã ls ã¨ã duãããã§ä½¿ãã話ã§ããã ãã¡ã¤ã«ãµã¤ãºã大ãããã¦ããã¨è¦ããããªããã£ã¦ãããã¨ã£ã¦ãããããªãã§ãããããã¾ããããããããã ãããªæ㯠-h ãªãã·ã§ã³ã使ãã¾ãããã $ ls -l /var/log/nginx/access.log -rw-r--r-- 1 root root 1897381 8æ 26 02:50 2012 /var/log/nginx/access.log $ ls -lh /var/log/nginx/access.log -rw-r--r--
ãµã¼ãã¼ã®ãªã½ã¼ã¹ãè¦ãã«ã¯ã°ã©ãåã¯éè¦ã§ãããæ¨ç§»ã§ã¯ãªããªã¢ã«ã¿ã¤ã ãªç¶æ³ãä¾ãã°ç§åä½ã®ã¹ãã¤ãã¼ãªè² è·ãè¦ãã«ã¯ããµã¼ãã¼ä¸ã§vmstatãiostatãªã©ã®*statãã¡ããªã¼ãå©ãå¿ è¦ãããã¾ãã ãã¦ãvmstatã¯ã¡ã¢ãªã®ç¶æ³ããããã¯æ°åä½ã®I/Oç¶æ³ã¯è¦ããã¾ããããã¤ãåä½ã®I/Oç¶æ³ããããã¯ã¼ã¯ã®éä¿¡ãåä¿¡ãã¤ãæ°ãè¦ããã¨ã¯ã§ãã¾ããã # 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 3 1 0 4724956 355452 726532 0 0 54 484 3 3 1 0 99 0 0 2 0 0 47
å人çã«ããã¹ããã¡ã¤ã«ãå¦çãããã¨ãå¤ãã®ã§ããï¼ç°¡åãªå¦çãªãUnixã®ã³ãã³ãããã¤ãã¨ãªãã¤ã¬ã¯ãã§çµã¿åããã¦ã§ãããã¨ãå¤ãããã¾ãï¼ä»åã¯ãããªãªãã§ãã¡ãã£ã¨ããã¢ãã¯ãªTIPSãã¾ã¨ãã¦ã¿ã¾ããï¼ sortã³ãã³ãã§ã¿ãåºåãã®ãã¡ã¤ã«ãæå®ããæè¿ç¥ã£ã¦é©æããã®ãããï¼sortã³ãã³ãã§ã¿ãåºåãã®ãã¡ã¤ã«ãæå®ãããã¨ãã¯ï¼Ctrl+v Tabã§ã¿ãæåãå ¥åãã¦ããã®ã§ããï¼$ sort -t $'\t' -k 2,2 ã®ããã«ãã¦ã¿ãåºåãã§2çªç®ã®ãã¼ã§ã½ã¼ããããã¨ãã§ãã¾ãï¼ 1000è¡ããã«ãã¼ã¿ããµã³ããªã³ã°ãã1000è¡ããã«ãã¡ã¤ã«ãããã¼ã¿ããµã³ããªã³ã°ãããã¨ãã¨ãã¯ï¼perlã§ã¯ã³ã©ã¤ãã¼ãæ¸ãã®ãéãããã§ãï¼$ perl -ne '$i++; print unless ($i % 1000)' ææã®ã³ã¼ãã´ã«ãã«ããã¨ããã ãçãã§ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}