Absolute Software GmbH - Ihr Dreh- und Angelpunkt für digitale Transformation und effiziente Geschäftsprozesse
Linux ã® top ã³ãã³ãã free ã³ãã³ãã§è¡¨ç¤ºããã cached ã¯ãåæã«ã©ãã©ãå¢ãã¦ããã¾ããfree ããªããªãã¨ãã® cached ãå°ããã¤è§£æ¾ããã¦ä½¿ããã¾ãã cached ã buffers ã空ãã¡ã¢ãªã®ä¸é¨ã§ãã®ã§ãããããæºã¾ã£ã¦ããããã¨ãã£ã¦ç¡çãã解æ¾ãããå¿ è¦ã¯é常ã¯ããã¾ãããcached ãæºãã¦ããã®ã¯ããã©ã¼ãã³ã¹ã®ãããªã®ã§ã解æ¾ãããã¨é常使ç¨æã®ããã©ã¼ãã³ã¹ãè½ã¡ã¾ããéã«ããã解æ¾ãã¦ãããªãã¨ãããã©ã¼ãã³ã¹ã®æ¸¬å®ãªã©ã§ãæ£ããè¨æ¸¬ãã§ãã¾ããã kernel ã® 2.6.16 以éã§ã¯ã解æ¾ãã³ãã³ããã解æ¾ã§ããããã«ãªãã¾ãããroot 㧠# echo 1 > /proc/sys/vm/drop_caches ã®ããã« /proc/sys/vm/drop_caches ã«1ï½3ã®å¤ãæ¸ãè¾¼ã¿ã¾ããå¤ã«ãã£ã¦è§£æ¾ãã
調ã¹ãã¨ãããã®ã§ blog ã«æ¸ãã¦ç解ãæ·±ãããã®ã³ã¼ãã¼ã§ããé·æã§ãã Linux ã§ã·ã¹ãã è² è·ãè¦ãå ´åã«ãä¸è©±ã«ãªãã®ã top ã sar (sysstat ããã±ã¼ã¸ã«å梱ããã¦ãã³ãã³ã) ãªã©ã®ãã¼ã«ã§ãã top ã§ã¯ã·ã¹ãã çµ±è¨ã®ã¹ãããã·ã§ãããè¦ããã¨ãã§ãã¾ããä»ã·ã¹ãã ãã©ãããç¶æ ããªã¼ã¨ããã¨ã㯠top ã便å©ã top - 08:16:54 up 3 days, 14:43, 6 users, load average: 0.18, 0.07, 0.03 Tasks: 43 total, 2 running, 41 sleeping, 0 stopped, 0 zombie Cpu(s): 18.2% us, 0.0% sy, 0.0% ni, 81.8% id, 0.0% wa, 0.0% hi, 0.0% siä¸æ¹ã® sar ã§ã¯10åãã¨ã®ã·
odz buffer - ããã»ã¹ãéãã¦ãããã¡ã¤ã«ã確èªãã ls -l /proc/`pgrep -n java`/fd lsofã§ã調ã¹ããã¾ãã lsof - list open files lsof ãã«ããã«ãã¨çµæãåºã¦ãã¾ããããå¤ããã¦è¨³ããããã -pãªãã·ã§ã³ã§ããã»ã¹IDæå® ### ããã»ã¹IDæå® lsof -p 12345 ### ããã¯ã¯ã©ã¼ã使ãã¨ãããªæã lsof -p `pgrep -n java` -cãªãã·ã§ã³ã§ããã»ã¹åæå® lsof -c java -uãªãã·ã§ã³ã§ã¦ã¼ã¶æå® lsof -u hoge -iãªãã·ã§ã³ [@IPã¢ãã¬ã¹:ãã¼ãçªå·] listenãã¦ããã¼ããåºåãæå®ãããã¼ãã®ã¿è¡¨ç¤ºãããã¨ãã§ããã lsof -i # Listenãã¦ãã®ãããã表示 lsof -i :22 # ssh lsof -i :22,80
ã¡ãã£ã¨ç ½ãæ°å³ã®ã¿ã¤ãã«ã§ãããCPU ããã«ãã³ã¢ã«ãªã 2åã4åã¨å¢ãã¦ããä¸ Linux ã®è² è·ã®æéã«ãªããã¼ãã¢ãã¬ã¼ã¸ãã©ãèªãã¹ãããã¨ãã話ã§ããæ°ã«ãªã£ãã¨ãããå°ã調ã¹ãã®ã§ãã®ã¾ã¨ããã http://d.hatena.ne.jp/naoya/20070222/1172116665 ã§ãæ¸ããã¨ãããLinux ã®ãã¼ãã¢ãã¬ã¼ã¸ã¯ããã¼ãã¢ãã¬ã¼ã¸ã¯éå»1åã5åã15åã®éã®å®è¡å¾ ã¡ããã»ã¹æ°ã®å¹³åæ° = å®è¡ãããã¦ãä»ã®ããã»ã¹ãå®è¡ä¸ã§å®è¡ã§ããªãããã»ã¹ãå¹³åã§ä½åãããåå¨ãã¦ãããã示ãå¤ã§ããããã«ããã¯ã CPUãã¡ã¢ãªããã£ã¹ã¯çã ã©ãã«ãããã¯é¢ä¿ãªããä»äºã®å®è¡ã¾ã§ã«ã©ããããå¾ ãããã¦ãããã示ãå¤ãªã®ã§ãã·ã¹ãã ã®ã¹ã«ã¼ããããè¨æ¸¬ããææ¨ã®å ¥ãå£ã«ãªãå¤ã§ãã ãã®ãã¼ãã¢ãã¬ã¼ã¸ã§ãããå®è£ ãè¦ãã¨ã©ã³ãã¥ã¼(å¾ ã¡è¡å)ã«æºã¾ã£ã
ãµã¼ãã®ã¬ã¹ãã³ã¹ãé ããªãã¨çµé¨ã®ãªããµã¼ã管çè ã¯ç¡æå³ã«ã¡ã¢ãªå¢å¼·ãè¡ã£ãããã¾ãããè¡ãå½ããã°ã£ããã®ã·ã¹ãã æ¡å¼µã¯ç¡é§ãªæè³ã«ã¤ãªããã¾ããããã«ããã¯åæã®èª¿ã¹æ¹ã¯æ¡å¤ç°¡åãªã®ã§ããã®éæ¼ãããã¨ããããã¡ãã¨æ¼ããã¦æ£ããæ¹æ³è«ã§ã·ã¹ãã æ¡å¼µããã¦ããã¾ãããã ãä¸è¬è«ã ããã«ããã¯ã¨ãªãããè¦ç´ ã¯ä¸»ã«ï¼ã¤ã§ãã â CPU使ç¨ç â¡ã¡ã¢ãªä½¿ç¨é â¢ãã£ã¹ã¯I/O â£TCPã³ãã¯ã·ã§ã³æ° ããããæ¼ããã¦ããã°ããã«ããã¯åæã®ææ¡ã¨ãã®è§£æ¶ã¯é£ããããã¾ããããããè¸ã¾ããä¸è¬è«ãè¿°ã¹ã¦ã¿ããã¨æãã¾ãã WEBãµã¼ãã®å ´åã¯å¤ãã®å ´åãTCPã³ãã¯ã·ã§ã³æ°ããå ã«éçãæ¥ã¾ããOSãApacheçã®WEBãµã¼ãã®ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ãååæ½ããã¨ãåæã§ããããã®å ´åTCPã³ãã¯ã·ã§ã³æ°1ä¸ãããã¾ã§ã¯ãªãã¨ãä¿ã¦ãã¨æãã¾ããããã以ä¸ã®TCPã³ãã¯ã·ã§
æå®ããåä½ã§å®¹éã表示ãããkã¯1,000ï¼Kã¯1,024ï¼mã¯1,000,000ï¼Mã¯1,048,576ãã¤ãåä½ã§è¡¨ç¤ºãã vmstatã¯ï¼ã·ã¹ãã å ã®æ å ±ã表示ããã³ãã³ãã ãä¾ãã°ï¼ä¸»ã¡ã¢ãªã¼ã®ç©ºã容éãCPUã®åä½ç¶æ³ãªã©ã表示ããã vmstatã³ãã³ãããã®ã¾ã¾å®è¡ããã¨ï¼ç¾å¨ã®ããã»ã¹ï¼ã¡ã¢ãªã¼ï¼ã¹ã¯ããï¼ããã¤ã¹ï¼å²ãè¾¼ã¿ï¼CPUã®æ å ±ã表示ããããã¾ãï¼ã-dããã-pããªãã·ã§ã³ãä»ããã¨ãã¼ãã£ã·ã§ã³ããã£ã¹ã¯ã¸ã®èªã¿æ¸ãç¶æ³ãªã©ã表示ããããã-fããªãã·ã§ã³ãæå®ããã¨ã·ã¹ãã ãèµ·åãã¦ããã³ãã³ãå®è¡æã¾ã§ã®éã«ï¼ããã»ã¹ãä½æããåæ°ã表示ãããã vmstatã®å¾ã«ç§åä½ã§æéééãæå®ããã¨ï¼æå®ããæéãã¨ã«ã·ã¹ãã ã®ç¶æ³ã表示ããããã¾ãï¼åæ°ãæå®ããã¨ï¼æå®ããåæ°æ å ±ã表示ãããã 容éã«ã¤ãã¦ã¯ã-Sããªãã·ã§ã³ã§åä½ãæå®ã§ãããã-S
æ¥æ¬èªå ¥åã®åãæ¿ããMacã¦ã¼ã¶ã¼åãã«å¤æ´ã 詳ãã解説ã¯ãã¡ãã®ãã¼ã¸ã¸(ãã®ãµã¤ãã®ä½è ããã®è¦æã«ãã ä½æããã¢ããªã§ããã¢ã¤ã³ã³ãä½ã£ã¦ãããã¾ãã)ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}