{"id":947,"date":"2015-07-30T18:27:32","date_gmt":"2015-07-31T03:27:32","guid":{"rendered":"http:\/\/blog.box.kr\/?p=947"},"modified":"2015-07-30T18:27:32","modified_gmt":"2015-07-31T03:27:32","slug":"system-monitoring-command","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=947","title":{"rendered":"System Monitoring command"},"content":{"rendered":"<p><b>1. OS\/system<\/b><\/p>\n<div class=\"txc-textbox\">\n<p><b><\/b>$\u00a0vmstat 2 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/\u00a010 system resource status to every 2 sec.<\/p>\n<p>$ iostat 2 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 10 I\/O status to every 2 sec.<\/p>\n<p>$\u00a0sar\u00a02 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 10 ??? status to every 2 sec.<\/p>\n<p>$ ipcrm -m [Key]p 35020\u00a0 \/\/ \u00a0Remove Shared Memory<\/p>\n<p>$\u00a0netstat -n | grep EST | grep &#8216;:[PORT]&#8217; | wc -l \u00a0\/\/ \u00a0count of connection list for port \u00a0(Web serverconnection count\u00a0, DB connection count, &#8230;)<\/p>\n<p>$\u00a0pstack [PID] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\/\/ Process Stack Trace<\/p>\n<p>$ ipcs -qu \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u00a0list to\u00a0 message queue<\/p>\n<p>$ ipcs -mob | grep 35020 \/\/ \u00a0show to Shared Memory<\/p>\n<p>$ ipcrm -m [Key]p 35020\u00a0 \/\/ \u00a0Remove to Shared Memory<\/p>\n<\/div>\n<p><b><br \/>\n<span id=\"callbacknestdimdimtistorycom44410\"><\/span><\/b><\/p>\n<p><b>2. Java process\u00a0<\/b><\/p>\n<div class=\"txc-textbox\">\n<p>$ $JAVA_HOME\/bin\/jstack [PID] \u00a0 \u00a0 \u00a0 \/\/\u00a0JVM Stack Trace\u00a0[\u00a0Hotspot JDK\u00a0] \u00a0( analysis to daed lock)<\/p>\n<p>$<b>\u00a0<\/b>kill -3 [PID] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ JVM Stack Trace &amp; Heap Dump\u00a0[IBM JDK] \u00a0(analysis to \u00a0daed lock)<\/p>\n<p>$\u00a0jmap -dump:format=b,file=heap.hprof [pid] \u00a0\/\/ runtime heap dump\u00a0[\u00a0Hotspot JDK\u00a0]<\/p>\n<p><span style=\"color: #2f9d27;\">$ jstat -gc -h20 [PID] 3000 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ JVM Heap \uc0ac\uc6a9\ub7c9 \ubc0f\u00a0GC(garbage collection) \ud1b5\uacc4<\/span><\/p>\n<p>$\u00a0<span style=\"font-family: Gulim, \uad74\ub9bc, AppleGothic, sans-serif;\">ps -mo pid,lwp,stime,time,pcpu\u00a0-C java | more \u00a0\/\/ java \ud504\ub85c\uc138\uc2a4\uc758 \uc4f0\ub808\ub4dc\ubcc4 CPU \uc0ac\uc6a9\ub7c9 \ud655\uc778<\/span><\/p>\n<\/div>\n<p><b>\u00a0*\u00a0<\/b><b>java thread dump \ubd84\uc11d\ud560\ub54c\ub294 \uc77c\uc815\uc8fc\uae30(5\ucd08) 10\ud68c\uc815\ub3c4 dump\ub97c \ud574\uc11c \ube44\uad50 \ubd84\uc11d\ud574\uc57c \ud55c\ub2e4.<\/b><b>\u00a0<\/b><\/p>\n<p><b>\u00a0* \ucc38\uace0 :\u00a0<\/b><span style=\"font-family: Gulim, \uad74\ub9bc, AppleGothic, sans-serif;\"><b><a class=\"tx-link\" href=\"http:\/\/architects.dzone.com\/articles\/how-analyze-java-thread-dumps\" target=\"_blank\">http:\/\/architects.dzone.com\/articles\/how-analyze-java-thread-dumps<\/a><\/b><\/span><\/p>\n<p><b>3. Java Heap Dump \ubd84\uc11d \ud234 :\u00a0jstat, jmap, jhat, visualvm, jconsole, MemoryAnalyzer<\/b><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. OS\/system $\u00a0vmstat 2 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/\u00a010 system resource status to every 2 sec. $ iostat 2 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 10 I\/O status to every 2 sec. $\u00a0sar\u00a02 10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 10 ??? status to every 2 sec. $ ipcrm -m [Key]p 35020\u00a0 \/\/ \u00a0Remove Shared Memory $\u00a0netstat -n | grep EST | grep &#8216;:[PORT]&#8217; | wc -l \u00a0\/\/ \u00a0count of connection list for port \u00a0(Web serverconnection count\u00a0, DB connection count, &#8230;) $\u00a0pstack [PID] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\/\/ Process Stack Trace $ ipcs -qu \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u00a0list to\u00a0 message queue $ ipcs -mob | grep 35020 \/\/ \u00a0show to Shared Memory $ ipcrm -m [Key]p 35020\u00a0 \/\/ \u00a0Remove to Shared Memory 2. Java process\u00a0 $ $JAVA_HOME\/bin\/jstack [PID] \u00a0 \u00a0 \u00a0 \/\/\u00a0JVM Stack Trace\u00a0[\u00a0Hotspot JDK\u00a0] \u00a0( analysis to daed lock) $\u00a0kill -3 [PID] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ JVM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4,5],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-fh","jetpack-related-posts":[{"id":750,"url":"https:\/\/blog.box.kr\/?p=750","url_meta":{"origin":947,"position":0},"title":"NGINX: SELinux Changes when Upgrading to RHEL 6.6 \/ CentOS 6.6","date":"2015-05-08","format":false,"excerpt":"If you upgrade a running system to Red Hat Enterprise Linux (RHEL) 6.6 or CentOS 6.6, the Security Enhanced Linux (SELinux) security permissions that apply to NGINX are\u00a0relabelled to a much stricter posture. Although the permissions are adequate for the default configuration of NGINX, configuration for additional features can be\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":830,"url":"https:\/\/blog.box.kr\/?p=830","url_meta":{"origin":947,"position":1},"title":"[scrap]50 Most Frequently Used UNIX \/ Linux Commands (With Examples)","date":"2015-05-20","format":false,"excerpt":"http:\/\/www.thegeekstuff.com\/2010\/11\/50-linux-commands\/ \u00a0 This article provides practical examples for 50 most frequently used commands in Linux \/ UNIX. This is not a comprehensive list by any means, but this should give you a jumpstart on some of the common Linux commands. Bookmark this article for your future reference. Did I miss\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":799,"url":"https:\/\/blog.box.kr\/?p=799","url_meta":{"origin":947,"position":2},"title":"[scrap] grep , sed, awk \uc815\uaddc\uc2dd","date":"2015-05-17","format":false,"excerpt":"** grep \ud55c \ub370\uc774\ud130 \uc911 3\ubc88\uc9f8 \ud56d\ubaa9\ub9cc \uac00\uc838 \uc624\uace0 \uc2f6\uc744\ub54c.. grep \".xml\" | awk 'print {$3}' http:\/\/unabated.tistory.com\/447 \uc815\uaddc\uc2dd\uc774\ub780 \ubb34\uc5c7\uc778\uac00 ? \uc5b4\ub5a4 \ubb38\uc790\uc5f4\uc758 \uc9d1\ud569\uc744 \ubb18\uc0ac\ud558\ub294\ub370 \uc0ac\uc6a9\ub418\ub294 \ud14d\uc2a4\ud2b8 \uc2a4\ud2b8\ub9c1 \uc815\ud574\uc9c4 \uad6c\ubb38 \uaddc\uce59\uc5d0 \ub530\ub978\ub2e4 Editor, Utillity, Programming \uc5b8\uc5b4\uc5d0\uc11c \ud14d\uc2a4\ud2b8 \ud328\ud134\uc744 \uae30\uc900\uc73c\ub85c \uac80\uc0c9, \ud639\uc740 \uc870\uc791\ud558\ub294\ub370 \uc0ac\uc6a9\ub41c\ub2e4 \ubcf4\ud1b5 \uc0ac\ub78c\ub4e4\uc774 \uc4f0\ub294 \ud45c\ud604 \uc911\uc5d0\ub3c4 \uadf8\ub300\ub85c \ubb38\uc7a5\uc744 \ud574\uc11d\ud558\uba74\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":828,"url":"https:\/\/blog.box.kr\/?p=828","url_meta":{"origin":947,"position":3},"title":"[scrap]Top 25 Best Linux Performance Monitoring and Debugging Tools","date":"2015-05-20","format":false,"excerpt":"http:\/\/www.thegeekstuff.com\/2011\/12\/linux-performance-monitoring-tools\/ I\u2019ve compiled 25 performance monitoring and debugging tools that will be helpful when you are working on Linux environment. This list is not comprehensive or authoritative by any means. However this list has enough tools for you to play around and pick the one that is suitable your specific\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":716,"url":"https:\/\/blog.box.kr\/?p=716","url_meta":{"origin":947,"position":4},"title":"CentOS SSH Installation And Configuration","date":"2015-04-15","format":false,"excerpt":"http:\/\/www.cyberciti.biz\/faq\/centos-ssh\/ \u00a0 How do I install and configure ssh server and client under CentOS Linux operating systems? You need to install the following packages (which are installed by default until and unless you removed it or skipped it while installing CentOS) openssh-clients : The OpenSSH client applications openssh-server : The\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":675,"url":"https:\/\/blog.box.kr\/?p=675","url_meta":{"origin":947,"position":5},"title":"[Linux] CentOS 7 \/ RHEL 7\uc5d0 redis \uc124\uce58 \ud558\uae30","date":"2015-04-13","format":false,"excerpt":"Project URL : http:\/\/redis.io\/ CentOS 7 and Red Hat Enterprise Linux 7\uc5d0\uc11c Redis\ub97c \uc124\uce58 \ud558\ub294 \ubc29\ubc95 EPEL \uc800\uc7a5\uc18c \ub4f1\ub85d \ud558\uae30 EPEL \uc800\uc7a5\uc18c\ub97c \uba3c\uc800 \ub4f1\ub85d\ud55c\ub2e4. wget -r --no-parent -A 'epel-release-*.rpm' http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/ rpm -Uvh dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-*.rpm \/etc\/yum.repos.d\u00a0 \ud558\uc704 \ub514\ub809\ud1a0\ub9ac\uc5d0 \uc544\ub798\uc640 \uac19\uc774 2\uac1c\uc758 epel \uc800\uc7a5\uc18c\uac00 \ub4f1\ub85d\ub41c\ub2e4. 1. epel.repo 2.epel-testing.repo [root@localhost ~]# ls -l \/etc\/yum.repos.d\/\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/947"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=947"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/947\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}