{"id":46675,"date":"2025-07-30T03:51:41","date_gmt":"2025-07-29T19:51:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/46675.html"},"modified":"2025-07-30T03:51:41","modified_gmt":"2025-07-29T19:51:41","slug":"%e5%a6%82%e4%bd%95%e6%8e%92%e6%9f%a5%e6%9c%8d%e5%8a%a1%e5%99%a8-cpu-%e9%a3%99%e9%ab%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/46675.html","title":{"rendered":"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8"},"content":{"rendered":"<p>\u670d\u52a1\u5668 CPU \u98d9\u9ad8&#xff08;CPU \u4f7f\u7528\u7387\u6301\u7eed\u8d85\u8fc7 80% \u751a\u81f3\u63a5\u8fd1 100%&#xff09;\u662f\u5178\u578b\u7684\u6027\u80fd\u74f6\u9888\u95ee\u9898&#xff0c;\u53ef\u80fd\u7531\u5e94\u7528\u903b\u8f91\u7f3a\u9677\u3001\u8d44\u6e90\u7ade\u4e89\u3001\u5916\u90e8\u538b\u529b\u6216\u786c\u4ef6\/\u7cfb\u7edf\u5f02\u5e38\u5f15\u8d77\u3002\u4ee5\u4e0b\u662f\u7cfb\u7edf\u5316\u7684\u6392\u67e5\u6b65\u9aa4&#xff0c;\u8986\u76d6\u4ece\u73b0\u8c61\u786e\u8ba4\u5230\u6839\u56e0\u5b9a\u4f4d\u7684\u5168\u6d41\u7a0b\u3002<\/p>\n<h4>\u200b\u4e00\u3001\u786e\u8ba4 CPU \u98d9\u9ad8\u7684\u73b0\u8c61\u4e0e\u8303\u56f4\u200b<\/h4>\n<p>\u9996\u5148\u9700\u660e\u786e CPU \u9ad8\u8d1f\u8f7d\u7684\u5177\u4f53\u8868\u73b0\u548c\u5f71\u54cd\u8303\u56f4&#xff0c;\u907f\u514d\u8bef\u5224&#xff1a;<\/p>\n<h5>\u200b1. \u533a\u5206\u7528\u6237\u6001&#xff08;User&#xff09;\u4e0e\u5185\u6838\u6001&#xff08;System&#xff09;CPU\u200b<\/h5>\n<p>\u901a\u8fc7 top \u6216 htop \u67e5\u770b CPU \u4f7f\u7528\u7387\u7ec6\u5206&#xff1a;<\/p>\n<ul>\n<li>\u200b\u7528\u6237\u6001&#xff08;User&#xff09;\u200b\u200b&#xff1a;\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u6267\u884c\u5360\u7528\u7684 CPU&#xff08;\u5982\u4e1a\u52a1\u903b\u8f91\u3001\u8ba1\u7b97&#xff09;\u3002<\/li>\n<li>\u200b\u5185\u6838\u6001&#xff08;System&#xff09;\u200b\u200b&#xff1a;\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u6267\u884c\u5360\u7528\u7684 CPU&#xff08;\u5982 I\/O \u8c03\u5ea6\u3001\u7f51\u7edc\u534f\u8bae\u6808\u3001\u8fdb\u7a0b\u8c03\u5ea6&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u200b\u5173\u952e\u7ed3\u8bba\u200b&#xff1a;<\/p>\n<ul>\n<li>\u82e5\u7528\u6237\u6001 CPU \u9ad8&#xff1a;\u95ee\u9898\u901a\u5e38\u5728\u5e94\u7528\u7a0b\u5e8f&#xff08;\u5982\u6b7b\u5faa\u73af\u3001\u9891\u7e41\u8ba1\u7b97&#xff09;\u3002<\/li>\n<li>\u82e5\u5185\u6838\u6001 CPU \u9ad8&#xff1a;\u95ee\u9898\u53ef\u80fd\u5728 I\/O \u963b\u585e\u3001\u7f51\u7edc\u6d41\u91cf\u8fc7\u5927\u6216\u7cfb\u7edf\u8c03\u7528\u9891\u7e41\u3002<\/li>\n<\/ul>\n<h5>\u200b2. \u786e\u8ba4\u662f\u6301\u7eed\u9ad8\u8d1f\u8f7d\u8fd8\u662f\u95f4\u6b47\u6027\u9ad8\u8d1f\u8f7d\u200b<\/h5>\n<ul>\n<li>\u200b\u6301\u7eed\u9ad8\u8d1f\u8f7d\u200b&#xff1a;\u53ef\u80fd\u662f\u5e94\u7528\u903b\u8f91\u7f3a\u9677&#xff08;\u5982\u6b7b\u5faa\u73af&#xff09;\u3001\u5185\u5b58\u6cc4\u6f0f\u5bfc\u81f4\u9891\u7e41 GC&#xff0c;\u6216\u5916\u90e8\u6301\u7eed\u538b\u529b&#xff08;\u5982 DDoS \u653b\u51fb&#xff09;\u3002<\/li>\n<li>\u200b\u95f4\u6b47\u6027\u9ad8\u8d1f\u8f7d\u200b&#xff1a;\u53ef\u80fd\u662f\u6279\u91cf\u4efb\u52a1&#xff08;\u5982\u5b9a\u65f6\u4efb\u52a1&#xff09;\u3001\u7a81\u53d1\u6d41\u91cf&#xff08;\u5982\u79d2\u6740\u6d3b\u52a8&#xff09;\u6216\u8d44\u6e90\u7ade\u4e89&#xff08;\u5982\u9501\u4e89\u7528&#xff09;\u3002<\/li>\n<\/ul>\n<h5>\u200b3. \u5b9a\u4f4d\u9ad8\u8d1f\u8f7d\u7684\u8fdb\u7a0b\/\u7ebf\u7a0b\u200b<\/h5>\n<p>\u4f7f\u7528\u5de5\u5177\u9501\u5b9a\u5177\u4f53\u662f\u54ea\u4e2a\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u5360\u7528\u4e86\u5927\u91cf CPU&#xff1a;<\/p>\n<h6>\u200b\u200b(1) \u7cfb\u7edf\u7ea7\u5de5\u5177&#xff1a;top\/htop\u200b<\/h6>\n<ul>\n<li>top \u547d\u4ee4&#xff1a;\u6309 P \u952e\u6309 CPU \u4f7f\u7528\u7387\u6392\u5e8f&#xff0c;\u627e\u5230\u5360\u7528\u6700\u9ad8\u7684\u8fdb\u7a0b&#xff08;PID&#xff09;\u3002\n<p>top -c  # \u663e\u793a\u5b8c\u6574\u547d\u4ee4\u884c\n<\/li>\n<li>htop&#xff08;\u66f4\u53cb\u597d\u7684\u4ea4\u4e92\u5f0f\u5de5\u5177&#xff09;&#xff1a;\u652f\u6301\u6811\u5f62\u67e5\u770b\u8fdb\u7a0b\u5173\u7cfb&#xff0c;\u6309 F6 \u9009\u62e9\u6392\u5e8f\u65b9\u5f0f&#xff08;\u5982 CPU \u5360\u7528&#xff09;\u3002<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u8fdb\u7a0b\u7ea7\u5de5\u5177&#xff1a;pidstat\u200b<\/h6>\n<p>\u901a\u8fc7 pidstat \u67e5\u770b\u8fdb\u7a0b\u7684 CPU \u4f7f\u7528\u7ec6\u8282&#xff08;\u9700\u5b89\u88c5 sysstat \u5305&#xff09;&#xff1a;<\/p>\n<p>pidstat -u 1 5  # \u6bcf 1 \u79d2\u8f93\u51fa\u4e00\u6b21&#xff0c;\u5171 5 \u6b21&#xff0c;\u663e\u793a\u8fdb\u7a0b\u7684 CPU \u4f7f\u7528\u7387<\/p>\n<h6>\u200b\u200b(3) \u7ebf\u7a0b\u7ea7\u5de5\u5177&#xff1a;top -H \u6216 jstack&#xff08;Java \u5e94\u7528&#xff09;\u200b\u200b<\/h6>\n<ul>\n<li>\u200b\u975e Java \u5e94\u7528\u200b&#xff1a;\u901a\u8fc7 top -H -p &lt;PID&gt; \u67e5\u770b\u8fdb\u7a0b\u5185\u7684\u7ebf\u7a0b CPU \u5360\u7528&#xff08;-H \u663e\u793a\u7ebf\u7a0b&#xff09;\u3002<\/li>\n<li>\u200bJava \u5e94\u7528\u200b&#xff1a;\u4f7f\u7528 jstack &lt;PID&gt; \u751f\u6210\u7ebf\u7a0b\u8f6c\u50a8&#xff0c;\u7ed3\u5408 grep \u8fc7\u6ee4\u963b\u585e\u6216\u8fd0\u884c\u4e2d\u7684\u7ebf\u7a0b&#xff1a;\n<p>jstack &lt;PID&gt; | grep -A 20 &#034;java.lang.Thread.State: RUNNABLE&#034;  # \u67e5\u770b\u8fd0\u884c\u4e2d\u7684\u7ebf\u7a0b\n<\/li>\n<\/ul>\n<h4>\u200b\u4e8c\u3001\u5206\u6790\u9ad8 CPU \u8fdb\u7a0b\u7684\u5177\u4f53\u539f\u56e0\u200b<\/h4>\n<p>\u9501\u5b9a\u9ad8 CPU \u8fdb\u7a0b\u540e&#xff0c;\u9700\u6df1\u5165\u5206\u6790\u5176\u5185\u90e8\u903b\u8f91\u6216\u5916\u90e8\u4ea4\u4e92&#xff0c;\u5e38\u89c1\u539f\u56e0\u53ca\u6392\u67e5\u65b9\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<h5>\u200b1. \u5e94\u7528\u7a0b\u5e8f\u903b\u8f91\u7f3a\u9677&#xff08;\u7528\u6237\u6001 CPU \u9ad8&#xff09;\u200b\u200b<\/h5>\n<p>\u200b\u5178\u578b\u573a\u666f\u200b&#xff1a;\u6b7b\u5faa\u73af\u3001\u9012\u5f52\u672a\u7ec8\u6b62\u3001\u9891\u7e41\u8ba1\u7b97&#xff08;\u5982\u52a0\u5bc6\/\u538b\u7f29&#xff09;\u3001\u9519\u8bef\u7684\u5206\u9875\u67e5\u8be2&#xff08;\u5168\u8868\u626b\u63cf&#xff09;\u3002<\/p>\n<h6>\u200b\u200b(1) Java \u5e94\u7528&#xff1a;\u68c0\u67e5\u7ebf\u7a0b\u72b6\u6001\u4e0e\u8c03\u7528\u6808\u200b<\/h6>\n<ul>\n<li>\n<p>\u200b\u6b7b\u5faa\u73af\/\u65e0\u9650\u9012\u5f52\u200b&#xff1a;\u7ebf\u7a0b\u8f6c\u50a8\u4e2d\u82e5\u5927\u91cf\u7ebf\u7a0b\u5904\u4e8e RUNNABLE \u72b6\u6001&#xff0c;\u4e14\u8c03\u7528\u6808\u663e\u793a\u91cd\u590d\u65b9\u6cd5&#xff08;\u5982 while(true) \u5faa\u73af&#xff09;&#xff0c;\u53ef\u80fd\u662f\u6b7b\u5faa\u73af\u3002<br \/>\n\u793a\u4f8b&#xff08;\u6b7b\u5faa\u73af&#xff09;&#xff1a;<\/p>\n<p>&#034;http-nio-8080-exec-1&#034; #12 prio&#061;5 os_prio&#061;0 tid&#061;0x00007f8e3c0b8000 nid&#061;0x4567 runnable [0x00007f8e2c1fe000]<br \/>\n   java.lang.Thread.State: RUNNABLE<br \/>\n    at com.example.DeadlockDemo.infiniteLoop(DeadlockDemo.java:20)  # \u91cd\u590d\u8c03\u7528\u81ea\u8eab<br \/>\n    &#8230;\n<\/li>\n<li>\n<p>\u200b\u9891\u7e41 GC\u200b&#xff1a;\u901a\u8fc7 jstat -gcutil &lt;PID&gt; \u67e5\u770b GC \u9891\u7387&#xff08;FGC \u9891\u7e41\u4e14 GCT \u5360\u6bd4\u9ad8&#xff09;&#xff0c;\u53ef\u80fd\u662f\u5185\u5b58\u6cc4\u6f0f\u6216\u5927\u5bf9\u8c61\u5206\u914d\u5bfc\u81f4\u3002<\/p>\n<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u975e Java \u5e94\u7528&#xff1a;\u68c0\u67e5\u8fdb\u7a0b\u8c03\u7528\u6808\u200b<\/h6>\n<p>\u4f7f\u7528 strace&#xff08;Linux&#xff09;\u8ddf\u8e2a\u8fdb\u7a0b\u7684\u7cfb\u7edf\u8c03\u7528&#xff0c;\u5b9a\u4f4d\u8017\u65f6\u64cd\u4f5c&#xff1a;<\/p>\n<p>strace -p &lt;PID&gt; -c  # \u7edf\u8ba1\u7cfb\u7edf\u8c03\u7528\u8017\u65f6&#xff08;-c \u663e\u793a\u7edf\u8ba1&#xff09;<\/p>\n<p>\u82e5\u53d1\u73b0\u5927\u91cf read()\u3001write() \u6216 poll() \u8c03\u7528&#xff0c;\u53ef\u80fd\u662f I\/O \u963b\u585e\u6216\u7f51\u7edc\u6d41\u91cf\u8fc7\u5927\u3002<\/p>\n<h5>\u200b2. I\/O \u963b\u585e\u5bfc\u81f4\u5185\u6838\u6001 CPU \u9ad8\u200b<\/h5>\n<p>\u200b\u5178\u578b\u573a\u666f\u200b&#xff1a;\u78c1\u76d8 I\/O \u6162&#xff08;\u5982\u673a\u68b0\u76d8 vs SSD&#xff09;\u3001\u7f51\u7edc I\/O \u963b\u585e&#xff08;\u5982\u5927\u91cf\u672a\u5b8c\u6210\u7684 Socket \u8fde\u63a5&#xff09;\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u8017\u5c3d\u3002<\/p>\n<h6>\u200b\u200b(1) \u78c1\u76d8 I\/O \u95ee\u9898\u200b<\/h6>\n<ul>\n<li>\u4f7f\u7528 iostat \u67e5\u770b\u78c1\u76d8 I\/O \u5229\u7528\u7387&#xff08;%util \u63a5\u8fd1 100% \u8868\u793a\u78c1\u76d8\u6ee1\u8d1f\u8377&#xff09;&#xff1a;\n<p>iostat -d 1 5  # \u6bcf 1 \u79d2\u8f93\u51fa\u4e00\u6b21\u78c1\u76d8 I\/O \u7edf\u8ba1\n<\/li>\n<li>\u82e5 %util \u9ad8\u4e14 await&#xff08;\u5e73\u5747 I\/O \u7b49\u5f85\u65f6\u95f4&#xff09;\u5927&#xff0c;\u53ef\u80fd\u662f\u78c1\u76d8\u6027\u80fd\u4e0d\u8db3\u6216\u5b58\u5728\u5927\u91cf\u968f\u673a\u8bfb\u5199&#xff08;\u5982\u6570\u636e\u5e93\u65e5\u5fd7\u5199\u5165&#xff09;\u3002<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u7f51\u7edc I\/O \u95ee\u9898\u200b<\/h6>\n<ul>\n<li>\u4f7f\u7528 netstat \u6216 ss \u67e5\u770b\u7f51\u7edc\u8fde\u63a5\u72b6\u6001&#xff08;\u5982\u5927\u91cf TIME_WAIT \u6216 ESTABLISHED \u8fde\u63a5&#xff09;&#xff1a;\n<p>ss -ant | grep ESTAB  # \u67e5\u770b\u5df2\u5efa\u7acb\u7684 TCP \u8fde\u63a5\u6570\n<\/li>\n<li>\u82e5\u8fde\u63a5\u6570\u8fc7\u591a&#xff08;\u5982\u8d85\u8fc7 ulimit -n \u9650\u5236&#xff09;&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u8fdb\u7a0b\u963b\u585e\u5728 accept() \u6216 connect()&#xff0c;\u95f4\u63a5\u63a8\u9ad8\u5185\u6838\u6001 CPU\u3002<\/li>\n<\/ul>\n<h5>\u200b3. \u9501\u7ade\u4e89\u4e0e\u7ebf\u7a0b\u4e89\u7528\u200b<\/h5>\n<p>\u200b\u5178\u578b\u573a\u666f\u200b&#xff1a;\u591a\u4e2a\u7ebf\u7a0b\u7ade\u4e89\u540c\u4e00\u628a\u9501&#xff08;\u5982 synchronized\u3001ReentrantLock&#xff09;&#xff0c;\u5bfc\u81f4\u7ebf\u7a0b\u9891\u7e41\u963b\u585e\/\u5524\u9192\u3002<\/p>\n<h6>\u200b\u200b(1) Java \u5e94\u7528&#xff1a;\u68c0\u67e5\u9501\u7ade\u4e89\u200b<\/h6>\n<ul>\n<li>\u4f7f\u7528 jstack \u67e5\u770b\u7ebf\u7a0b\u7684\u9501\u6301\u6709\u4e0e\u7b49\u5f85\u5173\u7cfb&#xff08;locked \u548c waiting to lock \u5b57\u6bb5&#xff09;&#xff1a;\n<p>&#034;Thread-1&#034;:<br \/>\n  waiting to lock &lt;0x000000076b45a2c0&gt; (a java.lang.Object)<br \/>\n  which is held by &#034;Thread-0&#034;<\/p>\n<p>&#034;Thread-0&#034;:<br \/>\n  locked &lt;0x000000076b45a2c0&gt; (a java.lang.Object)<br \/>\n  waiting to lock &lt;0x000000076b45a290&gt; (a java.lang.Object)<br \/>\n\u6b64\u7247\u6bb5\u8868\u660e\u7ebf\u7a0b Thread-0 \u548c Thread-1 \u4e92\u76f8\u7b49\u5f85\u5bf9\u65b9\u6301\u6709\u7684\u9501&#xff0c;\u5f62\u6210\u9501\u7ade\u4e89\u3002<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u975e Java \u5e94\u7528&#xff1a;\u4f7f\u7528 perf \u5206\u6790\u200b<\/h6>\n<p>Linux \u4e0b\u4f7f\u7528 perf \u5de5\u5177\u5206\u6790\u9501\u7ade\u4e89&#xff08;\u9700 root \u6743\u9650&#xff09;&#xff1a;<\/p>\n<p>perf top -p &lt;PID&gt;  # \u5b9e\u65f6\u67e5\u770b\u8fdb\u7a0b\u7684\u70ed\u70b9\u51fd\u6570&#xff08;\u5982\u9501\u83b7\u53d6\/\u91ca\u653e&#xff09;<\/p>\n<h5>\u200b4. \u5916\u90e8\u538b\u529b&#xff1a;\u7a81\u53d1\u6d41\u91cf\u6216\u6076\u610f\u8bf7\u6c42\u200b<\/h5>\n<p>\u200b\u5178\u578b\u573a\u666f\u200b&#xff1a;DDoS \u653b\u51fb\u3001\u6279\u91cf\u4efb\u52a1&#xff08;\u5982\u5b9a\u65f6\u4efb\u52a1\u5e76\u53d1\u6267\u884c&#xff09;\u3001\u722c\u866b\u9ad8\u9891\u8bbf\u95ee\u3002<\/p>\n<h6>\u200b\u200b(1) \u68c0\u67e5\u7f51\u7edc\u6d41\u91cf\u200b<\/h6>\n<ul>\n<li>\u4f7f\u7528 iftop \u6216 nload \u67e5\u770b\u7f51\u7edc\u5e26\u5bbd\u5360\u7528&#xff08;\u5982\u67d0\u4e2a IP \u53d1\u9001\u5927\u91cf\u8bf7\u6c42&#xff09;&#xff1a;\n<p>iftop -i eth0  # \u5b9e\u65f6\u663e\u793a\u7f51\u7edc\u63a5\u53e3\u6d41\u91cf\n<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u68c0\u67e5\u5e94\u7528\u65e5\u5fd7\u200b<\/h6>\n<ul>\n<li>\u67e5\u770b Web \u670d\u52a1\u5668&#xff08;\u5982 Nginx\u3001Tomcat&#xff09;\u7684\u8bbf\u95ee\u65e5\u5fd7&#xff0c;\u7edf\u8ba1\u9ad8\u9891\u8bf7\u6c42\u7684 URL \u6216 IP&#xff1a;\n<p>grep &#034;GET \/api&#034; access.log | awk &#039;{print $1}&#039; | sort | uniq -c | sort -nr  # \u7edf\u8ba1 IP \u8bbf\u95ee\u6b21\u6570\n<\/li>\n<\/ul>\n<h5>\u200b5. \u786c\u4ef6\u6216\u7cfb\u7edf\u5f02\u5e38\u200b<\/h5>\n<p>\u200b\u5178\u578b\u573a\u666f\u200b&#xff1a;CPU \u672c\u8eab\u6545\u969c&#xff08;\u5982\u8fc7\u70ed\u964d\u9891&#xff09;\u3001BIOS \u914d\u7f6e\u9519\u8bef\u3001\u5185\u6838\u6a21\u5757\u51b2\u7a81\u3002<\/p>\n<h6>\u200b\u200b(1) \u68c0\u67e5 CPU \u6e29\u5ea6\u4e0e\u98ce\u6247\u200b<\/h6>\n<ul>\n<li>\u4f7f\u7528 sensors \u5de5\u5177&#xff08;\u9700\u5b89\u88c5 lm-sensors \u5305&#xff09;\u67e5\u770b CPU \u6e29\u5ea6&#xff1a;\n<p>sensors  # \u663e\u793a CPU \u6838\u5fc3\u6e29\u5ea6&#xff08;\u5982 Core 0: &#043;85\u00b0C&#xff09;<br \/>\n\u82e5\u6e29\u5ea6\u8fc7\u9ad8&#xff08;\u8d85\u8fc7 90\u00b0C&#xff09;&#xff0c;\u53ef\u80fd\u662f\u6563\u70ed\u4e0d\u826f\u5bfc\u81f4 CPU \u964d\u9891&#xff08;\u6027\u80fd\u4e0b\u964d\u4f46\u529f\u8017\u9ad8&#xff09;\u3002<\/li>\n<\/ul>\n<h6>\u200b\u200b(2) \u68c0\u67e5\u5185\u6838\u65e5\u5fd7\u200b<\/h6>\n<p>\u67e5\u770b \/var\/log\/syslog \u6216 \/var\/log\/kern.log&#xff0c;\u5bfb\u627e\u786c\u4ef6\u9519\u8bef\u6216\u5f02\u5e38&#xff1a;<\/p>\n<p>dmesg | grep -i &#034;error\\\\|warning&#034;  # \u663e\u793a\u5185\u6838\u9519\u8bef\/\u8b66\u544a\u4fe1\u606f<\/p>\n<h4>\u200b\u4e09\u3001\u603b\u7ed3&#xff1a;\u6392\u67e5\u6d41\u7a0b\u4e0e\u5de5\u5177\u94fe\u200b<\/h4>\n<table>\n<tr>\u200b\u6b65\u9aa4\u200b\u200b\u76ee\u6807\u200b\u200b\u5173\u952e\u5de5\u5177\/\u547d\u4ee4\u200b<\/tr>\n<tbody>\n<tr>\n<td>\u786e\u8ba4 CPU \u98d9\u9ad8\u73b0\u8c61<\/td>\n<td>\u533a\u5206\u7528\u6237\u6001\/\u5185\u6838\u6001&#xff0c;\u5b9a\u4f4d\u8fdb\u7a0b\/\u7ebf\u7a0b<\/td>\n<td>top\u3001htop\u3001pidstat<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u6790\u9ad8\u8d1f\u8f7d\u8fdb\u7a0b<\/td>\n<td>\u9501\u5b9a\u5177\u4f53\u5e94\u7528\u6216\u670d\u52a1<\/td>\n<td>jstack&#xff08;Java&#xff09;\u3001strace&#xff08;\u975e Java&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u67e5\u5e94\u7528\u903b\u8f91\u7f3a\u9677<\/td>\n<td>\u6b7b\u5faa\u73af\u3001\u9891\u7e41\u8ba1\u7b97\u3001GC \u95ee\u9898<\/td>\n<td>\u7ebf\u7a0b\u8f6c\u50a8\u3001jstat -gcutil\u3001\u4ee3\u7801\u5ba1\u67e5<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u67e5 I\/O \u963b\u585e<\/td>\n<td>\u78c1\u76d8\/\u7f51\u7edc I\/O \u6162\u3001\u8fde\u63a5\u6570\u8fc7\u591a<\/td>\n<td>iostat\u3001ss\u3001netstat<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u67e5\u9501\u7ade\u4e89\u4e0e\u7ebf\u7a0b\u4e89\u7528<\/td>\n<td>\u7ebf\u7a0b\u4e92\u76f8\u7b49\u5f85\u9501<\/td>\n<td>jstack&#xff08;\u9501\u6301\u6709\/\u7b49\u5f85\u5173\u7cfb&#xff09;\u3001perf&#xff08;\u975e Java&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u67e5\u5916\u90e8\u538b\u529b<\/td>\n<td>\u7a81\u53d1\u6d41\u91cf\u3001\u6076\u610f\u8bf7\u6c42<\/td>\n<td>iftop\u3001nload\u3001\u8bbf\u95ee\u65e5\u5fd7\u5206\u6790<\/td>\n<\/tr>\n<tr>\n<td>\u68c0\u67e5\u786c\u4ef6\/\u7cfb\u7edf\u5f02\u5e38<\/td>\n<td>CPU \u6545\u969c\u3001\u6563\u70ed\u95ee\u9898\u3001\u5185\u6838\u9519\u8bef<\/td>\n<td>sensors\u3001dmesg\u3001BIOS \u914d\u7f6e\u68c0\u67e5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u200b\u56db\u3001\u6ce8\u610f\u4e8b\u9879\u200b<\/h4>\n<ul>\n<li>\u200b\u751f\u4ea7\u73af\u5883\u8c28\u614e\u64cd\u4f5c\u200b&#xff1a;\u907f\u514d\u5728\u4e1a\u52a1\u9ad8\u5cf0\u671f\u91cd\u542f\u8fdb\u7a0b\u6216\u4fee\u6539\u914d\u7f6e&#xff0c;\u4f18\u5148\u901a\u8fc7\u76d1\u63a7\u5de5\u5177&#xff08;\u5982 Prometheus&#043;Grafana&#xff09;\u5b9e\u65f6\u89c2\u5bdf\u3002<\/li>\n<li>\u200b\u65e5\u5fd7\u4e0e\u76d1\u63a7\u7ed3\u5408\u200b&#xff1a;\u901a\u8fc7\u65e5\u5fd7&#xff08;\u5982\u5e94\u7528\u65e5\u5fd7\u3001\u7cfb\u7edf\u65e5\u5fd7&#xff09;\u548c\u76d1\u63a7&#xff08;CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8 I\/O&#xff09;\u4ea4\u53c9\u9a8c\u8bc1&#xff0c;\u907f\u514d\u8bef\u5224\u3002<\/li>\n<li>\u200b\u9010\u6b65\u7f29\u5c0f\u8303\u56f4\u200b&#xff1a;\u4ece\u7cfb\u7edf\u2192\u8fdb\u7a0b\u2192\u7ebf\u7a0b\u2192\u4ee3\u7801\/\u914d\u7f6e&#xff0c;\u9010\u5c42\u5b9a\u4f4d\u6839\u56e0&#xff0c;\u907f\u514d\u76f2\u76ee\u4fee\u6539\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u53ef\u9ad8\u6548\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8\u7684\u95ee\u9898&#xff0c;\u6700\u7ec8\u5b9a\u4f4d\u5230\u5177\u4f53\u7684\u5e94\u7528\u903b\u8f91\u7f3a\u9677\u3001\u8d44\u6e90\u7ade\u4e89\u6216\u5916\u90e8\u538b\u529b&#xff0c;\u5e76\u9488\u5bf9\u6027\u4f18\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb845\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u670d\u52a1\u5668 CPU \u98d9\u9ad8\uff08CPU \u4f7f\u7528\u7387\u6301\u7eed\u8d85\u8fc7 80% \u751a\u81f3\u63a5\u8fd1 100%\uff09\u662f\u5178\u578b\u7684\u6027\u80fd\u74f6\u9888\u95ee\u9898\uff0c\u53ef\u80fd\u7531\u5f15\u8d77\u3002\u4ee5\u4e0b\u662f\u7cfb\u7edf\u5316\u7684\u6392\u67e5\u6b65\u9aa4\uff0c\u8986\u76d6\u4ece\u73b0\u8c61\u786e\u8ba4\u5230\u6839\u56e0\u5b9a\u4f4d\u7684\u5168\u6d41\u7a0b\u3002_\u670d\u52a1\u5668cpu\u8fc7\u9ad8\u6392\u67e5<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,44],"topic":[],"class_list":["post-46675","post","type-post","status-publish","format-standard","hentry","category-server","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/46675.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb845\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u670d\u52a1\u5668 CPU \u98d9\u9ad8\uff08CPU \u4f7f\u7528\u7387\u6301\u7eed\u8d85\u8fc7 80% \u751a\u81f3\u63a5\u8fd1 100%\uff09\u662f\u5178\u578b\u7684\u6027\u80fd\u74f6\u9888\u95ee\u9898\uff0c\u53ef\u80fd\u7531\u5f15\u8d77\u3002\u4ee5\u4e0b\u662f\u7cfb\u7edf\u5316\u7684\u6392\u67e5\u6b65\u9aa4\uff0c\u8986\u76d6\u4ece\u73b0\u8c61\u786e\u8ba4\u5230\u6839\u56e0\u5b9a\u4f4d\u7684\u5168\u6d41\u7a0b\u3002_\u670d\u52a1\u5668cpu\u8fc7\u9ad8\u6392\u67e5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/46675.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-29T19:51:41+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46675.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/46675.html\",\"name\":\"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-29T19:51:41+00:00\",\"dateModified\":\"2025-07-29T19:51:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/46675.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/46675.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46675.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/46675.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb845\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u670d\u52a1\u5668 CPU \u98d9\u9ad8\uff08CPU \u4f7f\u7528\u7387\u6301\u7eed\u8d85\u8fc7 80% \u751a\u81f3\u63a5\u8fd1 100%\uff09\u662f\u5178\u578b\u7684\u6027\u80fd\u74f6\u9888\u95ee\u9898\uff0c\u53ef\u80fd\u7531\u5f15\u8d77\u3002\u4ee5\u4e0b\u662f\u7cfb\u7edf\u5316\u7684\u6392\u67e5\u6b65\u9aa4\uff0c\u8986\u76d6\u4ece\u73b0\u8c61\u786e\u8ba4\u5230\u6839\u56e0\u5b9a\u4f4d\u7684\u5168\u6d41\u7a0b\u3002_\u670d\u52a1\u5668cpu\u8fc7\u9ad8\u6392\u67e5","og_url":"https:\/\/www.wsisp.com\/helps\/46675.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-29T19:51:41+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/46675.html","url":"https:\/\/www.wsisp.com\/helps\/46675.html","name":"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-29T19:51:41+00:00","dateModified":"2025-07-29T19:51:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/46675.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/46675.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/46675.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u6392\u67e5\u670d\u52a1\u5668 CPU \u98d9\u9ad8"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=46675"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46675\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=46675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=46675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=46675"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=46675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}