{"id":118894,"date":"2026-10-28T10:57:23","date_gmt":"2026-10-28T02:57:23","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/118894.html"},"modified":"2026-10-28T10:57:23","modified_gmt":"2026-10-28T02:57:23","slug":"ubuntu%e9%9b%b6%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8%e5%88%b0%e7%b2%be%e9%80%9a%e3%80%9010-8%e8%ae%b2%e3%80%91%ef%bc%9aload-average-%e6%b7%b1%e5%ba%a6%e8%a7%a3%e6%9e%90-%e4%bb%8e%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/118894.html","title":{"rendered":"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01"},"content":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025711-6ae16487d3a7c.png\" \/> <\/p>\n<p>&#x1f3c6; \u672c\u6587\u6536\u5f55\u4e8e \u300a\u6eda\u96ea\u7403\u5b66 Ubuntu\u300b \u4e13\u680f\u3002 \u672c\u4e13\u680f\u9762\u5411\u6709\u4e00\u5b9a\u8ba1\u7b97\u673a\u57fa\u7840&#xff0c;\u4f46\u5c1a\u672a\u7cfb\u7edf\u5b66\u4e60 Linux \/ Ubuntu \u7684\u8bfb\u8005&#xff0c;\u91c7\u7528\u201c\u6eda\u96ea\u7403\u5f0f\u5b66\u4e60\u6cd5\u201d&#xff1a;\u5148\u88c5\u597d\u3001\u518d\u4f1a\u7528\u3001\u518d\u7406\u89e3\u3001\u518d\u4f18\u5316\u3001\u518d\u5b9e\u6218&#xff0c;\u5e26\u4f60\u4ece\u7b2c\u4e00\u6b21\u8fdb\u5165 Ubuntu \u684c\u9762 \/ \u7ec8\u7aef\u5f00\u59cb&#xff0c;\u9010\u6b65\u638c\u63e1 Ubuntu \u7684\u65e5\u5e38\u4f7f\u7528\u3001\u547d\u4ee4\u64cd\u4f5c\u3001\u8f6f\u4ef6\u5b89\u88c5\u3001\u7cfb\u7edf\u914d\u7f6e\u3001\u5f00\u53d1\u73af\u5883\u642d\u5efa\u4e0e\u670d\u52a1\u5668\u90e8\u7f72\u80fd\u529b\u3002 \u2003 &#x1f3af; \u9002\u5408\u4eba\u7fa4&#xff1a; Linux \u521d\u5b66\u8005\u3001Ubuntu \u65b0\u624b\u3001\u8ba1\u7b97\u673a\u4e13\u4e1a\u5b66\u751f\u3001\u540e\u7aef \/ \u8fd0\u7ef4 \/ \u6d4b\u8bd5\u5165\u95e8\u540c\u5b66\u3001\u60f3\u642d\u5efa Linux \u5f00\u53d1\u73af\u5883\u7684\u5f00\u53d1\u8005\u3001\u51c6\u5907\u5b66\u4e60\u670d\u52a1\u5668\u90e8\u7f72\u7684\u540c\u5b66&#xff0c;\u4ee5\u53ca\u60f3\u4ece Windows \u8fc7\u6e21\u5230 Ubuntu \u5de5\u4f5c\u6d41\u7684\u7528\u6237\u3002<\/p>\n<p>\u4ece\u201c\u4f1a\u6253\u5f00\u7ec8\u7aef\u201d\u5230\u201c\u80fd\u7ba1\u7406\u7cfb\u7edf\u201d&#xff0c;\u4ece\u201c\u590d\u5236\u547d\u4ee4\u201d\u5230\u201c\u7406\u89e3 Linux \u601d\u7ef4\u201d&#xff0c;\u8fd9\u4e00\u6b21&#xff0c;\u6211\u4eec\u4e0d\u96f6\u6563\u5b66&#xff0c;\u800c\u662f\u4e00\u8def\u6eda\u96ea\u7403&#xff01; \u2003 &#x1f389; <font color=\"red\">\u9650\u65f6\u798f\u5229&#xff1a;\u5f53\u524d\u4e13\u680f\u6d3b\u52a8\u4e2d&#xff0c;\u4e00\u6b21\u8ba2\u9605&#xff0c;\u7ec8\u8eab\u9605\u8bfb&#xff0c;\u540e\u7eed\u66f4\u65b0\u7ae0\u8282\u5168\u90e8\u514d\u8d39\u89e3\u9501 &#x1f449; \u7acb\u5373\u67e5\u770b<\/font> &#x1f448;\ufe0f<\/p>\n<p>\u6f14\u793a\u73af\u5883\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>\u5f00\u53d1\u5de5\u5177&#xff1a;Visual Studio Code \/ JetBrains \u7cfb\u5217 IDE \/ Vim \/ Nano<\/li>\n<li>Ubuntu\u7248\u672c&#xff1a;Ubuntu 22.04 LTS \/ Ubuntu 24.04 LTS&#xff0c;\u63a8\u8350 Ubuntu 24.04 LTS<\/li>\n<li>Linux\u5185\u6838\u7248\u672c&#xff1a;Linux Kernel 6.x \u6216\u66f4\u9ad8<\/li>\n<li>\u7ec8\u7aef\u73af\u5883&#xff1a;Bash \/ Zsh<\/li>\n<li>\u5305\u7ba1\u7406\u5de5\u5177&#xff1a;APT \/ Snap \/ Flatpak<\/li>\n<li>\u8fdc\u7a0b\u8fde\u63a5\u5de5\u5177&#xff1a;OpenSSH \/ Windows Terminal \/ MobaXterm \/ Termius<\/li>\n<li>\u865a\u62df\u5316\u73af\u5883&#xff1a;VMware Workstation \/ VirtualBox \/ WSL2 \/ \u4e91\u670d\u52a1\u5668<\/li>\n<li>\u5bb9\u5668\u73af\u5883&#xff1a;Docker \/ Docker Compose<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf&#xff1a;Ubuntu Desktop \/ Ubuntu Server<\/li>\n<\/ul>\n<p> <img decoding=\"async\" width=\"1000\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025714-6ae1648a50f86.png\" \/> <\/p>\n<h4>\u5168\u6587\u76ee\u5f55&#xff1a;<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00\u3001\u524d\u8a00&#xff1a;\u90a3\u4e2a\u8ba9\u5f88\u591a\u4eba\u56f0\u60d1\u7684\u6570\u5b57<\/li>\n<li>\u4e8c\u3001\u672c\u6587\u8981\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<\/li>\n<li>\u4e09\u3001Load Average \u662f\u4ec0\u4e48&#xff1a;\u4ece\u5b9a\u4e49\u51fa\u53d1<\/li>\n<li>\n<ul>\n<li>3.1 \u5b98\u65b9\u5b9a\u4e49\u4e0e\u76f4\u767d\u89e3\u91ca<\/li>\n<li>3.2 \u4e09\u4e2a\u6570\u5b57\u5206\u522b\u4ee3\u8868\u4ec0\u4e48<\/li>\n<li>3.3 Load Average \u548c CPU \u4f7f\u7528\u7387\u7684\u672c\u8d28\u533a\u522b<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001CPU \u6838\u5fc3\u6570&#xff1a;\u8bfb\u61c2 Load Average \u7684\u5173\u952e\u53d8\u91cf<\/li>\n<li>\n<ul>\n<li>4.1 \u4e3a\u4ec0\u4e48\u6838\u5fc3\u6570\u90a3\u4e48\u91cd\u8981<\/li>\n<li>4.2 \u600e\u4e48\u67e5\u770b CPU \u6838\u5fc3\u6570<\/li>\n<li>4.3 Load Average \u7684&#034;\u5408\u7406\u8303\u56f4&#034;<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u54ea\u4e9b\u8fdb\u7a0b\u4f1a\u8d21\u732e\u5230 Load Average<\/li>\n<li>\n<ul>\n<li>5.1 \u8fd0\u884c\u72b6\u6001&#xff08;R&#xff09;<\/li>\n<li>5.2 \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u72b6\u6001&#xff08;D&#xff09;&#xff1a;\u6700\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u8d21\u732e\u8005<\/li>\n<li>5.3 Load Average \u9ad8\u672a\u5fc5\u662f CPU \u7684\u9505<\/li>\n<\/ul>\n<\/li>\n<li>\u516d\u3001\u5b9e\u9a8c\u73af\u5883\u51c6\u5907<\/li>\n<li>\u4e03\u3001\u6848\u4f8b\u4e00&#xff1a;\u7528 uptime \u548c top \u8bfb\u61c2 Load Average<\/li>\n<li>\n<ul>\n<li>7.1 uptime \u547d\u4ee4&#xff1a;\u6700\u5feb\u901f\u7684\u8d1f\u8f7d\u5feb\u7167<\/li>\n<li>7.2 top \u547d\u4ee4\u4e2d\u7684 Load Average<\/li>\n<li>7.3 htop \u4e2d\u7684\u76f4\u89c2\u5c55\u793a<\/li>\n<li>7.4 \u547d\u4ee4\u89e3\u6790<\/li>\n<\/ul>\n<\/li>\n<li>\u516b\u3001\u6848\u4f8b\u4e8c&#xff1a;\u6a21\u62df\u9ad8\u8d1f\u8f7d\u573a\u666f&#xff0c;\u4eb2\u773c\u770b Load Average \u4e0a\u5347<\/li>\n<li>\n<ul>\n<li>8.1 \u4f7f\u7528 stress-ng \u6a21\u62df CPU \u538b\u529b<\/li>\n<li>8.2 \u4f7f\u7528 stress-ng \u6a21\u62df I\/O \u538b\u529b<\/li>\n<li>8.3 \u5bf9\u6bd4\u4e24\u79cd\u8d1f\u8f7d\u7684\u533a\u522b<\/li>\n<li>8.4 \u547d\u4ee4\u89e3\u6790\u4e0e\u89c2\u5bdf\u8981\u70b9<\/li>\n<\/ul>\n<\/li>\n<li>\u4e5d\u3001\u6848\u4f8b\u4e09&#xff1a;\u751f\u4ea7\u73af\u5883\u4e2d\u7684 Load Average \u5f02\u5e38\u6392\u67e5<\/li>\n<li>\n<ul>\n<li>9.1 \u573a\u666f\u63cf\u8ff0<\/li>\n<li>9.2 \u7b2c\u4e00\u6b65&#xff1a;\u786e\u8ba4\u8d1f\u8f7d\u60c5\u51b5<\/li>\n<li>9.3 \u7b2c\u4e8c\u6b65&#xff1a;\u5224\u65ad\u662f CPU \u578b\u8fd8\u662f I\/O \u578b<\/li>\n<li>9.4 \u7b2c\u4e09\u6b65&#xff1a;\u627e\u51fa\u5177\u4f53\u8fdb\u7a0b<\/li>\n<li>9.5 \u7b2c\u56db\u6b65&#xff1a;\u6df1\u5165\u5206\u6790<\/li>\n<li>9.6 \u547d\u4ee4\u89e3\u6790\u4e0e\u6392\u67e5\u601d\u8def\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u3001Load Average \u7684\u8ba1\u7b97\u539f\u7406<\/li>\n<li>\n<ul>\n<li>10.1 \u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747<\/li>\n<li>10.2 \u4e3a\u4ec0\u4e48 1 \u5206\u949f\u548c 15 \u5206\u949f\u7684\u503c\u5dee\u5f02\u91cd\u8981<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u4e00\u3001Load Average \u4e0e\u5176\u4ed6\u76d1\u63a7\u6307\u6807\u7684\u8054\u5408\u5206\u6790<\/li>\n<li>\n<ul>\n<li>11.1 \u7ed3\u5408 CPU \u4f7f\u7528\u7387<\/li>\n<li>11.2 \u7ed3\u5408\u5185\u5b58\u4f7f\u7528\u7387<\/li>\n<li>11.3 \u7ed3\u5408 I\/O \u72b6\u6001<\/li>\n<li>11.4 \u7ed3\u5408\u8fdb\u7a0b\u72b6\u6001<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u4e8c\u3001\u6838\u5fc3\u547d\u4ee4\u4e0e\u5de5\u5177\u6c47\u603b\u89e3\u6790<\/li>\n<li>\n<ul>\n<li>12.1 uptime<\/li>\n<li>12.2 top \/ htop<\/li>\n<li>12.3 vmstat<\/li>\n<li>12.4 iostat<\/li>\n<li>12.5 sar<\/li>\n<li>12.6 \/proc\/loadavg<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u4e09\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u8e29\u5751\u603b\u7ed3<\/li>\n<li>\u5341\u56db\u3001\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/li>\n<li>\u5341\u4e94\u3001\u6269\u5c55\u77e5\u8bc6&#xff1a;\u4ece Load Average \u5ef6\u4f38\u51fa\u7684\u7cfb\u7edf\u8c03\u4f18\u65b9\u5411<\/li>\n<li>\u5341\u516d\u3001\u5b8c\u6574\u6392\u67e5\u6d41\u7a0b\u56de\u987e<\/li>\n<li>\u5341\u4e03\u3001\u603b\u7ed3<\/li>\n<li>&#x1f9e7; \u5b66\u4e60\u798f\u5229 \u00b7 \u9650\u65f6\u5f00\u653e &#x1f9e7;<\/li>\n<li>&#x1faf5; Who am I&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u4e00\u3001\u524d\u8a00&#xff1a;\u90a3\u4e2a\u8ba9\u5f88\u591a\u4eba\u56f0\u60d1\u7684\u6570\u5b57<\/h3>\n<p>\u6211\u7b2c\u4e00\u6b21\u8ba4\u771f\u76ef\u7740\u670d\u52a1\u5668\u770b uptime \u8f93\u51fa\u7684\u65f6\u5019&#xff0c;\u5927\u6982\u662f\u5728\u5904\u7406\u4e00\u6b21\u751f\u4ea7\u4e8b\u6545\u7684\u51cc\u6668\u4e24\u70b9\u3002\u5c4f\u5e55\u4e0a\u663e\u793a\u7684\u90a3\u4e09\u4e2a\u6570\u5b57\u2014\u20143.42, 5.17, 4.88\u2014\u2014\u5bf9\u6211\u6765\u8bf4\u5c31\u50cf\u662f\u4e09\u4e2a\u6ca1\u6709\u5355\u4f4d\u7684\u8c1c\u8bed\u3002\u6211\u5927\u6982\u77e5\u9053\u8fd9\u662f&#034;\u7cfb\u7edf\u8d1f\u8f7d&#034;&#xff0c;\u4f46\u6211\u5b8c\u5168\u4e0d\u77e5\u9053\u8fd9\u610f\u5473\u7740\u9ad8\u8fd8\u662f\u4f4e&#xff0c;\u4e5f\u4e0d\u77e5\u9053\u8be5\u62ff\u8fd9\u4e2a\u6570\u5b57\u53bb\u505a\u4ec0\u4e48\u5224\u65ad\u3002<\/p>\n<p>\u8fd9\u79cd\u56f0\u60d1\u5e76\u4e0d\u5c11\u89c1\u3002Load Average&#xff08;\u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d&#xff09;\u662f Linux \u7cfb\u7edf\u76d1\u63a7\u4e2d\u51fa\u73b0\u9891\u7387\u6700\u9ad8\u7684\u6307\u6807\u4e4b\u4e00&#xff0c;\u51e0\u4e4e\u6240\u6709\u670d\u52a1\u5668\u76d1\u63a7\u5927\u76d8\u90fd\u4f1a\u628a\u5b83\u6446\u5728\u663e\u773c\u4f4d\u7f6e\u3002\u4f46\u5b83\u53c8\u662f\u6700\u5bb9\u6613\u88ab\u8bef\u8bfb\u7684\u4e00\u4e2a\u6307\u6807\u3002\u6211\u89c1\u8fc7\u6709\u4eba\u770b\u5230\u8d1f\u8f7d\u503c\u8d85\u8fc7 1.0 \u5c31\u89c9\u5f97\u7cfb\u7edf\u5feb\u5d29\u4e86&#xff0c;\u4e5f\u89c1\u8fc7\u6709\u4eba\u8d1f\u8f7d\u8dd1\u5230 30 \u8fd8\u89c9\u5f97\u6ca1\u95ee\u9898&#xff0c;\u8fd9\u4e24\u79cd\u5224\u65ad\u90fd\u662f\u9519\u7684\u2014\u2014\u5173\u952e\u5728\u4e8e&#xff0c;\u4f60\u6709\u6ca1\u6709\u628a CPU \u6838\u5fc3\u6570\u8fd9\u4e2a\u524d\u63d0\u6761\u4ef6\u7eb3\u8fdb\u6765\u3002<\/p>\n<p>Load Average \u7684\u7406\u89e3\u95e8\u69db\u4e0d\u9ad8&#xff0c;\u4f46\u5b83\u80cc\u540e\u6d89\u53ca\u7684\u7cfb\u7edf\u539f\u7406\u5176\u5b9e\u76f8\u5f53\u6709\u610f\u601d&#xff1a;\u8fdb\u7a0b\u72b6\u6001\u7684\u5206\u7c7b\u3001\u5185\u6838\u8c03\u5ea6\u961f\u5217\u7684\u8bbe\u8ba1\u3001I\/O \u7b49\u5f85\u4e0e CPU \u5360\u7528\u7684\u672c\u8d28\u533a\u522b\u2026\u2026\u8fd9\u4e9b\u4e1c\u897f\u7406\u6e05\u695a\u4e86&#xff0c;\u4f60\u770b\u7cfb\u7edf\u95ee\u9898\u7684\u89c6\u89d2\u4f1a\u5b8c\u5168\u4e0d\u4e00\u6837\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u6211\u60f3\u4ece\u6700\u6734\u7d20\u7684\u5b9a\u4e49\u8bb2\u8d77&#xff0c;\u4e00\u6b65\u6b65\u5e26\u4f60\u771f\u6b63\u7406\u89e3 Load Average \u4ee3\u8868\u4ec0\u4e48&#xff0c;\u600e\u4e48\u8bfb&#xff0c;\u600e\u4e48\u7ed3\u5408\u5176\u4ed6\u6307\u6807\u505a\u5224\u65ad&#xff0c;\u4ee5\u53ca\u5728\u771f\u5b9e\u670d\u52a1\u5668\u51fa\u95ee\u9898\u7684\u65f6\u5019&#xff0c;\u5b83\u80fd\u544a\u8bc9\u4f60\u4ec0\u4e48\u3001\u53c8\u544a\u8bc9\u4e0d\u4e86\u4f60\u4ec0\u4e48\u3002<\/p>\n<h3>\u4e8c\u3001\u672c\u6587\u8981\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<\/h3>\n<p>\u8bfb\u5b8c\u8fd9\u7bc7\u6587\u7ae0&#xff0c;\u4f60\u5e94\u8be5\u80fd\u505a\u5230\u4ee5\u4e0b\u51e0\u4ef6\u4e8b&#xff1a;<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u770b\u5230 uptime \u6216 top \u8f93\u51fa\u7684\u4e09\u4e2a\u8d1f\u8f7d\u6570\u5b57&#xff0c;\u7acb\u523b\u80fd\u5224\u65ad\u5f53\u524d\u7cfb\u7edf\u662f\u5426\u5904\u4e8e\u6b63\u5e38\u533a\u95f4\u3002\u8fd9\u4e2a\u5224\u65ad\u4e0d\u662f\u51ed\u611f\u89c9&#xff0c;\u800c\u662f\u6709\u660e\u786e\u7684\u53c2\u8003\u4f9d\u636e\u2014\u2014\u4f60\u4f1a\u77e5\u9053\u8fd9\u4e2a\u5224\u65ad\u7684\u57fa\u51c6\u662f CPU \u6838\u5fc3\u6570\u3002<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u7406\u89e3 Load Average \u9ad8\u4e0d\u7b49\u4e8e CPU \u7e41\u5fd9\u3002\u8fd9\u662f\u5f88\u591a\u4eba\u957f\u671f\u5b58\u5728\u7684\u8bef\u533a\u3002\u6211\u4f1a\u5e26\u4f60\u641e\u6e05\u695a&#034;\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u72b6\u6001&#034;&#xff08;D \u72b6\u6001\u8fdb\u7a0b&#xff09;\u662f\u600e\u4e48\u62c9\u9ad8\u8d1f\u8f7d\u503c\u7684&#xff0c;\u4e3a\u4ec0\u4e48\u4e00\u53f0\u78c1\u76d8\u574f\u6389\u7684\u670d\u52a1\u5668 CPU \u53ef\u4ee5\u5f88\u95f2\u4f46\u8d1f\u8f7d\u5374\u5f88\u9ad8\u3002<\/p>\n<p>\u7b2c\u4e09&#xff0c;\u5f53\u670d\u52a1\u5668\u51fa\u73b0\u8d1f\u8f7d\u5f02\u5e38\u65f6&#xff0c;\u77e5\u9053\u4ece\u54ea\u91cc\u5165\u624b\u5206\u6790&#xff0c;\u7528\u54ea\u4e9b\u5de5\u5177&#xff0c;\u6309\u4ec0\u4e48\u987a\u5e8f\u6392\u67e5\u3002\u76f2\u76ee\u91cd\u542f\u670d\u52a1\u662f\u89e3\u51b3\u4e0d\u4e86\u95ee\u9898\u7684&#xff0c;\u4f60\u9700\u8981\u4e00\u4e2a\u7cfb\u7edf\u5316\u7684\u6392\u67e5\u601d\u8def\u3002<\/p>\n<p>\u7b2c\u56db&#xff0c;\u7406\u89e3 Load Average \u7684\u8ba1\u7b97\u65b9\u5f0f&#xff0c;\u77e5\u9053\u4e3a\u4ec0\u4e48\u5b83\u662f\u4e00\u4e2a&#034;\u6ede\u540e&#034;\u6307\u6807&#xff0c;\u5728\u4f7f\u7528\u5b83\u505a\u51b3\u7b56\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\u3002<\/p>\n<p>\u7b2c\u4e94&#xff0c;\u638c\u63e1 uptime\u3001top\u3001htop\u3001vmstat\u3001iostat\u3001sar \u7b49\u5de5\u5177\u5728 Load Average \u5206\u6790\u573a\u666f\u4e0b\u7684\u5177\u4f53\u7528\u6cd5&#xff0c;\u77e5\u9053\u6bcf\u4e2a\u5de5\u5177\u7684\u4fa7\u91cd\u70b9\u548c\u9002\u7528\u573a\u666f\u3002<\/p>\n<h3>\u4e09\u3001Load Average \u662f\u4ec0\u4e48&#xff1a;\u4ece\u5b9a\u4e49\u51fa\u53d1<\/h3>\n<h4>3.1 \u5b98\u65b9\u5b9a\u4e49\u4e0e\u76f4\u767d\u89e3\u91ca<\/h4>\n<p>Linux \u5185\u6838\u6587\u6863\u5bf9 Load Average \u7684\u5b9a\u4e49\u662f&#xff1a;\u5728\u7279\u5b9a\u65f6\u95f4\u95f4\u9694\u5185&#xff0c;\u5904\u4e8e\u53ef\u8fd0\u884c\u72b6\u6001&#xff08;runnable&#xff09;\u548c\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u72b6\u6001&#xff08;uninterruptible sleep&#xff09;\u7684\u8fdb\u7a0b\u6570\u91cf\u7684\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747\u503c\u3002<\/p>\n<p>\u8fd9\u53e5\u8bdd\u4fe1\u606f\u91cf\u5f88\u5927&#xff0c;\u62c6\u5f00\u6765\u7406\u89e3&#xff1a;<\/p>\n<p>\u201c\u53ef\u8fd0\u884c\u72b6\u6001\u201d&#xff1a;\u5305\u62ec\u6b63\u5728 CPU \u4e0a\u6267\u884c\u7684\u8fdb\u7a0b&#xff0c;\u4ee5\u53ca\u5df2\u7ecf\u51c6\u5907\u597d\u3001\u6b63\u5728\u7b49\u5f85 CPU \u8c03\u5ea6\u7684\u8fdb\u7a0b\u3002\u6362\u53e5\u8bdd\u8bf4&#xff0c;\u8fd9\u662f CPU \u8c03\u5ea6\u961f\u5217\u7684\u957f\u5ea6\u3002<\/p>\n<p>\u201c\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u72b6\u6001\u201d&#xff1a;\u8fdb\u7a0b\u5728\u7b49\u5f85\u67d0\u4e9b\u65e0\u6cd5\u88ab\u4fe1\u53f7\u6253\u65ad\u7684 I\/O \u64cd\u4f5c&#xff0c;\u6700\u5178\u578b\u7684\u5c31\u662f\u78c1\u76d8 I\/O\u3001\u67d0\u4e9b\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\u3002\u8fd9\u7c7b\u8fdb\u7a0b\u4e0d\u5360\u7528 CPU&#xff0c;\u4f46\u5b83\u4eec\u4ecd\u7136\u8ba1\u5165 Load Average\u3002<\/p>\n<p>\u201c\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747\u201d&#xff1a;\u4e0d\u662f\u7b80\u5355\u5730\u7edf\u8ba1\u67d0\u4e00\u65f6\u523b\u7684\u8fdb\u7a0b\u6570&#xff0c;\u800c\u662f\u4ee5\u7279\u5b9a\u7684\u8870\u51cf\u6743\u91cd\u5bf9\u8fc7\u53bb\u4e00\u6bb5\u65f6\u95f4\u7684\u6570\u636e\u8fdb\u884c\u52a0\u6743\u5e73\u5747\u3002\u8fd9\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48 Load Average \u53cd\u5e94\u76f8\u5bf9\u8fdf\u949d&#xff0c;\u5373\u4fbf\u4f60\u9a6c\u4e0a\u7ec8\u6b62\u4e86\u9ad8\u8d1f\u8f7d\u8fdb\u7a0b&#xff0c;\u90a3\u4e2a\u6570\u503c\u4e5f\u4e0d\u4f1a\u7acb\u523b\u964d\u4e0b\u6765\u3002<\/p>\n<p>\u7528\u66f4\u76f4\u767d\u7684\u8bdd\u8bf4&#xff1a;Load Average \u544a\u8bc9\u4f60\u7684\u662f&#xff0c;\u5728\u8fc7\u53bb\u7684 1 \u5206\u949f\u30015 \u5206\u949f\u300115 \u5206\u949f\u91cc&#xff0c;\u5e73\u5747\u6709\u591a\u5c11\u4e2a\u4efb\u52a1\u5728&#034;\u6392\u961f\u7b49\u5f85\u88ab\u5904\u7406&#034;\u6216&#034;\u6b63\u5728\u88ab\u5904\u7406&#034;\u3002<\/p>\n<p>\u4e00\u4e2a\u7c7b\u6bd4\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5efa\u7acb\u76f4\u89c9&#xff1a;\u628a CPU \u6838\u5fc3\u60f3\u8c61\u6210\u8d85\u5e02\u6536\u94f6\u53f0&#xff0c;\u628a\u8fdb\u7a0b\u60f3\u8c61\u6210\u6392\u961f\u7ed3\u8d26\u7684\u987e\u5ba2\u3002Load Average \u662f\u8fd9\u6bb5\u65f6\u95f4\u91cc\u5e73\u5747\u6709\u591a\u5c11\u987e\u5ba2\u8981\u4e48\u6b63\u5728\u7ed3\u8d26&#xff0c;\u8981\u4e48\u6b63\u5728\u6392\u961f&#xff0c;\u8981\u4e48\u5728\u67dc\u53f0\u524d\u7b49\u5f85\u4e0d\u77e5\u9053\u4ec0\u4e48\u539f\u56e0\u5361\u4f4f\u7684\u64cd\u4f5c\u3002<\/p>\n<h4>3.2 \u4e09\u4e2a\u6570\u5b57\u5206\u522b\u4ee3\u8868\u4ec0\u4e48<\/h4>\n<p>\u5f53\u4f60\u6267\u884c uptime \u547d\u4ee4&#xff0c;\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u8f93\u51fa&#xff1a;<\/p>\n<p><span class=\"token function\">uptime<\/span><\/p>\n<p> 14:23:18 up 42 days,  3:17,  2 users,  load average: 1.52, 1.34, 0.98<\/p>\n<p>\u6700\u540e\u90a3\u4e09\u4e2a\u6570\u5b57&#xff0c;\u4ece\u5de6\u5230\u53f3\u4f9d\u6b21\u662f&#xff1a;<\/p>\n<ul>\n<li>1.52&#xff1a;\u8fc7\u53bb 1 \u5206\u949f\u5185\u7684\u5e73\u5747\u8d1f\u8f7d<\/li>\n<li>1.34&#xff1a;\u8fc7\u53bb 5 \u5206\u949f\u5185\u7684\u5e73\u5747\u8d1f\u8f7d<\/li>\n<li>0.98&#xff1a;\u8fc7\u53bb 15 \u5206\u949f\u5185\u7684\u5e73\u5747\u8d1f\u8f7d<\/li>\n<\/ul>\n<p>1 \u5206\u949f\u7684\u503c\u53cd\u5e94\u7684\u662f\u6700\u8fd1\u7684\u77ac\u65f6\u538b\u529b&#xff0c;\u6ce2\u52a8\u8f83\u5927&#xff1b;15 \u5206\u949f\u7684\u503c\u53cd\u5e94\u7684\u662f\u8f83\u957f\u65f6\u95f4\u5185\u7684\u8d8b\u52bf&#xff0c;\u6bd4\u8f83\u5e73\u6ed1&#xff1b;5 \u5206\u949f\u7684\u503c\u4ecb\u4e8e\u4e24\u8005\u4e4b\u95f4\u3002<\/p>\n<p>\u8fd9\u4e09\u4e2a\u503c\u4e4b\u95f4\u7684\u76f8\u5bf9\u5173\u7cfb\u548c\u53d8\u5316\u8d8b\u52bf&#xff0c;\u5f80\u5f80\u6bd4\u5355\u4e2a\u7edd\u5bf9\u503c\u66f4\u6709\u53c2\u8003\u610f\u4e49\u3002\u540e\u9762\u6211\u4f1a\u4e13\u95e8\u8bb2\u8fd9\u4e2a\u3002<\/p>\n<h4>3.3 Load Average \u548c CPU \u4f7f\u7528\u7387\u7684\u672c\u8d28\u533a\u522b<\/h4>\n<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u503c\u5f97\u6df1\u5165\u8bf4\u660e\u7684\u5730\u65b9&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u7ecf\u5e38\u88ab\u6df7\u4e3a\u4e00\u8c08\u3002<\/p>\n<p>CPU \u4f7f\u7528\u7387\u63cf\u8ff0\u7684\u662f CPU \u65f6\u95f4\u88ab\u5360\u7528\u7684\u767e\u5206\u6bd4\u3002\u4e00\u53f0 4 \u6838\u670d\u52a1\u5668&#xff0c;\u5982\u679c\u6240\u6709\u6838\u5fc3\u90fd\u5728\u6ee1\u8d1f\u8377\u8fd0\u884c&#xff0c;CPU \u4f7f\u7528\u7387\u662f 100%\u3002CPU \u4f7f\u7528\u7387\u53ea\u53cd\u6620 CPU \u8fd9\u4e00\u4e2a\u8d44\u6e90\u7684\u5fd9\u788c\u7a0b\u5ea6\u3002<\/p>\n<p>Load Average \u63cf\u8ff0\u7684\u662f\u7cfb\u7edf\u6574\u4f53\u7684\u4efb\u52a1\u6392\u961f\u957f\u5ea6&#xff0c;\u5305\u542b\u4e86\u7b49\u5f85 CPU \u548c\u7b49\u5f85 I\/O \u4e24\u79cd\u60c5\u51b5\u3002\u4e00\u53f0 CPU \u4f7f\u7528\u7387\u53ea\u6709 20% \u7684\u670d\u52a1\u5668&#xff0c;\u53ef\u80fd\u56e0\u4e3a\u5927\u91cf\u8fdb\u7a0b\u5361\u5728\u78c1\u76d8 I\/O \u7b49\u5f85\u4e0a&#xff0c;\u800c\u5bfc\u81f4 Load Average \u975e\u5e38\u9ad8\u3002<\/p>\n<p>\u8fd9\u4e2a\u533a\u522b\u5728\u5b9e\u9645\u6392\u67e5\u4e2d\u975e\u5e38\u5173\u952e&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c Load Average \u9ad8&#xff0c;\u540c\u65f6 CPU \u4f7f\u7528\u7387\u4e5f\u9ad8 \u2192 CPU \u74f6\u9888\u7684\u53ef\u80fd\u6027\u5927<\/li>\n<li>\u5982\u679c Load Average \u9ad8&#xff0c;\u4f46 CPU \u4f7f\u7528\u7387\u5f88\u4f4e \u2192 \u5927\u6982\u7387\u662f I\/O \u74f6\u9888&#xff08;\u78c1\u76d8\u3001\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\u7b49&#xff09;<\/li>\n<li>\u5982\u679c CPU \u4f7f\u7528\u7387\u9ad8&#xff0c;\u4f46 Load Average \u4e0d\u9ad8 \u2192 CPU \u5bc6\u96c6\u578b\u4efb\u52a1&#xff0c;\u4f46\u4efb\u52a1\u6570\u91cf\u4e0d\u591a&#xff0c;\u4e0d\u4e00\u5b9a\u662f\u95ee\u9898<\/li>\n<\/ul>\n<p>\u6211\u5728\u540e\u9762\u7684\u6848\u4f8b\u90e8\u5206\u4f1a\u7528 stress-ng \u5206\u522b\u6a21\u62df\u8fd9\u4e24\u79cd\u573a\u666f&#xff0c;\u8ba9\u4f60\u76f4\u89c2\u5730\u770b\u5230\u5b83\u4eec\u7684\u533a\u522b\u3002<\/p>\n<h3>\u56db\u3001CPU \u6838\u5fc3\u6570&#xff1a;\u8bfb\u61c2 Load Average \u7684\u5173\u952e\u53d8\u91cf<\/h3>\n<h4>4.1 \u4e3a\u4ec0\u4e48\u6838\u5fc3\u6570\u90a3\u4e48\u91cd\u8981<\/h4>\n<p>\u8fd9\u662f\u7406\u89e3 Load Average \u6700\u6838\u5fc3\u7684\u524d\u63d0&#xff0c;\u6ca1\u6709\u4e4b\u4e00\u3002<\/p>\n<p>Load Average \u7684\u503c\u662f\u4e00\u4e2a\u7edd\u5bf9\u6570\u91cf&#xff08;\u4efb\u52a1\u7684\u5e73\u5747\u4e2a\u6570&#xff09;&#xff0c;\u4e0d\u662f\u4e00\u4e2a\u767e\u5206\u6bd4\u3002\u6240\u4ee5&#xff0c;\u540c\u6837\u662f Load Average \u4e3a 4.0&#xff0c;\u5728\u5355\u6838 CPU \u4e0a\u610f\u5473\u7740\u7cfb\u7edf\u4e25\u91cd\u8fc7\u8f7d&#xff08;\u6709 4 \u500d\u7684\u4efb\u52a1\u5728\u6392\u961f&#xff09;&#xff0c;\u5728 8 \u6838 CPU \u4e0a\u53ea\u662f\u8f7b\u5ea6\u8d1f\u8f7d&#xff08;\u6bcf\u4e2a\u6838\u5fc3\u5e73\u5747\u5904\u7406 0.5 \u4e2a\u4efb\u52a1&#xff09;\u3002<\/p>\n<p>\u66f4\u5177\u4f53\u5730\u8bf4&#xff1a;<\/p>\n<ul>\n<li>\u5728\u4e00\u53f0 1 \u6838 CPU \u7684\u673a\u5668\u4e0a&#xff0c;Load Average \u4e3a 1.0 \u8868\u793a CPU \u521a\u597d\u6ee1\u8d1f\u8377&#xff0c;\u662f\u5065\u5eb7\u4e0a\u9650<\/li>\n<li>\u5728\u4e00\u53f0 4 \u6838 CPU \u7684\u673a\u5668\u4e0a&#xff0c;Load Average \u4e3a 4.0 \u624d\u662f\u6ee1\u8d1f\u8377<\/li>\n<li>\u5728\u4e00\u53f0 8 \u6838 CPU \u7684\u673a\u5668\u4e0a&#xff0c;Load Average \u4e3a 8.0 \u624d\u662f\u6ee1\u8d1f\u8377<\/li>\n<li>\u5982\u679c\u503c\u660e\u663e\u8d85\u8fc7\u6838\u5fc3\u6570&#xff0c;\u8bf4\u660e\u6709\u4efb\u52a1\u5728\u6301\u7eed\u6392\u961f\u7b49\u5f85&#xff0c;\u7cfb\u7edf\u5df2\u7ecf\u8fc7\u8f7d<\/li>\n<\/ul>\n<p>\u6240\u4ee5&#xff0c;\u6bcf\u6b21\u770b Load Average \u4e4b\u524d&#xff0c;\u4f60\u90fd\u5fc5\u987b\u5148\u786e\u8ba4\u8fd9\u53f0\u673a\u5668\u6709\u51e0\u4e2a CPU \u6838\u5fc3\u3002\u8fd9\u4e0d\u662f\u53ef\u9009\u7684&#xff0c;\u8fd9\u662f\u5fc5\u987b\u7684\u524d\u7f6e\u6b65\u9aa4\u3002<\/p>\n<h4>4.2 \u600e\u4e48\u67e5\u770b CPU \u6838\u5fc3\u6570<\/h4>\n<p>Ubuntu 22.04 \/ 24.04 \u4e0a&#xff0c;\u67e5\u770b CPU \u6838\u5fc3\u6570\u6709\u51e0\u79cd\u65b9\u5f0f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e00&#xff1a;\u67e5\u770b\u903b\u8f91 CPU \u6838\u5fc3\u6570&#xff08;\u6700\u5e38\u7528&#xff09;<\/span><br \/>\nnproc<\/p>\n<p>8<\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e8c&#xff1a;\u901a\u8fc7 \/proc\/cpuinfo \u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/span><br \/>\n<span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-c<\/span> ^processor \/proc\/cpuinfo<\/p>\n<p>8<\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e09&#xff1a;\u901a\u8fc7 lscpu \u67e5\u770b\u5b8c\u6574 CPU \u4fe1\u606f<\/span><br \/>\nlscpu <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token string\">&#039;^CPU\\\\(s\\\\)|^Core|^Socket|^Thread&#039;<\/span><\/p>\n<p>CPU(s):                  8<br \/>\nCore(s) per socket:      4<br \/>\nSocket(s):               1<br \/>\nThread(s) per core:      2<\/p>\n<p>\u8fd9\u4e2a\u8f93\u51fa\u5f88\u6709\u610f\u601d\u3002lscpu \u7684\u7ed3\u679c\u544a\u8bc9\u6211\u4eec&#xff1a;\u8fd9\u53f0\u673a\u5668\u6709 1 \u4e2a\u7269\u7406 CPU&#xff08;Socket&#xff09;&#xff0c;\u6bcf\u4e2a CPU \u6709 4 \u4e2a\u7269\u7406\u6838\u5fc3&#xff0c;\u6bcf\u4e2a\u6838\u5fc3\u652f\u6301 2 \u4e2a\u8d85\u7ebf\u7a0b&#xff08;Hyper-Threading&#xff09;&#xff0c;\u56e0\u6b64\u903b\u8f91\u6838\u5fc3\u6570 &#061; 1 \u00d7 4 \u00d7 2 &#061; 8\u3002<\/p>\n<p>\u9700\u8981\u7279\u522b\u8bf4\u660e\u7684\u662f&#xff1a;nproc \u548c grep -c ^processor \u8fd4\u56de\u7684\u90fd\u662f\u903b\u8f91\u6838\u5fc3\u6570&#xff0c;\u4e5f\u5c31\u662f\u5305\u542b\u4e86\u8d85\u7ebf\u7a0b\u4e4b\u540e\u7684\u6570\u5b57\u3002\u8fd9\u662f Load Average \u8ba1\u7b97\u65f6\u4f7f\u7528\u7684\u53c2\u8003\u57fa\u51c6\u3002\u8d85\u7ebf\u7a0b\u867d\u7136\u5728\u786c\u4ef6\u4e0a\u5171\u4eab\u67d0\u4e9b\u8d44\u6e90&#xff0c;\u4f46\u5bf9\u64cd\u4f5c\u7cfb\u7edf\u6765\u8bf4&#xff0c;\u6bcf\u4e2a\u903b\u8f91\u6838\u5fc3\u90fd\u662f\u4e00\u4e2a\u53ef\u72ec\u7acb\u8c03\u5ea6\u7684&#034;CPU&#034;\u3002<\/p>\n<h4>4.3 Load Average \u7684&#034;\u5408\u7406\u8303\u56f4&#034;<\/h4>\n<p>\u6709\u4e86\u6838\u5fc3\u6570\u8fd9\u4e2a\u57fa\u51c6&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5efa\u7acb\u4e00\u4e2a\u7b80\u5355\u7684\u5224\u65ad\u6846\u67b6&#xff1a;<\/p>\n<table>\n<tr>\u8d1f\u8f7d \/ \u6838\u5fc3\u6570\u6bd4\u503c\u72b6\u6001\u63cf\u8ff0\u5904\u7406\u5efa\u8bae<\/tr>\n<tbody>\n<tr>\n<td>&lt; 0.7<\/td>\n<td>\u7cfb\u7edf\u7a7a\u95f2&#xff0c;\u8d44\u6e90\u5145\u8db3<\/td>\n<td>\u6b63\u5e38\u89c2\u5bdf<\/td>\n<\/tr>\n<tr>\n<td>0.7 ~ 1.0<\/td>\n<td>\u7cfb\u7edf\u5065\u5eb7&#xff0c;\u63a5\u8fd1\u6ee1\u8f7d<\/td>\n<td>\u7559\u610f\u8d8b\u52bf<\/td>\n<\/tr>\n<tr>\n<td>1.0 ~ 1.5<\/td>\n<td>\u8f7b\u5ea6\u8fc7\u8f7d&#xff0c;\u6709\u4efb\u52a1\u5728\u6392\u961f<\/td>\n<td>\u5173\u6ce8\u5e76\u627e\u539f\u56e0<\/td>\n<\/tr>\n<tr>\n<td>1.5 ~ 3.0<\/td>\n<td>\u4e2d\u5ea6\u8fc7\u8f7d&#xff0c;\u54cd\u5e94\u53ef\u80fd\u5f00\u59cb\u53d8\u6162<\/td>\n<td>\u5c3d\u5feb\u6392\u67e5<\/td>\n<\/tr>\n<tr>\n<td>&gt; 3.0<\/td>\n<td>\u4e25\u91cd\u8fc7\u8f7d&#xff0c;\u7cfb\u7edf\u538b\u529b\u6781\u5927<\/td>\n<td>\u7acb\u5373\u5904\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u91cc\u7684&#034;\u6bd4\u503c&#034;\u662f\u6307 load average \/ CPU\u6838\u5fc3\u6570\u3002\u4e3e\u4e2a\u4f8b\u5b50&#xff0c;8 \u6838\u673a\u5668\u7684 Load Average \u4e3a 12&#xff0c;\u6bd4\u503c\u5c31\u662f 1.5&#xff0c;\u5c5e\u4e8e\u4e2d\u5ea6\u8fc7\u8f7d\u3002<\/p>\n<p>\u4e0d\u8fc7\u8981\u6ce8\u610f&#xff0c;\u8fd9\u4e2a\u8868\u683c\u53ea\u662f\u53c2\u8003\u7ecf\u9a8c&#xff0c;\u4e0d\u662f\u7edd\u5bf9\u6807\u51c6\u3002\u6709\u4e9b\u7cfb\u7edf\u5bf9\u9ad8\u8d1f\u8f7d\u7684\u5bb9\u5fcd\u5ea6\u66f4\u5f3a&#xff0c;\u6709\u4e9b\u4e1a\u52a1\u573a\u666f\u672c\u8eab\u5c31\u4f1a\u6709\u77ed\u6682\u7684\u8d1f\u8f7d\u5cf0\u503c&#xff0c;\u8fd9\u4e9b\u90fd\u9700\u8981\u7ed3\u5408\u5b9e\u9645\u60c5\u51b5\u5224\u65ad\u3002\u91cd\u8981\u7684\u662f\u5efa\u7acb\u8d8b\u52bf\u610f\u8bc6&#xff0c;\u800c\u4e0d\u662f\u7528\u4e00\u4e2a\u56fa\u5b9a\u9608\u503c\u53bb\u505a&#034;\u6b63\u5e38 \/ \u5f02\u5e38&#034;\u7684\u4e8c\u5143\u5224\u65ad\u3002<\/p>\n<h3>\u4e94\u3001\u54ea\u4e9b\u8fdb\u7a0b\u4f1a\u8d21\u732e\u5230 Load Average<\/h3>\n<p>\u7406\u89e3\u8fd9\u4e00\u70b9&#xff0c;\u4f60\u624d\u80fd\u771f\u6b63\u641e\u61c2\u4e3a\u4ec0\u4e48&#034;Load Average \u9ad8\u4e0d\u7b49\u4e8e CPU \u5fd9&#034;\u3002<\/p>\n<p>Linux \u5185\u6838\u5728\u8ba1\u7b97 Load Average \u65f6&#xff0c;\u4f1a\u628a\u4ee5\u4e0b\u4e24\u7c7b\u72b6\u6001\u7684\u8fdb\u7a0b\u90fd\u8ba1\u5165\u7edf\u8ba1&#xff1a;<\/p>\n<h4>5.1 \u8fd0\u884c\u72b6\u6001&#xff08;R&#xff09;<\/h4>\n<p>\u8fdb\u7a0b\u72b6\u6001\u4e3a R&#xff08;Running \/ Runnable&#xff09;&#xff0c;\u5373\u8fdb\u7a0b\u6b63\u5728 CPU \u4e0a\u8fd0\u884c&#xff0c;\u6216\u8005\u5df2\u7ecf\u51c6\u5907\u597d\u53ef\u4ee5\u8fd0\u884c\u4f46\u5728\u7b49\u5f85 CPU \u8c03\u5ea6\u3002\u8fd9\u662f\u7edd\u5927\u591a\u6570\u4eba\u7406\u89e3\u7684&#034;CPU \u8d1f\u8f7d&#034;\u6765\u6e90\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u5904\u4e8e R \u72b6\u6001\u7684\u8fdb\u7a0b\u6570\u91cf&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u7edf\u8ba1\u5f53\u524d\u5904\u4e8e R&#xff08;\u8fd0\u884c\/\u5c31\u7eea&#xff09;\u72b6\u6001\u7684\u8fdb\u7a0b\u6570<\/span><br \/>\n<span class=\"token function\">ps<\/span> aux <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;$8 ~ \/^R\/ {count&#043;&#043;} END {print &#034;R \u72b6\u6001\u8fdb\u7a0b\u6570:&#034;, count}&#039;<\/span><\/p>\n<p>\u6216\u8005\u7528 top \u7684 Tasks \u884c\u4e2d\u7684 running \u5b57\u6bb5&#xff0c;\u540e\u9762\u6848\u4f8b\u90e8\u5206\u4f1a\u8be6\u7ec6\u6f14\u793a\u3002<\/p>\n<h4>5.2 \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u72b6\u6001&#xff08;D&#xff09;&#xff1a;\u6700\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u8d21\u732e\u8005<\/h4>\n<p>\u8fdb\u7a0b\u72b6\u6001\u4e3a D&#xff08;Uninterruptible Sleep&#xff09;&#xff0c;\u8fd9\u7c7b\u8fdb\u7a0b\u6b63\u5728\u7b49\u5f85\u67d0\u79cd I\/O \u64cd\u4f5c\u5b8c\u6210&#xff0c;\u800c\u4e14\u8fd9\u79cd\u7b49\u5f85\u65e0\u6cd5\u88ab\u4fe1\u53f7\u4e2d\u65ad\u2014\u2014\u54ea\u6015\u4f60\u53d1\u9001 kill -9 \u4e5f\u6740\u4e0d\u6389\u5b83&#xff0c;\u5b83\u53ea\u4f1a\u5728 I\/O \u5b8c\u6210\u540e\u81ea\u7136\u9192\u6765\u3002<\/p>\n<p>\u6700\u5e38\u89c1\u7684\u89e6\u53d1\u573a\u666f\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u8fdb\u7a0b\u5728\u7b49\u5f85\u78c1\u76d8 I\/O \u5b8c\u6210&#xff08;\u8bfb\u5199\u6162\u76d8\u3001\u574f\u76d8&#xff09;<\/li>\n<li>\u8fdb\u7a0b\u5728\u7b49\u5f85 NFS&#xff08;\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf&#xff09; \u7684\u54cd\u5e94<\/li>\n<li>\u8fdb\u7a0b\u5728\u7b49\u5f85\u67d0\u4e9b\u5185\u6838\u9501<\/li>\n<li>\u4e00\u4e9b\u4f4e\u8d28\u91cf\u7684\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u5bfc\u81f4\u8fdb\u7a0b\u5361\u4f4f<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u8fdb\u7a0b\u867d\u7136\u5b8c\u5168\u4e0d\u5360\u7528 CPU&#xff08;\u5b83\u4eec\u5728&#034;\u7761\u89c9&#034;&#xff09;&#xff0c;\u4f46\u4f9d\u7136\u88ab\u8ba1\u5165 Load Average\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4f60\u6709\u65f6\u5019\u4f1a\u770b\u5230\u670d\u52a1\u5668 CPU \u4f7f\u7528\u7387\u624d 10%&#xff0c;\u4f46\u8d1f\u8f7d\u5374\u9ad8\u8fbe 20 \u7684\u602a\u5f02\u73b0\u8c61\u2014\u2014\u6240\u6709\u7684\u9505\u90fd\u662f D \u72b6\u6001\u8fdb\u7a0b\u80cc\u7684\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u662f\u5426\u5b58\u5728 D \u72b6\u6001\u8fdb\u7a0b&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5904\u4e8e D \u72b6\u6001&#xff08;\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff09;\u7684\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> aux <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;$8 ~ \/^D\/ {print $0}&#039;<\/span><\/p>\n<p><span class=\"token comment\"># \u6216\u8005\u7528\u66f4\u7b80\u6d01\u7684\u65b9\u5f0f&#xff0c;\u7edf\u8ba1\u6570\u91cf<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-eo<\/span> state <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token string\">&#039;^D&#039;<\/span><\/p>\n<p>\u5982\u679c\u8fd9\u4e2a\u547d\u4ee4\u8fd4\u56de\u7684\u6570\u5b57\u4e0d\u662f 0&#xff0c;\u800c\u4e14 Load Average \u5f88\u9ad8\u4f46 CPU \u4f7f\u7528\u7387\u5f88\u4f4e&#xff0c;\u90a3\u5927\u6982\u7387\u662f I\/O \u95ee\u9898\u5bfc\u81f4\u7684\u3002<\/p>\n<h4>5.3 Load Average \u9ad8\u672a\u5fc5\u662f CPU \u7684\u9505<\/h4>\n<p>\u4e3a\u4e86\u8ba9\u8fd9\u4e2a\u7ed3\u8bba\u66f4\u76f4\u89c2&#xff0c;\u6211\u6574\u7406\u4e86\u4e00\u4e2a\u5206\u6790\u6846\u67b6&#xff1a;<\/p>\n<p>\u76f8\u5173\u793a\u610f\u56fe\u7ed8\u5236\u5982\u4e0b&#xff0c;\u4ec5\u4f9b\u5927\u5bb6\u4fdd\u5b58\u67e5\u9605&#xff1a;<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025715-6ae1648b2ca24.png\" \/> <\/p>\n<p>\u8fd9\u5f20\u56fe\u662f\u6574\u4e2a Load Average \u6392\u67e5\u601d\u8def\u7684\u6838\u5fc3\u6846\u67b6&#xff0c;\u6211\u4eec\u540e\u9762\u7684\u6848\u4f8b\u4e09\u4f1a\u5b8c\u6574\u8d70\u4e00\u904d\u8fd9\u4e2a\u6d41\u7a0b\u3002<\/p>\n<h3>\u516d\u3001\u5b9e\u9a8c\u73af\u5883\u51c6\u5907<\/h3>\n<p>\u5728\u6b63\u5f0f\u8fdb\u5165\u6848\u4f8b\u4e4b\u524d&#xff0c;\u5148\u786e\u8ba4\u4e00\u4e0b\u5b9e\u9a8c\u73af\u5883\u3002\u672c\u6587\u7684\u6240\u6709\u547d\u4ee4\u90fd\u5728\u4ee5\u4e0b\u73af\u5883\u4e2d\u9a8c\u8bc1\u8fc7&#xff1a;<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf&#xff1a;Ubuntu 22.04 LTS \/ Ubuntu 24.04 LTS<br \/>\n\u73af\u5883\u7c7b\u578b&#xff1a;Ubuntu Server \u6216 Ubuntu Desktop \u5747\u53ef<br \/>\nCPU&#xff1a;\u63a8\u8350\u81f3\u5c11 2 \u6838&#xff08;\u5355\u6838\u673a\u5668\u4e5f\u53ef\u4ee5&#xff0c;\u4f46\u89c2\u5bdf\u6548\u679c\u4e0d\u5982\u591a\u6838\u76f4\u89c2&#xff09;<\/p>\n<p>\u9996\u5148&#xff0c;\u786e\u8ba4\u4f60\u7684\u7cfb\u7edf\u7248\u672c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u7cfb\u7edf\u7248\u672c<\/span><br \/>\nlsb_release <span class=\"token parameter variable\">-a<\/span><\/p>\n<p>No LSB modules are available.<br \/>\nDistributor ID: Ubuntu<br \/>\nDescription:    Ubuntu 22.04.4 LTS<br \/>\nRelease:        22.04<br \/>\nCodename:       jammy<\/p>\n<p>\u5b89\u88c5\u672c\u6587\u5b9e\u9a8c\u9700\u8981\u7528\u5230\u7684\u5de5\u5177&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u66f4\u65b0\u8f6f\u4ef6\u6e90\u7d22\u5f15<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5\u76d1\u63a7\u5de5\u5177\u548c\u538b\u6d4b\u5de5\u5177<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">htop<\/span> <span class=\"token punctuation\">\\\\<\/span>          <span class=\"token comment\"># \u589e\u5f3a\u7248 top&#xff0c;\u754c\u9762\u66f4\u53cb\u597d<\/span><br \/>\n    sysstat <span class=\"token punctuation\">\\\\<\/span>       <span class=\"token comment\"># \u5305\u542b iostat\u3001sar\u3001pidstat \u7b49\u5de5\u5177<\/span><br \/>\n    stress-ng <span class=\"token punctuation\">\\\\<\/span>     <span class=\"token comment\"># \u7cfb\u7edf\u538b\u529b\u6d4b\u8bd5\u5de5\u5177<\/span><br \/>\n    procps          <span class=\"token comment\"># \u5305\u542b vmstat\u3001ps\u3001uptime \u7b49\u6838\u5fc3\u5de5\u5177&#xff08;\u901a\u5e38\u5df2\u5185\u7f6e&#xff09;<\/span><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u9a8c\u8bc1\u5404\u5de5\u5177\u662f\u5426\u53ef\u7528&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u5404\u5de5\u5177\u7248\u672c<\/span><br \/>\n<span class=\"token function\">uptime<\/span> <span class=\"token parameter variable\">&#8211;version<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">||<\/span> <span class=\"token function\">uptime<\/span>   <span class=\"token comment\"># uptime \u4e0d\u652f\u6301 &#8211;version&#xff0c;\u76f4\u63a5\u8fd0\u884c\u5373\u53ef<\/span><br \/>\n<span class=\"token function\">htop<\/span> <span class=\"token parameter variable\">&#8211;version<\/span><br \/>\niostat <span class=\"token parameter variable\">-V<\/span><br \/>\nsar <span class=\"token parameter variable\">-V<\/span><br \/>\nstress-ng <span class=\"token parameter variable\">&#8211;version<\/span><\/p>\n<p><span class=\"token comment\"># \u786e\u8ba4\u672c\u673a CPU \u6838\u5fc3\u6570&#xff0c;\u540e\u7eed\u5206\u6790\u7684\u57fa\u51c6<\/span><br \/>\nnproc<\/p>\n<p>\u8bb0\u4f4f\u8fd9\u4e2a\u6570\u5b57&#xff0c;\u540e\u9762\u6240\u6709\u7684\u8d1f\u8f7d\u5224\u65ad\u90fd\u8981\u4ee5\u5b83\u4f5c\u4e3a\u53c2\u8003\u3002<\/p>\n<h3>\u4e03\u3001\u6848\u4f8b\u4e00&#xff1a;\u7528 uptime \u548c top \u8bfb\u61c2 Load Average<\/h3>\n<h4>7.1 uptime \u547d\u4ee4&#xff1a;\u6700\u5feb\u901f\u7684\u8d1f\u8f7d\u5feb\u7167<\/h4>\n<p>uptime \u662f\u67e5\u770b\u7cfb\u7edf\u8d1f\u8f7d\u6700\u5feb\u7684\u65b9\u5f0f&#xff0c;\u6ca1\u6709\u4e4b\u4e00\u3002\u5b83\u7684\u8f93\u51fa\u7b80\u6d01&#xff0c;\u51e0\u79d2\u949f\u5c31\u80fd\u8ba9\u4f60\u5bf9\u7cfb\u7edf\u6574\u4f53\u72b6\u6001\u6709\u4e2a\u57fa\u672c\u5224\u65ad\u3002<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4\u548c\u5e73\u5747\u8d1f\u8f7d<\/span><br \/>\n<span class=\"token function\">uptime<\/span><\/p>\n<p>\u8f93\u51fa\u793a\u4f8b&#xff1a;<\/p>\n<p> 15:42:07 up 12 days,  6:35,  3 users,  load average: 0.52, 0.48, 0.43<\/p>\n<p>\u9010\u5b57\u6bb5\u89e3\u8bfb&#xff1a;<\/p>\n<ul>\n<li>15:42:07&#xff1a;\u5f53\u524d\u65f6\u95f4<\/li>\n<li>up 12 days, 6:35&#xff1a;\u7cfb\u7edf\u5df2\u8fde\u7eed\u8fd0\u884c 12 \u5929 6 \u5c0f\u65f6 35 \u5206\u949f<\/li>\n<li>3 users&#xff1a;\u5f53\u524d\u767b\u5f55\u7528\u6237\u6570&#xff08;\u5305\u542b SSH \u4f1a\u8bdd&#xff09;<\/li>\n<li>load average: 0.52, 0.48, 0.43&#xff1a;1 \u5206\u949f\u30015 \u5206\u949f\u300115 \u5206\u949f\u7684\u5e73\u5747\u8d1f\u8f7d<\/li>\n<\/ul>\n<p>\u5047\u8bbe\u8fd9\u53f0\u673a\u5668\u662f 4 \u6838 CPU&#xff1a;<\/p>\n<ul>\n<li>0.52 \/ 4 &#061; 0.13 \u2192 \u7cfb\u7edf\u975e\u5e38\u7a7a\u95f2&#xff0c;\u8d1f\u8f7d\u53ea\u6709 CPU \u5bb9\u91cf\u7684 13%<\/li>\n<li>\u4e09\u4e2a\u503c\u975e\u5e38\u63a5\u8fd1 \u2192 \u7cfb\u7edf\u8d1f\u8f7d\u7a33\u5b9a&#xff0c;\u6ca1\u6709\u7a81\u7136\u7684\u5f02\u5e38<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u770b\u8d1f\u8f7d\u6570\u5b57&#xff0c;\u53ef\u4ee5\u52a0 -p \u53c2\u6570&#xff08;\u5728\u67d0\u4e9b\u7248\u672c\u4e0a\u6709\u6548&#xff09;\u6216\u8005\u76f4\u63a5\u7528 cat \/proc\/loadavg&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u76f4\u63a5\u8bfb\u53d6\u5185\u6838\u66b4\u9732\u7684\u8d1f\u8f7d\u6570\u636e<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/proc\/loadavg<\/p>\n<p>0.52 0.48 0.43 2\/312 18547<\/p>\n<p>\u8fd9\u91cc\u7684\u5185\u5bb9\u6bd4 uptime \u66f4\u4e30\u5bcc\u4e00\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u524d\u4e09\u4e2a\u6570\u5b57&#xff1a;1\u30015\u300115 \u5206\u949f\u8d1f\u8f7d<\/li>\n<li>2\/312&#xff1a;\u5f53\u524d\u6d3b\u8dc3\u8fdb\u7a0b\u6570 \/ \u7cfb\u7edf\u603b\u8fdb\u7a0b\u6570<\/li>\n<li>18547&#xff1a;\u6700\u8fd1\u521b\u5efa\u7684\u8fdb\u7a0b\u7684 PID<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u662f\u5185\u6838\u76f4\u63a5\u66b4\u9732\u7684&#xff0c;uptime\u3001top\u3001htop \u7b49\u5de5\u5177\u90fd\u662f\u4ece\u8fd9\u91cc\u8bfb\u6570\u636e\u7684\u3002\u5728\u811a\u672c\u4e2d\u505a\u76d1\u63a7\u5224\u65ad\u65f6&#xff0c;\u76f4\u63a5 cat \/proc\/loadavg \u6548\u7387\u6700\u9ad8\u3002<\/p>\n<h4>7.2 top \u547d\u4ee4\u4e2d\u7684 Load Average<\/h4>\n<p>top \u547d\u4ee4\u7684\u7b2c\u4e00\u884c\u5c31\u663e\u793a\u4e86 Load Average&#xff0c;\u548c uptime \u7684\u8f93\u51fa\u5185\u5bb9\u5b8c\u5168\u76f8\u540c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u542f\u52a8 top<\/span><br \/>\n<span class=\"token function\">top<\/span><\/p>\n<p>top &#8211; 15:42:07 up 12 days,  6:35,  3 users,  load average: 0.52, 0.48, 0.43<br \/>\nTasks: 312 total,   2 running, 310 sleeping,   0 stopped,   0 zombie<br \/>\n%Cpu(s):  3.2 us,  1.1 sy,  0.0 ni, 94.8 id,  0.7 wa,  0.0 hi,  0.2 si,  0.0 st<br \/>\nMiB Mem :   7852.4 total,   2143.2 free,   3124.8 used,   2584.4 buff\/cache<br \/>\nMiB Swap:   2048.0 total,   2048.0 free,      0.0 used.   4123.5 avail Mem<\/p>\n<p>top \u8f93\u51fa\u4e2d\u6709\u51e0\u4e2a\u5b57\u6bb5\u548c Load Average \u5206\u6790\u76f4\u63a5\u76f8\u5173&#xff0c;\u503c\u5f97\u4ed4\u7ec6\u770b&#xff1a;<\/p>\n<p>\u7b2c\u4e8c\u884c Tasks&#xff08;\u8fdb\u7a0b\u72b6\u6001\u7edf\u8ba1&#xff09;&#xff1a;<\/p>\n<p>Tasks: 312 total,   2 running, 310 sleeping,   0 stopped,   0 zombie<\/p>\n<ul>\n<li>312 total&#xff1a;\u7cfb\u7edf\u603b\u8fdb\u7a0b\u6570<\/li>\n<li>2 running&#xff1a;\u5904\u4e8e R \u72b6\u6001&#xff08;\u8fd0\u884c\/\u5c31\u7eea&#xff09;\u7684\u8fdb\u7a0b\u6570<\/li>\n<li>310 sleeping&#xff1a;\u5904\u4e8e S \u72b6\u6001&#xff08;\u53ef\u4e2d\u65ad\u7761\u7720&#xff0c;\u7b49\u5f85\u4e8b\u4ef6&#xff09;\u7684\u8fdb\u7a0b\u6570&#xff0c;\u8fd9\u7c7b\u8fdb\u7a0b\u4e0d\u8ba1\u5165 Load Average<\/li>\n<li>0 stopped&#xff1a;\u88ab\u6682\u505c\u7684\u8fdb\u7a0b&#xff08;Ctrl&#043;Z \u6216 SIGSTOP&#xff09;<\/li>\n<li>0 zombie&#xff1a;\u50f5\u5c38\u8fdb\u7a0b<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u7684\u5173\u952e\u662f&#xff1a;running \u7684\u8fdb\u7a0b\u662f\u8ba1\u5165 Load Average \u7684&#xff1b;sleeping \u7684\u8fdb\u7a0b\u901a\u5e38\u4e0d\u8ba1\u5165&#xff08;S \u72b6\u6001\u4e0d\u8ba1\u5165&#xff0c;D \u72b6\u6001\u8ba1\u5165&#xff0c;\u4f46 top \u7684 Tasks \u884c\u6ca1\u6709\u5355\u72ec\u663e\u793a D \u72b6\u6001\u6570\u91cf&#xff0c;\u8fd9\u662f\u4e00\u4e2a\u5c0f\u7f3a\u9677&#xff09;\u3002<\/p>\n<p>\u7b2c\u4e09\u884c %Cpu(s)&#xff08;CPU \u4f7f\u7528\u7387\u7ec6\u5206&#xff09;&#xff1a;<\/p>\n<p>%Cpu(s):  3.2 us,  1.1 sy,  0.0 ni, 94.8 id,  0.7 wa,  0.0 hi,  0.2 si,  0.0 st<\/p>\n<ul>\n<li>us&#xff08;user&#xff09;&#xff1a;\u7528\u6237\u6001 CPU \u4f7f\u7528\u7387&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u672c\u8eab\u7684\u8fd0\u7b97<\/li>\n<li>sy&#xff08;system&#xff09;&#xff1a;\u5185\u6838\u6001 CPU \u4f7f\u7528\u7387&#xff0c;\u7cfb\u7edf\u8c03\u7528\u3001\u5185\u6838\u64cd\u4f5c<\/li>\n<li>ni&#xff08;nice&#xff09;&#xff1a;\u8c03\u6574\u4e86\u4f18\u5148\u7ea7&#xff08;nice \u503c&#xff09;\u7684\u8fdb\u7a0b\u7684 CPU \u4f7f\u7528\u7387<\/li>\n<li>id&#xff08;idle&#xff09;&#xff1a;CPU \u7a7a\u95f2\u7387&#xff0c;\u8d8a\u9ad8\u8bf4\u660e CPU \u8d8a\u95f2<\/li>\n<li>wa&#xff08;iowait&#xff09;&#xff1a;CPU \u7b49\u5f85 I\/O \u5b8c\u6210\u7684\u65f6\u95f4\u5360\u6bd4\u2014\u2014\u8fd9\u4e2a\u503c\u975e\u5e38\u5173\u952e&#xff01;<\/li>\n<li>hi&#xff08;hardware interrupts&#xff09;&#xff1a;\u786c\u4ef6\u4e2d\u65ad\u5904\u7406\u65f6\u95f4<\/li>\n<li>si&#xff08;software interrupts&#xff09;&#xff1a;\u8f6f\u4ef6\u4e2d\u65ad\u5904\u7406\u65f6\u95f4<\/li>\n<li>st&#xff08;steal&#xff09;&#xff1a;\u88ab\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f&#034;\u5077\u8d70&#034;\u7684 CPU \u65f6\u95f4&#xff08;\u865a\u62df\u673a\u73af\u5883\u4e0b\u6709\u610f\u4e49&#xff09;<\/li>\n<\/ul>\n<p>wa&#xff08;iowait&#xff09;\u662f\u5206\u6790 Load Average \u662f\u5426\u7531 I\/O \u5f15\u8d77\u7684\u91cd\u8981\u7ebf\u7d22\u3002 \u5982\u679c\u4f60\u770b\u5230 Load Average \u9ad8\u4f46 CPU id&#xff08;idle&#xff09;\u4e5f\u9ad8&#xff0c;\u540c\u65f6 wa \u6bd4\u8f83\u9ad8&#xff08;\u6bd4\u5982\u8d85\u8fc7 10%&#xff09;&#xff0c;\u90a3 I\/O \u7b49\u5f85\u7684\u5acc\u7591\u5c31\u5f88\u5927\u4e86\u3002<\/p>\n<p>\u5728 top \u8fd0\u884c\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u6309\u4ee5\u4e0b\u5feb\u6377\u952e\u8fdb\u884c\u64cd\u4f5c&#xff1a;<\/p>\n<ul>\n<li>1&#xff1a;\u5c55\u5f00\u6bcf\u4e2a CPU \u6838\u5fc3\u7684\u4f7f\u7528\u60c5\u51b5&#xff08;\u591a\u6838\u673a\u5668\u5fc5\u7528&#xff09;<\/li>\n<li>M&#xff1a;\u6309\u5185\u5b58\u4f7f\u7528\u91cf\u6392\u5e8f<\/li>\n<li>P&#xff1a;\u6309 CPU \u4f7f\u7528\u7387\u6392\u5e8f<\/li>\n<li>q&#xff1a;\u9000\u51fa<\/li>\n<\/ul>\n<h4>7.3 htop \u4e2d\u7684\u76f4\u89c2\u5c55\u793a<\/h4>\n<p>\u5982\u679c\u4f60\u5b89\u88c5\u4e86 htop&#xff08;\u524d\u9762\u5df2\u5b89\u88c5&#xff09;&#xff0c;\u5b83\u63d0\u4f9b\u4e86\u66f4\u76f4\u89c2\u7684\u53ef\u89c6\u5316\u754c\u9762&#xff1a;<\/p>\n<p><span class=\"token function\">htop<\/span><\/p>\n<p>htop \u754c\u9762\u7684\u5de6\u4e0a\u89d2\u4f1a\u4ee5\u5f69\u8272\u8fdb\u5ea6\u6761\u5f62\u5f0f\u5c55\u793a\u6bcf\u4e2a CPU \u6838\u5fc3\u7684\u4f7f\u7528\u7387&#xff0c;\u53f3\u4e0a\u89d2\u663e\u793a Load Average\u3002\u5bf9\u4e8e\u591a\u6838\u673a\u5668&#xff0c;\u8fd9\u6bd4 top \u7684\u5355\u884c CPU \u663e\u793a\u66f4\u76f4\u89c2\u2014\u2014\u4f60\u4e00\u773c\u5c31\u80fd\u770b\u51fa\u662f\u6240\u6709\u6838\u5fc3\u90fd\u5fd9&#xff0c;\u8fd8\u662f\u53ea\u6709\u4e2a\u522b\u6838\u5fc3\u8dd1\u6ee1\u4e86\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;htop \u7684\u8fdb\u7a0b\u5217\u8868\u4e2d&#xff0c;\u5904\u4e8e\u4e0d\u540c\u72b6\u6001\u7684\u8fdb\u7a0b\u4f1a\u7528\u4e0d\u540c\u989c\u8272\u6807\u6ce8&#xff0c;D \u72b6\u6001\u7684\u8fdb\u7a0b&#xff08;\u5982\u679c\u5b58\u5728&#xff09;\u4f1a\u7279\u522b\u663e\u773c\u3002<\/p>\n<h4>7.4 \u547d\u4ee4\u89e3\u6790<\/h4>\n<p>\u8fd9\u51e0\u4e2a\u5de5\u5177\u4e4b\u95f4\u7684\u5173\u7cfb\u548c\u4f7f\u7528\u573a\u666f\u503c\u5f97\u68b3\u7406\u4e00\u4e0b&#xff1a;<\/p>\n<p>uptime \u6700\u8f7b\u91cf&#xff0c;\u9002\u5408\u767b\u5f55\u670d\u52a1\u5668\u540e\u7684\u7b2c\u4e00\u773c\u786e\u8ba4&#xff0c;\u6216\u8005\u5728 shell \u811a\u672c\u91cc\u505a\u5feb\u901f\u68c0\u67e5\u3002\u5b83\u4e0d\u9700\u8981\u4fdd\u6301\u4ea4\u4e92&#xff0c;\u4e00\u6761\u547d\u4ee4\u7acb\u523b\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p>top \u662f\u4e2d\u7b49\u6df1\u5ea6\u7684\u5b9e\u65f6\u76d1\u63a7\u5de5\u5177&#xff0c;\u5185\u7f6e\u4e8e\u6240\u6709 Linux \u7cfb\u7edf&#xff0c;\u65e0\u9700\u989d\u5916\u5b89\u88c5\u3002\u5b83\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u540c\u65f6\u770b\u5230\u8fdb\u7a0b\u5217\u8868\u548c\u7cfb\u7edf\u8d44\u6e90\u6458\u8981&#xff0c;\u7f3a\u70b9\u662f\u754c\u9762\u76f8\u5bf9\u4e0d\u90a3\u4e48\u53cb\u597d&#xff0c;\u4e14\u9ed8\u8ba4\u6392\u5e8f\u5bf9\u521d\u5b66\u8005\u4e0d\u591f\u76f4\u89c2\u3002<\/p>\n<p>htop \u662f top \u7684\u589e\u5f3a\u7248&#xff0c;\u754c\u9762\u66f4\u53cb\u597d&#xff0c;\u652f\u6301\u9f20\u6807\u64cd\u4f5c&#xff0c;\u5bf9\u591a\u6838 CPU \u7684\u5c55\u793a\u66f4\u6e05\u6670\u3002\u5728\u6709\u6761\u4ef6\u7684\u60c5\u51b5\u4e0b&#xff0c;\u6211\u66f4\u4e60\u60ef\u7528 htop \u505a\u65e5\u5e38\u76d1\u63a7\u3002\u4f46\u5b83\u4e0d\u662f\u6240\u6709\u7cfb\u7edf\u7684\u6807\u51c6\u5b89\u88c5&#xff0c;\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u4e0d\u4e00\u5b9a\u6709&#xff0c;\u8fd9\u65f6\u5019\u8fd8\u5f97\u7528 top\u3002<\/p>\n<p>\/proc\/loadavg \u662f\u4e0a\u8ff0\u6240\u6709\u5de5\u5177\u7684\u6570\u636e\u6765\u6e90&#xff0c;\u9002\u5408\u5199\u76d1\u63a7\u811a\u672c\u65f6\u76f4\u63a5\u8bfb\u53d6&#xff0c;\u907f\u514d\u89e3\u6790\u547d\u4ee4\u8f93\u51fa\u7684\u9ebb\u70e6\u3002<\/p>\n<h3>\u516b\u3001\u6848\u4f8b\u4e8c&#xff1a;\u6a21\u62df\u9ad8\u8d1f\u8f7d\u573a\u666f&#xff0c;\u4eb2\u773c\u770b Load Average \u4e0a\u5347<\/h3>\n<p>\u5149\u9760\u7406\u89e3\u6982\u5ff5\u8fd8\u4e0d\u591f\u3002\u6211\u5efa\u8bae\u4f60\u4e00\u5b9a\u8981\u4eb2\u624b\u505a\u8fd9\u4e2a\u5b9e\u9a8c\u2014\u2014\u4eb2\u773c\u770b\u7740 Load Average \u4ece\u4f4e\u5230\u9ad8&#xff0c;\u518d\u4ece\u9ad8\u964d\u56de\u6765&#xff0c;\u4f60\u5bf9\u8fd9\u4e2a\u6307\u6807\u7684\u7406\u89e3\u4f1a\u5b8c\u5168\u4e0d\u540c\u3002<\/p>\n<h4>8.1 \u4f7f\u7528 stress-ng \u6a21\u62df CPU \u538b\u529b<\/h4>\n<p>stress-ng \u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7cfb\u7edf\u538b\u529b\u6d4b\u8bd5\u5de5\u5177&#xff0c;\u53ef\u4ee5\u9488\u5bf9 CPU\u3001\u5185\u5b58\u3001I\/O \u7b49\u5404\u79cd\u5b50\u7cfb\u7edf\u65bd\u52a0\u538b\u529b\u3002<\/p>\n<p>\u5148\u5f00\u4e24\u4e2a\u7ec8\u7aef\u7a97\u53e3&#xff08;\u6216\u8005\u7528 tmux&#xff09;&#xff0c;\u4e00\u4e2a\u7528\u6765\u8dd1\u538b\u529b\u6d4b\u8bd5&#xff0c;\u4e00\u4e2a\u7528\u6765\u6301\u7eed\u89c2\u5bdf\u8d1f\u8f7d\u53d8\u5316\u3002<\/p>\n<p>\u7ec8\u7aef 1&#xff1a;\u5f00\u59cb CPU \u538b\u529b\u6d4b\u8bd5<\/p>\n<p><span class=\"token comment\"># \u542f\u52a8 CPU \u538b\u529b\u6d4b\u8bd5<\/span><br \/>\n<span class=\"token comment\"># &#8211;cpu 4&#xff1a;\u542f\u52a8 4 \u4e2a CPU \u5bc6\u96c6\u578b worker \u8fdb\u7a0b<\/span><br \/>\n<span class=\"token comment\"># &#8211;timeout 60s&#xff1a;\u6301\u7eed\u8fd0\u884c 60 \u79d2\u540e\u81ea\u52a8\u505c\u6b62<\/span><br \/>\n<span class=\"token comment\"># &#8211;metrics-brief&#xff1a;\u6253\u5370\u7b80\u5355\u7684\u6027\u80fd\u7edf\u8ba1<\/span><br \/>\nstress-ng <span class=\"token parameter variable\">&#8211;cpu<\/span> <span class=\"token number\">4<\/span> <span class=\"token parameter variable\">&#8211;timeout<\/span> 60s &#8211;metrics-brief<\/p>\n<p>\u7ec8\u7aef 2&#xff1a;\u6301\u7eed\u89c2\u5bdf\u8d1f\u8f7d\u53d8\u5316<\/p>\n<p><span class=\"token comment\"># \u6bcf 2 \u79d2\u5237\u65b0\u4e00\u6b21 uptime \u8f93\u51fa&#xff0c;\u6301\u7eed\u89c2\u5bdf\u8d1f\u8f7d\u53d8\u5316<\/span><br \/>\n<span class=\"token function\">watch<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">2<\/span> <span class=\"token function\">uptime<\/span><\/p>\n<p>\u4f60\u4f1a\u770b\u5230 1 \u5206\u949f\u8d1f\u8f7d\u5f00\u59cb\u7f13\u6162\u4e0a\u5347&#xff0c;5 \u5206\u949f\u548c 15 \u5206\u949f\u7684\u503c\u56e0\u4e3a\u65f6\u95f4\u7a97\u53e3\u66f4\u957f&#xff0c;\u53d8\u5316\u66f4\u6162\u3002\u7b49 60 \u79d2\u7684\u538b\u529b\u6d4b\u8bd5\u7ed3\u675f\u540e&#xff0c;1 \u5206\u949f\u7684\u8d1f\u8f7d\u4f1a\u7387\u5148\u5f00\u59cb\u4e0b\u964d&#xff0c;\u800c 5 \u5206\u949f\u548c 15 \u5206\u949f\u7684\u503c\u8fd8\u4f1a\u5728\u9ad8\u4f4d\u6301\u7eed\u4e00\u6bb5\u65f6\u95f4\u2014\u2014\u8fd9\u5c31\u662f&#034;\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747&#034;\u5e26\u6765\u7684\u6ede\u540e\u6548\u5e94\u3002<\/p>\n<p>\u4e0e\u6b64\u540c\u65f6&#xff0c;\u5728\u7ec8\u7aef 2 \u4e2d\u6362\u7528 top \u89c2\u5bdf&#xff0c;\u4f60\u4f1a\u770b\u5230 CPU us&#xff08;user&#xff09;\u4f7f\u7528\u7387\u660e\u663e\u4e0a\u5347&#xff0c;\u800c wa&#xff08;iowait&#xff09;\u57fa\u672c\u4e0d\u53d8\u3002\u8fd9\u662f\u5178\u578b\u7684 CPU \u5bc6\u96c6\u578b\u8d1f\u8f7d\u7279\u5f81&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u7528 top \u89c2\u5bdf&#xff0c;\u6309 1 \u5c55\u5f00\u6bcf\u4e2a CPU \u6838\u5fc3<\/span><br \/>\n<span class=\"token function\">top<\/span><\/p>\n<p>%Cpu0  : 98.3 us,  0.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  1.0 si<br \/>\n%Cpu1  : 97.8 us,  0.9 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  1.3 si<br \/>\n%Cpu2  : 98.1 us,  0.6 sy,  0.0 ni,  0.0 id,  0.3 wa,  0.0 hi,  1.0 si<br \/>\n%Cpu3  : 97.5 us,  1.2 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  1.3 si<\/p>\n<p>CPU \u4f7f\u7528\u7387\u63a5\u8fd1 100%&#xff0c;wa \u63a5\u8fd1 0\u3002Load Average \u4e0a\u5347\u662f\u56e0\u4e3a\u8fd9 4 \u4e2a CPU worker \u8fdb\u7a0b\u90fd\u5904\u4e8e R&#xff08;\u8fd0\u884c\/\u5c31\u7eea&#xff09;\u72b6\u6001&#xff0c;\u6301\u7eed\u5360\u7528 CPU \u8c03\u5ea6\u8d44\u6e90\u3002<\/p>\n<h4>8.2 \u4f7f\u7528 stress-ng \u6a21\u62df I\/O \u538b\u529b<\/h4>\n<p>\u73b0\u5728\u6765\u6a21\u62df\u4e00\u4e2a\u622a\u7136\u4e0d\u540c\u7684\u573a\u666f&#xff1a;I\/O \u5bc6\u96c6\u578b\u8d1f\u8f7d\u3002<\/p>\n<p><span class=\"token comment\"># \u542f\u52a8 I\/O \u538b\u529b\u6d4b\u8bd5<\/span><br \/>\n<span class=\"token comment\"># &#8211;iomix 4&#xff1a;\u542f\u52a8 4 \u4e2a\u6df7\u5408 I\/O worker&#xff0c;\u6a21\u62df\u8bfb\u5199\u538b\u529b<\/span><br \/>\n<span class=\"token comment\"># &#8211;iomix-bytes 10%&#xff1a;\u6bcf\u4e2a worker \u6bcf\u6b21\u64cd\u4f5c 10% \u7684\u53ef\u7528\u5185\u5b58\u5927\u5c0f<\/span><br \/>\n<span class=\"token comment\"># &#8211;timeout 60s&#xff1a;\u6301\u7eed 60 \u79d2<\/span><br \/>\nstress-ng <span class=\"token parameter variable\">&#8211;iomix<\/span> <span class=\"token number\">4<\/span> &#8211;iomix-bytes <span class=\"token number\">10<\/span>% <span class=\"token parameter variable\">&#8211;timeout<\/span> 60s &#8211;metrics-brief<\/p>\n<p>\u540c\u6837\u5728\u53e6\u4e00\u4e2a\u7ec8\u7aef\u89c2\u5bdf&#xff1a;<\/p>\n<p><span class=\"token function\">watch<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">2<\/span> <span class=\"token function\">uptime<\/span><\/p>\n<p>\u4f60\u4f1a\u53d1\u73b0 Load Average \u4e5f\u5728\u4e0a\u5347&#xff0c;\u4f46\u8fd9\u65f6\u5019\u518d\u770b top&#xff1a;<\/p>\n<p>%Cpu(s):  2.1 us,  8.3 sy,  0.0 ni, 72.4 id, 16.8 wa,  0.0 hi,  0.4 si<\/p>\n<p>\u6ce8\u610f\u51e0\u4e2a\u5173\u952e\u53d8\u5316&#xff1a;<\/p>\n<ul>\n<li>id&#xff08;idle&#xff09;\u8fd8\u6709 72%&#xff0c;CPU \u8fdc\u6ca1\u6709\u6ee1<\/li>\n<li>wa&#xff08;iowait&#xff09;\u4e0a\u5347\u5230\u4e86 16.8%<\/li>\n<li>sy&#xff08;system&#xff09;\u4e5f\u6bd4\u5e73\u65f6\u9ad8&#xff0c;\u8bf4\u660e\u5185\u6838\u5728\u9891\u7e41\u5904\u7406 I\/O \u76f8\u5173\u7684\u7cfb\u7edf\u8c03\u7528<\/li>\n<\/ul>\n<p>\u8fd9\u5c31\u662f I\/O \u5bc6\u96c6\u578b\u8d1f\u8f7d\u7684\u5178\u578b\u7279\u5f81&#xff1a;CPU \u5f88\u95f2&#xff0c;\u4f46\u7cfb\u7edf\u5728\u5927\u91cf\u7b49\u5f85 I\/O&#xff0c;Load Average \u4f9d\u7136\u4f1a\u4e0a\u5347&#xff08;\u56e0\u4e3a D \u72b6\u6001\u8fdb\u7a0b\u88ab\u8ba1\u5165\u7edf\u8ba1&#xff09;\u3002<\/p>\n<p>\u4f60\u8fd8\u53ef\u4ee5\u7ed3\u5408 ps \u6765\u89c2\u5bdf\u5f53\u524d\u662f\u5426\u5b58\u5728 D \u72b6\u6001\u8fdb\u7a0b&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5728\u538b\u529b\u6d4b\u8bd5\u8fd0\u884c\u4e2d&#xff0c;\u67e5\u770b D \u72b6\u6001\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-eo<\/span> pid,stat,comm <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;$2 ~ \/^D\/ {print}&#039;<\/span><\/p>\n<p>\u5982\u679c\u538b\u529b\u8db3\u591f\u5927&#xff0c;\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u90e8\u5206 stress-ng \u7684 worker \u8fdb\u7a0b\u5904\u4e8e D \u72b6\u6001\u3002<\/p>\n<h4>8.3 \u5bf9\u6bd4\u4e24\u79cd\u8d1f\u8f7d\u7684\u533a\u522b<\/h4>\n<p>\u628a\u4e24\u4e2a\u573a\u666f\u7684\u7279\u5f81\u6574\u7406\u6210\u5bf9\u6bd4\u8868&#xff1a;<\/p>\n<table>\n<tr>\u6307\u6807CPU \u5bc6\u96c6\u578b\u8d1f\u8f7dI\/O \u5bc6\u96c6\u578b\u8d1f\u8f7d<\/tr>\n<tbody>\n<tr>\n<td>Load Average<\/td>\n<td>\u4e0a\u5347<\/td>\n<td>\u4e0a\u5347<\/td>\n<\/tr>\n<tr>\n<td>CPU us \/ sy<\/td>\n<td>\u975e\u5e38\u9ad8<\/td>\n<td>\u8f83\u4f4e<\/td>\n<\/tr>\n<tr>\n<td>CPU id&#xff08;\u7a7a\u95f2&#xff09;<\/td>\n<td>\u63a5\u8fd1 0%<\/td>\n<td>\u53ef\u80fd\u4ecd\u7136\u8f83\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>CPU wa&#xff08;iowait&#xff09;<\/td>\n<td>\u63a5\u8fd1 0%<\/td>\n<td>\u660e\u663e\u5347\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>D \u72b6\u6001\u8fdb\u7a0b\u6570<\/td>\n<td>\u5c11<\/td>\n<td>\u591a<\/td>\n<\/tr>\n<tr>\n<td>\u4e3b\u8981\u74f6\u9888<\/td>\n<td>CPU \u8ba1\u7b97\u80fd\u529b<\/td>\n<td>\u78c1\u76d8\/I\/O \u5b50\u7cfb\u7edf<\/td>\n<\/tr>\n<tr>\n<td>\u4f18\u5316\u65b9\u5411<\/td>\n<td>\u51cf\u5c11\u8ba1\u7b97\u91cf\u3001\u4f18\u5316\u7b97\u6cd5\u3001\u6269 CPU<\/td>\n<td>\u4f18\u5316 I\/O \u6a21\u5f0f\u3001\u5347\u7ea7\u78c1\u76d8\u3001\u8c03\u6574 I\/O \u8c03\u5ea6\u5668<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u5f20\u5bf9\u6bd4\u8868\u5728\u771f\u5b9e\u6392\u67e5\u4e2d\u975e\u5e38\u5b9e\u7528\u3002\u62ff\u5230\u4e00\u53f0\u8d1f\u8f7d\u5f02\u5e38\u7684\u670d\u52a1\u5668&#xff0c;\u4f60\u8981\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u5224\u65ad\u5b83\u5c5e\u4e8e\u54ea\u79cd\u7c7b\u578b&#xff0c;\u7136\u540e\u624d\u80fd\u51b3\u5b9a\u4e0b\u4e00\u6b65\u7684\u6392\u67e5\u8def\u5f84\u3002<\/p>\n<h4>8.4 \u547d\u4ee4\u89e3\u6790\u4e0e\u89c2\u5bdf\u8981\u70b9<\/h4>\n<p>stress-ng \u662f\u4e00\u4e2a\u975e\u5e38\u4e13\u4e1a\u7684\u7cfb\u7edf\u538b\u529b\u6d4b\u8bd5\u5de5\u5177&#xff0c;\u6bd4\u65e9\u671f\u5e38\u7528\u7684 stress \u529f\u80fd\u66f4\u4e30\u5bcc&#xff0c;\u652f\u6301\u7684\u538b\u529b\u7c7b\u578b\u66f4\u591a\u3002\u5728 Ubuntu 22.04 \/ 24.04 \u7684\u5b98\u65b9\u4ed3\u5e93\u4e2d\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5&#xff0c;\u65e0\u9700\u6dfb\u52a0\u7b2c\u4e09\u65b9\u6e90\u3002<\/p>\n<p>\u5173\u4e8e\u5b9e\u9a8c\u4e2d\u7684\u4e00\u4e2a\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u7ec6\u8282&#xff1a;Load Average \u7684\u53d8\u5316\u5e76\u4e0d\u662f\u5b9e\u65f6\u7684\u3002\u5373\u4fbf\u4f60\u7acb\u523b\u542f\u52a8\u9ad8\u8d1f\u8f7d&#xff0c;1 \u5206\u949f\u7684\u503c\u4e5f\u9700\u8981\u5927\u7ea6 1~2 \u5206\u949f\u624d\u4f1a\u663e\u8457\u4e0a\u5347&#xff0c;\u8fd9\u662f\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747\u7684\u7279\u6027\u51b3\u5b9a\u7684\u3002\u540c\u6837\u5730&#xff0c;\u8d1f\u8f7d\u6062\u590d\u6b63\u5e38\u540e&#xff0c;1 \u5206\u949f\u7684\u503c\u5927\u7ea6\u9700\u8981 1~2 \u5206\u949f\u624d\u80fd\u660e\u663e\u4e0b\u964d&#xff0c;5 \u5206\u949f\u548c 15 \u5206\u949f\u7684\u503c\u5219\u9700\u8981\u66f4\u957f\u65f6\u95f4\u3002<\/p>\n<p>\u5728\u771f\u5b9e\u7684\u6545\u969c\u5904\u7406\u4e2d&#xff0c;\u8fd9\u610f\u5473\u7740\u4e00\u4ef6\u4e8b&#xff1a;\u4f60\u770b\u5230\u8d1f\u8f7d\u9ad8&#xff0c;\u4e0d\u4ee3\u8868\u95ee\u9898\u73b0\u5728\u8fd8\u5728\u53d1\u751f\u3002\u53ef\u80fd\u6545\u969c\u8fdb\u7a0b\u5df2\u7ecf\u7ed3\u675f\u4e86&#xff0c;\u4f46 15 \u5206\u949f\u7684\u8d1f\u8f7d\u5747\u503c\u8fd8\u5728\u9ad8\u4f4d\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u8981\u4e09\u4e2a\u503c\u90fd\u770b&#xff0c;\u800c\u4e0d\u662f\u53ea\u770b\u4e00\u4e2a\u3002<\/p>\n<h3>\u4e5d\u3001\u6848\u4f8b\u4e09&#xff1a;\u751f\u4ea7\u73af\u5883\u4e2d\u7684 Load Average \u5f02\u5e38\u6392\u67e5<\/h3>\n<p>\u8fd9\u4e2a\u6848\u4f8b\u6a21\u62df\u7684\u662f\u6700\u63a5\u8fd1\u771f\u5b9e\u8fd0\u7ef4\u573a\u666f\u7684\u60c5\u51b5\u2014\u2014\u4e00\u53f0\u670d\u52a1\u5668\u7684\u76d1\u63a7\u544a\u8b66\u89e6\u53d1\u4e86&#xff0c;\u4f60\u901a\u8fc7 SSH \u767b\u5f55\u8fdb\u53bb&#xff0c;\u4ece\u96f6\u5f00\u59cb\u6392\u67e5 Load Average \u5f02\u5e38\u7684\u539f\u56e0\u3002<\/p>\n<h4>9.1 \u573a\u666f\u63cf\u8ff0<\/h4>\n<p>\u5047\u8bbe\u4f60\u6536\u5230\u544a\u8b66&#xff1a;\u67d0\u53f0 Ubuntu 22.04 \u670d\u52a1\u5668\u7684 Load Average \u89e6\u53d1\u4e86\u9608\u503c&#xff0c;15 \u5206\u949f\u5747\u503c\u8d85\u8fc7\u4e86 CPU \u6838\u5fc3\u6570\u7684 2 \u500d\u3002\u8fd9\u53f0\u670d\u52a1\u5668\u8fd0\u884c\u7740 Nginx &#043; Python Web \u5e94\u7528&#xff0c;\u5e73\u65f6 Load Average \u5728 0.5~1.0 \u4e4b\u95f4\u3002<\/p>\n<p>\u4f60\u7684\u76ee\u6807&#xff1a;\u627e\u51fa\u8d1f\u8f7d\u5347\u9ad8\u7684\u6839\u672c\u539f\u56e0&#xff0c;\u5224\u65ad\u662f\u5426\u9700\u8981\u7acb\u5373\u5e72\u9884\u3002<\/p>\n<h4>9.2 \u7b2c\u4e00\u6b65&#xff1a;\u786e\u8ba4\u8d1f\u8f7d\u60c5\u51b5<\/h4>\n<p>\u767b\u5f55\u670d\u52a1\u5668\u540e&#xff0c;\u7b2c\u4e00\u4ef6\u4e8b\u662f\u5feb\u901f\u786e\u8ba4\u5f53\u524d\u7684\u8d1f\u8f7d\u72b6\u6001&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u7b2c\u4e00\u773c&#xff1a;\u67e5\u770b\u5f53\u524d\u8d1f\u8f7d\u548c\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4<\/span><br \/>\n<span class=\"token function\">uptime<\/span><\/p>\n<p> 16:30:22 up 35 days,  2:14,  1 user,  load average: 14.23, 12.87, 9.41<\/p>\n<p><span class=\"token comment\"># \u786e\u8ba4 CPU \u6838\u5fc3\u6570&#xff0c;\u5efa\u7acb\u5224\u65ad\u57fa\u51c6<\/span><br \/>\nnproc<\/p>\n<p>4<\/p>\n<p>\u6570\u5b66\u8ba1\u7b97&#xff1a;14.23 \/ 4 &#061; 3.56&#xff0c;\u662f CPU \u5bb9\u91cf\u7684 3.56 \u500d&#xff0c;\u8fd9\u662f\u4e25\u91cd\u8fc7\u8f7d\u72b6\u6001\u3002<\/p>\n<p>\u4ece\u4e09\u4e2a\u503c\u7684\u8d8b\u52bf\u6765\u770b&#xff1a;1 \u5206\u949f &gt; 5 \u5206\u949f &gt; 15 \u5206\u949f&#xff0c;\u800c\u4e14 1 \u5206\u949f\u7684\u503c\u660e\u663e\u66f4\u9ad8&#xff0c;\u8bf4\u660e\u95ee\u9898\u662f\u5728\u6700\u8fd1\u7a81\u7136\u6076\u5316\u7684&#xff0c;\u4e0d\u662f\u4e00\u4e2a\u7f13\u6162\u79ef\u7d2f\u7684\u8d8b\u52bf\u3002\u8fd9\u4e2a\u4fe1\u606f\u5f88\u91cd\u8981&#xff0c;\u610f\u5473\u7740\u53ef\u80fd\u6709\u67d0\u4e2a\u8fdb\u7a0b\u6216\u4efb\u52a1\u7a81\u7136\u53d1\u8d77\u4e86\u3002<\/p>\n<h4>9.3 \u7b2c\u4e8c\u6b65&#xff1a;\u5224\u65ad\u662f CPU \u578b\u8fd8\u662f I\/O \u578b<\/h4>\n<p><span class=\"token comment\"># \u67e5\u770b CPU \u4f7f\u7528\u7387\u7ec6\u5206&#xff0c;\u91cd\u70b9\u770b id \u548c wa<\/span><br \/>\n<span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-b<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-5<\/span><\/p>\n<p>top &#8211; 16:30:25 up 35 days,  2:14,  1 user,  load average: 14.31, 12.89, 9.44<br \/>\nTasks: 387 total,  12 running, 364 sleeping,   0 stopped,   1 zombie<br \/>\n%Cpu(s):  8.2 us, 15.1 sy,  0.0 ni, 15.3 id, 61.2 wa,  0.0 hi,  0.2 si<br \/>\nMiB Mem :   7852.4 total,    312.4 free,   5124.8 used,   2415.2 buff\/cache<br \/>\nMiB Swap:   2048.0 total,    512.3 free,   1535.7 used.    823.2 avail Mem<\/p>\n<p>\u8fd9\u4e2a\u8f93\u51fa\u975e\u5e38\u80fd\u8bf4\u660e\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>id&#xff08;\u7a7a\u95f2&#xff09;\u53ea\u6709 15.3%&#xff0c;\u8bf4\u660e CPU \u786e\u5b9e\u6709\u538b\u529b<\/li>\n<li>wa&#xff08;iowait&#xff09;\u9ad8\u8fbe 61.2%&#xff0c;CPU \u6709\u5927\u91cf\u65f6\u95f4\u5728\u7b49\u5f85 I\/O<\/li>\n<li>us &#043; sy \u52a0\u8d77\u6765\u53ea\u6709 23.3%&#xff0c;\u5b9e\u9645\u8fd0\u7b97\u4e0d\u591a<\/li>\n<li>\u5185\u5b58\u4f7f\u7528\u4e86\u5927\u91cf Swap&#xff08;\u5df2\u7528 1535MB&#xff09;&#xff0c;\u8bf4\u660e\u7269\u7406\u5185\u5b58\u53ef\u80fd\u4e0d\u591f\u7528\u4e86<\/li>\n<\/ul>\n<p>\u7ed3\u8bba&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u5178\u578b\u7684 I\/O \u5bc6\u96c6\u578b\u9ad8\u8d1f\u8f7d\u95ee\u9898&#xff0c;\u5f88\u53ef\u80fd\u4f34\u968f\u7740\u5185\u5b58\u538b\u529b\u5bfc\u81f4\u7684\u5927\u91cf Swap \u4ea4\u6362\u3002<\/p>\n<p>\u8fd8\u9700\u8981\u6ce8\u610f Tasks \u884c&#xff1a;12 running \u5728 4 \u6838\u673a\u5668\u4e0a\u610f\u5473\u7740\u6709 12 \u4e2a\u8fdb\u7a0b\u5728\u7ade\u4e89 CPU&#xff0c;\u8fd9\u6b63\u662f Load Average \u9ad8\u8fbe 14 \u7684\u4e3b\u8981\u539f\u56e0\u4e4b\u4e00\u3002\u53e6\u5916\u6709 1 zombie&#xff0c;\u8fd9\u662f\u4e2a\u5c0f\u95ee\u9898&#xff0c;\u540e\u9762\u53ef\u4ee5\u5355\u72ec\u5904\u7406&#xff08;\u89c1\u672c\u4e13\u680f\u7b2c9\u8282&#xff09;\u3002<\/p>\n<h4>9.4 \u7b2c\u4e09\u6b65&#xff1a;\u627e\u51fa\u5177\u4f53\u8fdb\u7a0b<\/h4>\n<p>\u73b0\u5728\u77e5\u9053\u662f I\/O \u95ee\u9898\u4e86&#xff0c;\u9700\u8981\u8fdb\u4e00\u6b65\u5b9a\u4f4d\u5230\u5177\u4f53\u662f\u54ea\u4e9b\u8fdb\u7a0b\u5728\u6d88\u8017 I\/O \u8d44\u6e90&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b D \u72b6\u6001&#xff08;\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff09;\u7684\u8fdb\u7a0b&#xff0c;\u8fd9\u4e9b\u662f I\/O \u7b49\u5f85\u7684\u76f4\u63a5\u4f53\u73b0<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-eo<\/span> pid,ppid,stat,pcpu,pmem,comm <span class=\"token parameter variable\">&#8211;sort<\/span><span class=\"token operator\">&#061;<\/span>stat <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token string\">&#039;^.\\\\{0,30\\\\}D&#039;<\/span><\/p>\n<p>\u6216\u8005\u66f4\u76f4\u89c2\u7684\u65b9\u5f0f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6240\u6709 D \u72b6\u6001\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f<\/span><br \/>\n<span class=\"token function\">ps<\/span> aux <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;NR&#061;&#061;1 || $8 ~ \/^D\/ {print}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-20<\/span><\/p>\n<p>USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND<br \/>\nwww-data  3842  0.0  2.1 256432 83124 ?        D    14:22   0:08 python3 app.py<br \/>\nwww-data  3843  0.0  2.0 254122 81044 ?        D    14:22   0:07 python3 app.py<br \/>\nwww-data  3844  0.1  2.1 256892 83344 ?        D    14:22   0:09 python3 app.py<br \/>\n&#8230;&#xff08;\u7c7b\u4f3c\u7684\u8fdb\u7a0b\u6709 8-10 \u4e2a&#xff09;<\/p>\n<p>\u627e\u5230\u4e86&#xff1a;\u6709\u5927\u91cf Python \u5e94\u7528\u8fdb\u7a0b\u5904\u4e8e D \u72b6\u6001\u3002\u63a5\u4e0b\u6765\u7528 iostat \u786e\u8ba4 I\/O \u72b6\u6001&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u78c1\u76d8 I\/O \u7edf\u8ba1&#xff0c;\u6bcf 2 \u79d2\u5237\u65b0\u4e00\u6b21&#xff0c;\u5171\u770b 3 \u6b21<\/span><br \/>\n<span class=\"token comment\"># -x&#xff1a;\u663e\u793a\u6269\u5c55\u7edf\u8ba1<\/span><br \/>\n<span class=\"token comment\"># -d&#xff1a;\u53ea\u663e\u793a\u78c1\u76d8\u7edf\u8ba1&#xff08;\u4e0d\u663e\u793a CPU&#xff09;<\/span><br \/>\niostat <span class=\"token parameter variable\">-xd<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">3<\/span><\/p>\n<p>Device            r\/s     w\/s    rkB\/s    wkB\/s   await  r_await  w_await  svctm  %util<br \/>\nsda              45.2   312.8   1824.4   9847.2   186.4    12.3    215.7    2.8   100.0<\/p>\n<p>%util \u4e3a 100%&#xff0c;\u8bf4\u660e\u78c1\u76d8\u5df2\u7ecf\u6ee1\u8d1f\u8377&#xff0c;await&#xff08;\u5e73\u5747 I\/O \u7b49\u5f85\u65f6\u95f4&#xff09;\u9ad8\u8fbe 186ms&#xff0c;\u6b63\u5e38\u60c5\u51b5\u4e0b\u8fd9\u4e2a\u503c\u5e94\u8be5\u5728\u51e0\u6beb\u79d2\u4ee5\u5185\u3002\u78c1\u76d8\u662f\u660e\u786e\u7684\u74f6\u9888\u3002<\/p>\n<h4>9.5 \u7b2c\u56db\u6b65&#xff1a;\u6df1\u5165\u5206\u6790<\/h4>\n<p>\u78c1\u76d8\u6ee1\u8d1f\u8377\u7684\u539f\u56e0\u53ef\u80fd\u6709\u591a\u79cd&#xff1a;\u5e94\u7528\u65e5\u5fd7\u75af\u72c2\u5199\u5165\u3001\u67d0\u4e2a\u5927\u578b\u6587\u4ef6\u64cd\u4f5c\u3001\u6570\u636e\u5e93\u5728\u505a\u5927\u91cf\u5199\u5165\u2026\u2026\u6211\u4eec\u9700\u8981\u8fdb\u4e00\u6b65\u786e\u8ba4&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u662f\u54ea\u4e9b\u8fdb\u7a0b\u4ea7\u751f\u4e86\u6700\u591a\u7684 I\/O&#xff08;\u9700\u8981 root \u6743\u9650&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> iotop <span class=\"token parameter variable\">-b<\/span> <span class=\"token parameter variable\">-o<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">3<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">||<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> iotop <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> iotop <span class=\"token parameter variable\">-b<\/span> <span class=\"token parameter variable\">-o<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">3<\/span><\/p>\n<p>\u5982\u679c iotop \u4e0d\u53ef\u7528&#xff0c;\u4e5f\u53ef\u4ee5\u7528 pidstat&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u7528 pidstat \u67e5\u770b\u5404\u8fdb\u7a0b\u7684 I\/O \u7edf\u8ba1<\/span><br \/>\n<span class=\"token comment\"># -d&#xff1a;\u663e\u793a I\/O \u7edf\u8ba1<\/span><br \/>\n<span class=\"token comment\"># 2 3&#xff1a;\u6bcf 2 \u79d2\u91c7\u6837\u4e00\u6b21&#xff0c;\u5171 3 \u6b21<\/span><br \/>\npidstat <span class=\"token parameter variable\">-d<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">3<\/span><\/p>\n<p>16:31:42      UID       PID   kB_rd\/s   kB_wr\/s kB_ccwr\/s  Command<br \/>\n16:31:44     1000      3842      0.00   4823.45      0.00  python3<br \/>\n16:31:44     1000      3843      0.00   4721.33      0.00  python3<br \/>\n&#8230;<\/p>\n<p>Python \u5e94\u7528\u5728\u75af\u72c2\u5199\u78c1\u76d8\u3002\u7ed3\u5408\u4e4b\u524d\u770b\u5230\u7684\u5185\u5b58\u4e0d\u8db3&#xff08;\u5927\u91cf\u4f7f\u7528 Swap&#xff09;&#xff0c;\u73b0\u5728\u53ef\u4ee5\u63a8\u65ad\u51fa\u539f\u56e0\u94fe&#xff1a;<\/p>\n<p>\u63a8\u65ad\u539f\u56e0\u94fe&#xff1a;\u5185\u5b58\u4f7f\u7528\u91cf\u8d85\u51fa\u7269\u7406\u5185\u5b58 \u2192 \u7cfb\u7edf\u5f00\u59cb\u5927\u91cf\u4f7f\u7528 Swap&#xff08;\u5c06\u5185\u5b58\u6570\u636e\u6362\u51fa\u5230\u78c1\u76d8&#xff09;\u2192 \u78c1\u76d8 I\/O \u5927\u5e45\u589e\u52a0 \u2192 \u5e94\u7528\u8fdb\u7a0b\u7b49\u5f85\u78c1\u76d8\u64cd\u4f5c&#xff0c;\u8fdb\u5165 D \u72b6\u6001 \u2192 Load Average \u98d9\u5347<\/p>\n<p><span class=\"token comment\"># \u8fdb\u4e00\u6b65\u786e\u8ba4\u5185\u5b58\u548c Swap \u7684\u4f7f\u7528\u60c5\u51b5<\/span><br \/>\n<span class=\"token function\">free<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p>              total        used        free      shared  buff\/cache   available<br \/>\nMem:           7.7G        6.9G        312M        234M        522M        312M<br \/>\nSwap:          2.0G        1.5G        512M<\/p>\n<p>\u786e\u8ba4&#xff1a;\u7269\u7406\u5185\u5b58\u51e0\u4e4e\u8017\u5c3d&#xff0c;Swap \u5df2\u7528\u4e86 75%\u3002\u8fd9\u662f\u4e00\u4e2a\u5178\u578b\u7684\u5185\u5b58\u6cc4\u6f0f\u6216\u5185\u5b58\u914d\u7f6e\u4e0d\u8db3\u5bfc\u81f4\u7684\u8fde\u9501\u6545\u969c\u3002<\/p>\n<p><span class=\"token comment\"># \u6309\u5185\u5b58\u4f7f\u7528\u91cf\u6392\u5e8f&#xff0c;\u627e\u51fa\u5185\u5b58\u6d88\u8017\u6700\u5927\u7684\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> aux <span class=\"token parameter variable\">&#8211;sort<\/span><span class=\"token operator\">&#061;<\/span>-%mem <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-15<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u67d0\u4e2a\u5177\u4f53\u8fdb\u7a0b\u7684\u5185\u5b58\u4f7f\u7528\u8be6\u60c5&#xff08;\u66ff\u6362 3842 \u4e3a\u5b9e\u9645 PID&#xff09;<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/proc\/3842\/status <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token string\">&#039;VmRSS|VmSwap|VmSize&#039;<\/span><\/p>\n<h4>9.6 \u547d\u4ee4\u89e3\u6790\u4e0e\u6392\u67e5\u601d\u8def\u603b\u7ed3<\/h4>\n<p>\u8fd9\u4e2a\u6848\u4f8b\u8d70\u5b8c\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684\u6392\u67e5\u6d41\u7a0b&#xff0c;\u80cc\u540e\u7684\u601d\u8def\u503c\u5f97\u603b\u7ed3\u4e00\u4e0b&#xff1a;<\/p>\n<p>\u6392\u67e5\u7684\u6838\u5fc3\u539f\u5219\u662f&#034;\u9010\u6b65\u7f29\u5c0f\u8303\u56f4&#034;\u3002\u4ece\u7cfb\u7edf\u6574\u4f53\u72b6\u6001&#xff08;uptime&#xff09;\u2192 \u8d44\u6e90\u7c7b\u578b\u5224\u65ad&#xff08;top \u7684 wa\u3001id&#xff09;\u2192 \u8fdb\u7a0b\u72b6\u6001\u786e\u8ba4&#xff08;ps \u7684 D \u72b6\u6001&#xff09;\u2192 I\/O \u5b50\u7cfb\u7edf\u8be6\u60c5&#xff08;iostat&#xff09;\u2192 \u5177\u4f53\u8fdb\u7a0b\u7684 I\/O \u884c\u4e3a&#xff08;pidstat\/iotop&#xff09;\u2192 \u6839\u672c\u539f\u56e0&#xff08;\u5185\u5b58\u4e0d\u8db3\u5bfc\u81f4 Swap \u98ce\u66b4&#xff09;\u3002<\/p>\n<p>\u6bcf\u4e00\u6b65\u7684\u7ed3\u8bba\u90fd\u662f\u4e0b\u4e00\u6b65\u7684\u524d\u63d0\u3002\u5982\u679c\u4f60\u4e00\u5f00\u59cb\u5c31\u53bb\u770b\u67d0\u4e2a\u5177\u4f53\u8fdb\u7a0b\u7684\u65e5\u5fd7&#xff0c;\u53ef\u80fd\u5b8c\u5168\u627e\u4e0d\u5230\u65b9\u5411\u2014\u2014\u56e0\u4e3a\u95ee\u9898\u6839\u672c\u4e0d\u5728\u65e5\u5fd7\u91cc&#xff0c;\u5728\u5185\u5b58\u914d\u7f6e\u4e0a\u3002<\/p>\n<p>\u76f8\u5173\u793a\u610f\u56fe\u7ed8\u5236\u5982\u4e0b&#xff0c;\u4ec5\u4f9b\u5927\u5bb6\u4fdd\u5b58\u67e5\u9605&#xff1a;<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025716-6ae1648ce2c3f.png\" \/> <\/p>\n<h3>\u5341\u3001Load Average \u7684\u8ba1\u7b97\u539f\u7406<\/h3>\n<p>\u7406\u89e3\u4e86&#034;\u662f\u4ec0\u4e48&#034;\u548c&#034;\u600e\u4e48\u7528&#034;&#xff0c;\u6211\u4eec\u6765\u7a0d\u5fae\u6df1\u5165\u4e00\u4e0b\u539f\u7406\u3002\u4e0d\u9700\u8981\u4f60\u53bb\u8bfb\u5185\u6838\u6e90\u7801&#xff0c;\u4f46\u77e5\u9053\u8fd9\u4e2a\u673a\u5236&#xff0c;\u4f1a\u5e2e\u52a9\u4f60\u7406\u89e3 Load Average \u7684\u4e00\u4e9b&#034;\u53cd\u76f4\u89c9&#034;\u884c\u4e3a\u3002<\/p>\n<h4>10.1 \u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747<\/h4>\n<p>Linux \u5185\u6838\u6bcf 5 \u79d2\u5bf9\u6d3b\u8dc3\u8fdb\u7a0b\u6570\u505a\u4e00\u6b21\u91c7\u6837&#xff0c;\u7136\u540e\u7528\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747&#xff08;Exponentially Weighted Moving Average, EWMA&#xff09;\u7b97\u6cd5\u6765\u8ba1\u7b97 Load Average\u3002<\/p>\n<p>EWMA \u7684\u7279\u70b9\u662f&#xff1a;\u8d8a\u8fd1\u7684\u91c7\u6837\u6743\u91cd\u8d8a\u5927&#xff0c;\u8d8a\u8fdc\u7684\u91c7\u6837\u6743\u91cd\u8d8a\u5c0f&#xff0c;\u4f46\u5386\u53f2\u6570\u636e\u6c38\u8fdc\u4e0d\u4f1a\u88ab\u5b8c\u5168\u4e22\u5f03&#xff0c;\u53ea\u662f\u6743\u91cd\u8d8a\u6765\u8d8a\u5c0f\u3002<\/p>\n<p>\u4e09\u4e2a\u65f6\u95f4\u7a97\u53e3\u5bf9\u5e94\u4e09\u4e2a\u8870\u51cf\u7cfb\u6570&#xff1a;<\/p>\n<table>\n<tr>\u65f6\u95f4\u7a97\u53e3\u8870\u51cf\u7cfb\u6570&#xff08;\u8fd1\u4f3c&#xff09;\u534a\u8870\u671f&#xff08;\u8fd1\u4f3c&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>1 \u5206\u949f<\/td>\n<td>0.9200<\/td>\n<td>~46 \u79d2<\/td>\n<\/tr>\n<tr>\n<td>5 \u5206\u949f<\/td>\n<td>0.9835<\/td>\n<td>~4 \u5206\u949f<\/td>\n<\/tr>\n<tr>\n<td>15 \u5206\u949f<\/td>\n<td>0.9945<\/td>\n<td>~12 \u5206\u949f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#034;\u534a\u8870\u671f&#034;\u7684\u610f\u601d\u662f&#xff1a;\u4e00\u4e2a\u7a81\u7136\u53d1\u751f\u7684\u8d1f\u8f7d\u5cf0\u503c&#xff0c;\u7ecf\u8fc7\u8fd9\u6bb5\u65f6\u95f4\u540e&#xff0c;\u5b83\u5bf9 Load Average \u7684\u8d21\u732e\u4f1a\u8870\u51cf\u5230\u539f\u6765\u7684\u4e00\u534a\u3002<\/p>\n<p>\u8fd9\u89e3\u91ca\u4e86\u4e00\u4e2a\u5e38\u89c1\u73b0\u8c61&#xff1a;\u4f60\u521a\u521a kill \u4e86\u4e00\u4e2a\u5360\u7528\u5927\u91cf\u8d44\u6e90\u7684\u8fdb\u7a0b&#xff0c;1 \u5206\u949f\u8d1f\u8f7d\u5dee\u4e0d\u591a\u8981 1~2 \u5206\u949f\u624d\u4f1a\u660e\u663e\u4e0b\u964d&#xff0c;\u800c 15 \u5206\u949f\u8d1f\u8f7d\u53ef\u80fd\u8981\u5341\u51e0\u5206\u949f\u624d\u80fd\u6062\u590d\u5230\u6b63\u5e38\u6c34\u5e73\u3002\u8fd9\u4e0d\u662f kill \u6ca1\u751f\u6548&#xff0c;\u800c\u662f EWMA \u7b97\u6cd5\u7684\u6b63\u5e38\u884c\u4e3a\u3002<\/p>\n<h4>10.2 \u4e3a\u4ec0\u4e48 1 \u5206\u949f\u548c 15 \u5206\u949f\u7684\u503c\u5dee\u5f02\u91cd\u8981<\/h4>\n<p>\u4e09\u4e2a Load Average \u503c\u4e4b\u95f4\u7684\u76f8\u5bf9\u5173\u7cfb\u662f\u975e\u5e38\u6709\u4ef7\u503c\u7684\u4fe1\u53f7&#xff1a;<\/p>\n<p>\u60c5\u51b5\u4e00&#xff1a;1 \u5206\u949f &gt;&gt; 5 \u5206\u949f \u2248 15 \u5206\u949f<\/p>\n<p>load average: 8.24, 1.32, 1.15<\/p>\n<p>\u8d1f\u8f7d\u662f\u7a81\u7136\u5347\u9ad8\u7684&#xff0c;\u521a\u521a\u53d1\u751f\u4e86\u67d0\u4e2a\u9ad8\u8d1f\u8f7d\u4e8b\u4ef6\u3002\u8fd9\u53ef\u80fd\u662f\u67d0\u4e2a\u6279\u91cf\u4efb\u52a1\u542f\u52a8\u4e86&#xff0c;\u6216\u8005\u67d0\u4e2a\u8bf7\u6c42\u5cf0\u503c\u5230\u6765\u4e86&#xff0c;\u6216\u8005\u67d0\u4e2a\u8fdb\u7a0b\u7a81\u7136\u5931\u63a7\u3002\u9700\u8981\u7acb\u5373\u5173\u6ce8&#xff0c;\u4f46\u4e5f\u53ef\u80fd\u53ea\u662f\u4e00\u4e2a\u77ed\u6682\u7684\u5c16\u5cf0\u3002<\/p>\n<p>\u60c5\u51b5\u4e8c&#xff1a;1 \u5206\u949f&#xffa0;\u2248 5 \u5206\u949f \u2248 15 \u5206\u949f&#xff08;\u90fd\u5f88\u9ad8&#xff09;<\/p>\n<p>load average: 12.3, 11.8, 12.1<\/p>\n<p>\u8d1f\u8f7d\u6301\u7eed\u9ad8\u4f4d\u8fd0\u884c\u4e86\u5f88\u957f\u65f6\u95f4&#xff0c;\u7cfb\u7edf\u957f\u671f\u5904\u4e8e\u8fc7\u8f7d\u72b6\u6001\u3002\u8fd9\u662f\u6700\u9700\u8981\u7d27\u6025\u5904\u7406\u7684\u60c5\u51b5&#xff0c;\u610f\u5473\u7740\u4e0d\u662f\u5076\u53d1\u5cf0\u503c&#xff0c;\u800c\u662f\u6301\u7eed\u6027\u7684\u8d44\u6e90\u4e0d\u8db3\u3002<\/p>\n<p>\u60c5\u51b5\u4e09&#xff1a;1 \u5206\u949f &lt;&lt; 5 \u5206\u949f \u2248 15 \u5206\u949f<\/p>\n<p>load average: 0.82, 5.43, 6.12<\/p>\n<p>\u9ad8\u8d1f\u8f7d\u521a\u521a\u7ed3\u675f&#xff0c;\u7cfb\u7edf\u6b63\u5728\u6062\u590d\u4e2d\u3002\u53ef\u80fd\u4f60\u4e4b\u524d\u7684\u67d0\u4e2a\u5904\u7406\u64cd\u4f5c\u5df2\u7ecf\u89c1\u6548\u4e86&#xff0c;\u4e5f\u53ef\u80fd\u662f\u9ad8\u8d1f\u8f7d\u4efb\u52a1\u81ea\u7136\u7ed3\u675f\u4e86\u3002\u7ee7\u7eed\u89c2\u5bdf&#xff0c;\u786e\u8ba4 1 \u5206\u949f\u7684\u503c\u80fd\u7a33\u5b9a\u4e0b\u6765\u3002<\/p>\n<p>\u60c5\u51b5\u56db&#xff1a;\u4e09\u4e2a\u503c\u90fd\u5f88\u4f4e<\/p>\n<p>load average: 0.12, 0.18, 0.21<\/p>\n<p>\u7cfb\u7edf\u975e\u5e38\u7a7a\u95f2&#xff0c;\u4e0d\u9700\u8981\u62c5\u5fc3\u3002\u8fd9\u662f\u6b63\u5e38\u7684\u670d\u52a1\u5668\u7a7a\u95f2\u72b6\u6001\u3002<\/p>\n<h3>\u5341\u4e00\u3001Load Average \u4e0e\u5176\u4ed6\u76d1\u63a7\u6307\u6807\u7684\u8054\u5408\u5206\u6790<\/h3>\n<p>Load Average \u5355\u72ec\u770b\u662f\u4e00\u4e2a\u5f88\u7c97\u7cd9\u7684\u4fe1\u53f7&#xff0c;\u5b83\u53ea\u544a\u8bc9\u4f60&#034;\u7cfb\u7edf\u6709\u538b\u529b&#034;&#xff0c;\u4f46\u4e0d\u544a\u8bc9\u4f60\u538b\u529b\u6765\u81ea\u54ea\u91cc\u3002\u771f\u6b63\u6709\u4ef7\u503c\u7684\u5224\u65ad&#xff0c;\u603b\u662f\u628a\u5b83\u548c\u5176\u4ed6\u6307\u6807\u8054\u5408\u8d77\u6765\u770b\u7684\u3002<\/p>\n<h4>11.1 \u7ed3\u5408 CPU \u4f7f\u7528\u7387<\/h4>\n<p><span class=\"token comment\"># \u7528 vmstat \u540c\u65f6\u770b\u8d1f\u8f7d\u548c CPU \u4f7f\u7528\u60c5\u51b5<\/span><br \/>\n<span class=\"token comment\"># 1&#xff1a;\u6bcf 1 \u79d2\u91c7\u6837\u4e00\u6b21<\/span><br \/>\n<span class=\"token comment\"># 5&#xff1a;\u5171\u91c7\u6837 5 \u6b21<\/span><br \/>\n<span class=\"token function\">vmstat<\/span> <span class=\"token number\">1<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>procs &#8212;&#8212;&#8212;&#8211;memory&#8212;&#8212;&#8212;- &#8212;swap&#8211; &#8212;&#8211;io&#8212;- -system&#8211; &#8212;&#8212;cpu&#8212;&#8211;<br \/>\n r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st<br \/>\n 3  1 1572864 318924  12184 2482644  124  256  4832 12441 1843 3254  8 15 15 62  0<br \/>\n 2  2 1572864 312344  12184 2482644  132  248  5124 13284 1923 3382  7 16 14 63  0<\/p>\n<p>vmstat \u7684\u8f93\u51fa\u5f88\u5bc6\u96c6&#xff0c;\u4f46\u5173\u952e\u5b57\u6bb5\u662f&#xff1a;<\/p>\n<ul>\n<li>r&#xff1a;\u5904\u4e8e R \u72b6\u6001&#xff08;\u5c31\u7eea\/\u8fd0\u884c&#xff09;\u7684\u8fdb\u7a0b\u6570&#xff0c;\u8fd9\u662f Load Average \u7684&#034;CPU \u90e8\u5206&#034;<\/li>\n<li>b&#xff1a;\u5904\u4e8e D \u72b6\u6001&#xff08;\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff09;\u7684\u8fdb\u7a0b\u6570&#xff0c;\u8fd9\u662f Load Average \u7684&#034;I\/O \u90e8\u5206&#034;<\/li>\n<li>wa&#xff1a;CPU iowait \u767e\u5206\u6bd4<\/li>\n<li>si \/ so&#xff1a;\u6bcf\u79d2 Swap \u8bfb\u5165 \/ \u5199\u51fa\u7684\u91cf&#xff08;KB&#xff09;&#xff0c;\u5982\u679c\u8fd9\u4e2a\u503c\u6301\u7eed\u975e\u96f6&#xff0c;\u8bf4\u660e\u6709 Swap \u98ce\u66b4<\/li>\n<\/ul>\n<p>vmstat \u7684 r &#043; b \u5c31\u662f\u5927\u81f4\u7684\u5f53\u524d\u6d3b\u8dc3\u8fdb\u7a0b\u6570&#xff0c;\u548c Load Average \u6709\u5f88\u5f3a\u7684\u5bf9\u5e94\u5173\u7cfb&#xff08;Load Average \u662f\u8fd9\u4e2a\u7684\u65f6\u95f4\u52a0\u6743\u5e73\u5747&#xff09;\u3002<\/p>\n<h4>11.2 \u7ed3\u5408\u5185\u5b58\u4f7f\u7528\u7387<\/h4>\n<p><span class=\"token comment\"># \u67e5\u770b\u5185\u5b58\u4f7f\u7528\u8be6\u60c5<\/span><br \/>\n<span class=\"token function\">free<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u66f4\u8be6\u7ec6\u7684\u5185\u5b58\u7edf\u8ba1&#xff08;\u76f4\u63a5\u8bfb\u53d6\u5185\u6838\u6570\u636e&#xff09;<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/proc\/meminfo <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token string\">&#039;MemTotal|MemFree|MemAvailable|SwapTotal|SwapFree|Dirty|Writeback&#039;<\/span><\/p>\n<p>MemTotal:        8040512 kB<br \/>\nMemFree:          318924 kB<br \/>\nMemAvailable:     843256 kB<br \/>\nSwapTotal:       2097148 kB<br \/>\nSwapFree:         524288 kB<br \/>\nDirty:            124832 kB    \u2190 \u5f85\u5199\u5165\u78c1\u76d8\u7684\u810f\u9875&#xff0c;\u503c\u5f88\u9ad8\u8bf4\u660e\u6709\u5927\u91cf\u5199\u5165\u7b49\u5f85<br \/>\nWriteback:         23456 kB    \u2190 \u6b63\u5728\u56de\u5199\u78c1\u76d8\u7684\u6570\u636e<\/p>\n<p>Dirty \u503c\u5982\u679c\u6301\u7eed\u5f88\u9ad8&#xff08;\u6bd4\u5982\u8d85\u8fc7\u51e0\u767e MB&#xff09;&#xff0c;\u8bf4\u660e\u6709\u5927\u91cf\u6570\u636e\u5728\u7b49\u5f85\u5199\u5165\u78c1\u76d8&#xff0c;\u8fd9\u4f1a\u5bfc\u81f4 I\/O \u538b\u529b\u589e\u5927&#xff0c;\u8fdb\u800c\u63a8\u9ad8 Load Average \u4e2d\u7684 D \u72b6\u6001\u8fdb\u7a0b\u6570\u91cf\u3002<\/p>\n<h4>11.3 \u7ed3\u5408 I\/O \u72b6\u6001<\/h4>\n<p><span class=\"token comment\"># \u67e5\u770b\u5404\u78c1\u76d8\u8bbe\u5907\u7684\u8be6\u7ec6 I\/O \u7edf\u8ba1<\/span><br \/>\niostat <span class=\"token parameter variable\">-xd<\/span> <span class=\"token number\">1<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>\u91cd\u70b9\u5173\u6ce8\u7684\u5b57\u6bb5&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bb5\u542b\u4e49\u5f02\u5e38\u9608\u503c\u53c2\u8003<\/tr>\n<tbody>\n<tr>\n<td>%util<\/td>\n<td>\u78c1\u76d8\u4f7f\u7528\u7387<\/td>\n<td>&gt; 80% \u9700\u8981\u5173\u6ce8&#xff0c;\u63a5\u8fd1 100% \u57fa\u672c\u9971\u548c<\/td>\n<\/tr>\n<tr>\n<td>await<\/td>\n<td>\u5e73\u5747 I\/O \u7b49\u5f85\u65f6\u95f4&#xff08;ms&#xff09;<\/td>\n<td>HDD &gt; 20ms&#xff0c;SSD &gt; 2ms \u9700\u8981\u5173\u6ce8<\/td>\n<\/tr>\n<tr>\n<td>r\/s \/ w\/s<\/td>\n<td>\u6bcf\u79d2\u8bfb\/\u5199\u8bf7\u6c42\u6570<\/td>\n<td>\u53d6\u51b3\u4e8e\u8bbe\u5907\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td>rkB\/s \/ wkB\/s<\/td>\n<td>\u6bcf\u79d2\u8bfb\/\u5199\u6570\u636e\u91cf&#xff08;KB&#xff09;<\/td>\n<td>\u5bf9\u6bd4\u8bbe\u5907\u7684\u7406\u8bba\u5e26\u5bbd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>11.4 \u7ed3\u5408\u8fdb\u7a0b\u72b6\u6001<\/h4>\n<p><span class=\"token comment\"># \u5168\u9762\u67e5\u770b\u8fdb\u7a0b\u72b6\u6001\u5206\u5e03<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-eo<\/span> <span class=\"token function\">stat<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">uniq<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token parameter variable\">-rn<\/span><\/p>\n<p>    298 Ss    \u2190 \u53ef\u4e2d\u65ad\u7761\u7720&#xff08;\u540e\u53f0\u670d\u52a1&#xff0c;\u7b49\u5f85\u4e8b\u4ef6&#xff09;&#xff0c;\u6b63\u5e38<br \/>\n     42 S     \u2190 \u53ef\u4e2d\u65ad\u7761\u7720<br \/>\n     12 R     \u2190 \u8fd0\u884c\/\u5c31\u7eea&#xff0c;\u8ba1\u5165 Load Average<br \/>\n      8 D     \u2190 \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff0c;\u8ba1\u5165 Load Average&#xff0c;\u9700\u8981\u5173\u6ce8<br \/>\n      1 Z     \u2190 \u50f5\u5c38\u8fdb\u7a0b<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7ed9\u4e86\u4f60\u4e00\u4e2a\u6e05\u6670\u7684\u8fdb\u7a0b\u72b6\u6001\u5206\u5e03\u5feb\u7167\u3002\u5728\u6392\u67e5 Load Average \u5f02\u5e38\u65f6&#xff0c;\u5173\u6ce8 R \u548c D \u7684\u6570\u91cf\u3002<\/p>\n<h3>\u5341\u4e8c\u3001\u6838\u5fc3\u547d\u4ee4\u4e0e\u5de5\u5177\u6c47\u603b\u89e3\u6790<\/h3>\n<h4>12.1 uptime<\/h4>\n<p><span class=\"token comment\"># \u57fa\u7840\u7528\u6cd5<\/span><br \/>\n<span class=\"token function\">uptime<\/span><\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u683c\u5f0f\u793a\u4f8b<\/span><br \/>\n<span class=\"token comment\"># 16:42:07 up 35 days, 2:14,  1 user,  load average: 1.52, 1.34, 0.98<\/span><\/p>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u767b\u5f55\u670d\u52a1\u5668\u540e\u7684\u7b2c\u4e00\u773c\u68c0\u67e5&#xff0c;\u811a\u672c\u4e2d\u7684\u5feb\u901f\u76d1\u63a7\u68c0\u6d4b\u3002<\/p>\n<p>uptime \u7684\u4f18\u70b9\u662f\u65e0\u9700\u989d\u5916\u5b89\u88c5&#xff0c;\u51e0\u4e4e\u5728\u6240\u6709 Linux \u53d1\u884c\u7248\u4e0a\u90fd\u6709&#xff0c;\u8f93\u51fa\u7b80\u6d01&#xff0c;\u4e00\u884c\u5b8c\u6210\u3002\u7f3a\u70b9\u662f\u65e0\u6cd5\u6301\u7eed\u5237\u65b0&#xff0c;\u53ea\u662f\u4e00\u4e2a\u5feb\u7167\u3002<\/p>\n<h4>12.2 top \/ htop<\/h4>\n<p><span class=\"token comment\"># \u57fa\u7840 top&#xff08;\u6309 q \u9000\u51fa&#xff09;<\/span><br \/>\n<span class=\"token function\">top<\/span><\/p>\n<p><span class=\"token comment\"># top \u4e00\u6b21\u6027\u8f93\u51fa&#xff08;\u9002\u5408\u811a\u672c\u4f7f\u7528&#xff0c;\u4e0d\u8fdb\u5165\u4ea4\u4e92\u754c\u9762&#xff09;<\/span><br \/>\n<span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-b<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">1<\/span><\/p>\n<p><span class=\"token comment\"># \u6307\u5b9a\u5237\u65b0\u95f4\u9694&#xff08;3 \u79d2\u5237\u65b0\u4e00\u6b21&#xff09;<\/span><br \/>\n<span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-d<\/span> <span class=\"token number\">3<\/span><\/p>\n<p><span class=\"token comment\"># htop&#xff08;\u9700\u8981\u5b89\u88c5&#xff09;<\/span><br \/>\n<span class=\"token function\">htop<\/span><\/p>\n<p><span class=\"token comment\"># htop \u4ee5\u6307\u5b9a\u5237\u65b0\u95f4\u9694\u8fd0\u884c<\/span><br \/>\n<span class=\"token function\">htop<\/span> <span class=\"token parameter variable\">-d<\/span> <span class=\"token number\">10<\/span>   <span class=\"token comment\"># \u5355\u4f4d\u662f 1\/10 \u79d2&#xff0c;10 &#061; 1 \u79d2\u5237\u65b0\u4e00\u6b21<\/span><\/p>\n<p>top \u548c htop \u7684\u6838\u5fc3\u533a\u522b&#xff1a;top \u662f\u7cfb\u7edf\u5185\u7f6e\u5de5\u5177&#xff0c;\u6c38\u8fdc\u53ef\u4ee5\u4f9d\u8d56&#xff1b;htop \u9700\u8981\u5b89\u88c5&#xff0c;\u4f46\u63d0\u4f9b\u66f4\u53cb\u597d\u7684\u754c\u9762\u548c\u989c\u8272\u6807\u6ce8&#xff0c;\u5728\u5f00\u53d1\u673a\u6216\u914d\u7f6e\u8f83\u5b8c\u5584\u7684\u670d\u52a1\u5668\u4e0a\u63a8\u8350\u4f7f\u7528\u3002<\/p>\n<h4>12.3 vmstat<\/h4>\n<p><span class=\"token comment\"># \u6bcf 1 \u79d2\u8f93\u51fa\u4e00\u6b21&#xff0c;\u5171 10 \u6b21<\/span><br \/>\n<span class=\"token function\">vmstat<\/span> <span class=\"token number\">1<\/span> <span class=\"token number\">10<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5185\u5b58\u7edf\u8ba1&#xff08;\u4e0d\u540c\u4e8e\u9ed8\u8ba4\u7684\u8fdb\u7a0b\/CPU \u89c6\u56fe&#xff09;<\/span><br \/>\n<span class=\"token function\">vmstat<\/span> <span class=\"token parameter variable\">-s<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u78c1\u76d8 I\/O \u7edf\u8ba1&#xff08;\u7c7b\u4f3c iostat \u7684\u7b80\u5316\u7248&#xff09;<\/span><br \/>\n<span class=\"token function\">vmstat<\/span> <span class=\"token parameter variable\">-d<\/span><\/p>\n<p>vmstat \u7684\u4f18\u52bf\u662f\u5728\u4e00\u884c\u91cc\u5448\u73b0\u4e86\u5185\u5b58\u3001Swap\u3001I\/O\u3001\u7cfb\u7edf\u8c03\u7528\u548c CPU \u7684\u7efc\u5408\u4fe1\u606f&#xff0c;\u7279\u522b\u9002\u5408\u5feb\u901f\u505a&#034;\u5168\u5c40\u5065\u5eb7\u68c0\u67e5&#034;\u3002R \u5217&#xff08;\u8fd0\u884c\u961f\u5217&#xff09;\u548c B \u5217&#xff08;\u963b\u585e\u8fdb\u7a0b\u6570&#xff09;\u662f\u548c Load Average \u6700\u76f4\u63a5\u76f8\u5173\u7684\u4e24\u4e2a\u5b57\u6bb5\u3002<\/p>\n<h4>12.4 iostat<\/h4>\n<p><span class=\"token comment\"># \u5b89\u88c5&#xff08;sysstat \u5305&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> sysstat<\/p>\n<p><span class=\"token comment\"># \u6bcf 2 \u79d2\u8f93\u51fa\u4e00\u6b21\u78c1\u76d8 I\/O \u6269\u5c55\u7edf\u8ba1&#xff0c;\u5171 5 \u6b21<\/span><br \/>\niostat <span class=\"token parameter variable\">-xd<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">5<\/span><\/p>\n<p><span class=\"token comment\"># \u53ea\u67e5\u770b\u7279\u5b9a\u78c1\u76d8<\/span><br \/>\niostat <span class=\"token parameter variable\">-xd<\/span> sda <span class=\"token number\">2<\/span> <span class=\"token number\">5<\/span><\/p>\n<p><span class=\"token comment\"># \u540c\u65f6\u663e\u793a CPU \u7edf\u8ba1<\/span><br \/>\niostat <span class=\"token parameter variable\">-x<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>iostat \u662f\u6392\u67e5 I\/O \u578b Load Average \u95ee\u9898\u65f6\u4e0d\u53ef\u7f3a\u5c11\u7684\u5de5\u5177\u3002\u5982\u679c top \u7684 wa \u5f88\u9ad8&#xff0c;\u4e0b\u4e00\u6b65\u5c31\u5e94\u8be5\u7528 iostat \u627e\u51fa\u662f\u54ea\u5757\u78c1\u76d8\u5728\u6210\u4e3a\u74f6\u9888\u3002<\/p>\n<h4>12.5 sar<\/h4>\n<p>sar&#xff08;System Activity Reporter&#xff09;\u662f sysstat \u5305\u91cc\u529f\u80fd\u6700\u5f3a\u5927\u7684\u5de5\u5177&#xff0c;\u5b83\u4e0d\u4ec5\u80fd\u5b9e\u65f6\u91c7\u6837&#xff0c;\u8fd8\u80fd\u4fdd\u5b58\u5386\u53f2\u6570\u636e&#xff0c;\u8ba9\u4f60\u4e8b\u540e\u56de\u6eaf\u67d0\u4e2a\u65f6\u95f4\u70b9\u7684\u7cfb\u7edf\u72b6\u6001\u2014\u2014\u8fd9\u5728\u751f\u4ea7\u73af\u5883\u6392\u67e5&#034;\u4e3a\u4ec0\u4e48\u6628\u665a 3 \u70b9\u544a\u8b66\u4e86&#034;\u8fd9\u7c7b\u95ee\u9898\u65f6\u975e\u5e38\u6709\u4ef7\u503c\u3002<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b CPU \u4f7f\u7528\u7387\u5386\u53f2&#xff08;\u4ece sysstat \u4fdd\u5b58\u7684\u65e5\u5fd7\u4e2d\u8bfb\u53d6&#xff09;<\/span><br \/>\nsar <span class=\"token parameter variable\">-u<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b Load Average \u5386\u53f2<\/span><br \/>\nsar <span class=\"token parameter variable\">-q<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5185\u5b58\u4f7f\u7528\u5386\u53f2<\/span><br \/>\nsar <span class=\"token parameter variable\">-r<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u78c1\u76d8 I\/O \u5386\u53f2<\/span><br \/>\nsar <span class=\"token parameter variable\">-d<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9e\u65f6\u91c7\u6837&#xff08;\u6bcf 2 \u79d2&#xff0c;\u5171 5 \u6b21&#xff09;<\/span><br \/>\nsar <span class=\"token parameter variable\">-u<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>sar \u7684\u5386\u53f2\u6570\u636e\u4fdd\u5b58\u5728 \/var\/log\/sysstat\/ \u76ee\u5f55\u4e0b&#xff0c;\u6309\u65e5\u671f\u547d\u540d\u3002\u8981\u542f\u7528\u8fd9\u4e2a\u529f\u80fd&#xff0c;\u9700\u8981\u786e\u8ba4 sysstat \u7684\u5b9a\u65f6\u91c7\u96c6\u662f\u5f00\u542f\u7684&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b sysstat \u6570\u636e\u6536\u96c6\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status sysstat<\/p>\n<p><span class=\"token comment\"># \u5982\u679c\u672a\u8fd0\u884c&#xff0c;\u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">&#8211;now<\/span> sysstat<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b sysstat \u7684\u6570\u636e\u6536\u96c6\u914d\u7f6e<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/etc\/sysstat\/sysstat<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6307\u5b9a\u65e5\u671f\u7684\u5386\u53f2\u8d1f\u8f7d\u6570\u636e&#xff08;YYYY-MM-DD \u683c\u5f0f&#xff09;<\/span><br \/>\n<span class=\"token comment\"># \u5148\u786e\u8ba4\u5386\u53f2\u6587\u4ef6\u5b58\u5728<\/span><br \/>\n<span class=\"token function\">ls<\/span> \/var\/log\/sysstat\/<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u4eca\u5929\u7684 Load Average \u5386\u53f2\u8bb0\u5f55<\/span><br \/>\nsar <span class=\"token parameter variable\">-q<\/span> <span class=\"token parameter variable\">-f<\/span> \/var\/log\/sysstat\/sa<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> &#043;%d<span class=\"token variable\">)<\/span><\/span><\/p>\n<p>\u8fd9\u4e2a\u529f\u80fd\u5728\u5904\u7406&#034;\u4e8b\u540e&#034;\u544a\u8b66\u65f6\u7279\u522b\u6709\u4ef7\u503c\u3002\u5f88\u591a\u65f6\u5019&#xff0c;\u7b49\u4f60\u767b\u5f55\u4e0a\u670d\u52a1\u5668&#xff0c;\u8d1f\u8f7d\u5df2\u7ecf\u6062\u590d\u6b63\u5e38\u4e86&#xff0c;sar \u7684\u5386\u53f2\u8bb0\u5f55\u8ba9\u4f60\u80fd\u91cd\u5efa\u5f53\u65f6\u7684\u72b6\u6001\u3002<\/p>\n<h4>12.6 \/proc\/loadavg<\/h4>\n<p><span class=\"token comment\"># \u76f4\u63a5\u8bfb\u53d6\u5185\u6838\u66b4\u9732\u7684\u8d1f\u8f7d\u6570\u636e<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/proc\/loadavg<\/p>\n<p>1.52 1.34 0.98 3\/312 18547<\/p>\n<p>\u5b57\u6bb5\u542b\u4e49&#xff1a;<\/p>\n<ul>\n<li>1.52 1.34 0.98&#xff1a;1\u30015\u300115 \u5206\u949f Load Average<\/li>\n<li>3\/312&#xff1a;\u5f53\u524d\u6d3b\u8dc3\u8fdb\u7a0b\u6570&#xff08;3&#xff09;\/ \u7cfb\u7edf\u603b\u8fdb\u7a0b\u6570&#xff08;312&#xff09;<\/li>\n<li>18547&#xff1a;\u6700\u8fd1\u4e00\u4e2a\u521b\u5efa\u7684\u8fdb\u7a0b\u7684 PID<\/li>\n<\/ul>\n<p>\u5728 Shell \u811a\u672c\u4e2d\u505a\u76d1\u63a7\u65f6&#xff0c;\u76f4\u63a5\u8bfb\u8fd9\u4e2a\u6587\u4ef6\u6700\u9ad8\u6548&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5728\u811a\u672c\u4e2d\u83b7\u53d6 1 \u5206\u949f\u8d1f\u8f7d\u503c<\/span><br \/>\n<span class=\"token assign-left variable\">load_1min<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $1}&#039;<\/span> \/proc\/loadavg<span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u83b7\u53d6 CPU \u6838\u5fc3\u6570<\/span><br \/>\n<span class=\"token assign-left variable\">cpu_cores<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span>nproc<span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u8ba1\u7b97\u8d1f\u8f7d\u6bd4\u7387&#xff08;\u7528 awk \u505a\u6d6e\u70b9\u8fd0\u7b97&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">ratio<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">awk<\/span> <span class=\"token string\">&#034;BEGIN {printf <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>%.2f<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>, <span class=\"token variable\">$load_1min<\/span> \/ <span class=\"token variable\">$cpu_cores<\/span>}&#034;<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;1\u5206\u949f\u8d1f\u8f7d: <span class=\"token variable\">$load_1min<\/span>&#xff0c;CPU\u6838\u5fc3\u6570: <span class=\"token variable\">$cpu_cores<\/span>&#xff0c;\u8d1f\u8f7d\u6bd4\u7387: <span class=\"token variable\">$ratio<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u5224\u65ad\u662f\u5426\u8d85\u8fc7\u9608\u503c<\/span><br \/>\n<span class=\"token function\">awk<\/span> <span class=\"token string\">&#034;BEGIN {<br \/>\n    if (<span class=\"token variable\">$load_1min<\/span> \/ <span class=\"token variable\">$cpu_cores<\/span> &gt; 2.0) {<br \/>\n        print <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>\u8b66\u544a&#xff1a;\u7cfb\u7edf\u8d1f\u8f7d\u8fc7\u9ad8&#xff01;<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span><br \/>\n        exit 1<br \/>\n    } else {<br \/>\n        print <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>\u7cfb\u7edf\u8d1f\u8f7d\u6b63\u5e38<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span><br \/>\n        exit 0<br \/>\n    }<br \/>\n}&#034;<\/span><\/p>\n<h3>\u5341\u4e09\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u8e29\u5751\u603b\u7ed3<\/h3>\n<p>Q1&#xff1a;Load Average \u4e3a\u4ec0\u4e48\u4e0d\u662f\u767e\u5206\u6bd4&#xff0c;\u800c\u662f\u4e00\u4e2a\u7edd\u5bf9\u6570\u5b57&#xff1f;<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u8bbe\u8ba1\u4e0a\u7684\u9009\u62e9\u3002Load Average \u8868\u793a\u7684\u662f\u6d3b\u8dc3\u4efb\u52a1\u7684\u5e73\u5747\u6570\u91cf&#xff0c;\u800c\u4e0d\u662f\u8d44\u6e90\u4f7f\u7528\u7387\u3002\u8fd9\u610f\u5473\u7740\u5b83\u672c\u8eab\u6ca1\u6709&#034;\u4e0a\u9650&#034;\u2014\u2014\u7406\u8bba\u4e0a\u53ef\u4ee5\u65e0\u9650\u589e\u5927\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u5fc5\u987b\u7ed3\u5408 CPU \u6838\u5fc3\u6570\u624d\u80fd\u505a\u51fa\u6709\u610f\u4e49\u7684\u5224\u65ad&#xff1a;\u6838\u5fc3\u6570\u662f\u4f60\u7684&#034;\u5904\u7406\u80fd\u529b\u57fa\u51c6&#034;&#xff0c;\u8d1f\u8f7d\u503c\u662f&#034;\u9700\u6c42\u91cf&#034;&#xff0c;\u4e24\u8005\u76f8\u9664\u624d\u80fd\u77e5\u9053\u9700\u6c42\u662f\u5426\u8d85\u8fc7\u4e86\u4f9b\u7ed9\u3002<\/p>\n<p>Q2&#xff1a;\u4e3a\u4ec0\u4e48\u521a\u521a kill \u4e86\u9ad8\u8d1f\u8f7d\u8fdb\u7a0b&#xff0c;Load Average \u8fd8\u662f\u5f88\u9ad8&#xff1f;<\/p>\n<p>EWMA \u7b97\u6cd5\u7684\u6ede\u540e\u7279\u6027\u5bfc\u81f4\u7684\u30021 \u5206\u949f\u7684\u8d1f\u8f7d\u503c\u6709\u5927\u7ea6 46 \u79d2\u7684&#034;\u534a\u8870\u671f&#034;&#xff0c;\u610f\u5473\u7740\u4f60\u521a\u521a\u6d88\u706d\u7684\u8d1f\u8f7d&#xff0c;\u9700\u8981\u5927\u7ea6 1~2 \u5206\u949f\u624d\u80fd\u660e\u663e\u4ece 1 \u5206\u949f\u5747\u503c\u4e2d\u9000\u51fa&#xff1b;\u800c 15 \u5206\u949f\u7684\u503c\u53ef\u80fd\u9700\u8981 10~15 \u5206\u949f\u624d\u4f1a\u660e\u663e\u4e0b\u964d\u3002\u8fd9\u4e0d\u662f\u5de5\u5177\u7684 bug&#xff0c;\u662f\u8bbe\u8ba1\u5982\u6b64\u3002\u7ee7\u7eed\u89c2\u5bdf&#xff0c;\u7b49\u5b83\u81ea\u7136\u4e0b\u964d\u3002<\/p>\n<p>Q3&#xff1a;\u4e3a\u4ec0\u4e48\u5355\u6838 CPU \u7684 Load Average \u957f\u671f\u4e3a 0.7 \u5c31\u5f00\u59cb\u6709\u6027\u80fd\u611f\u77e5\u4e86&#xff1f;<\/p>\n<p>\u5f53\u8d1f\u8f7d\u7387\u8d85\u8fc7 70% \u65f6&#xff0c;\u8c03\u5ea6\u961f\u5217\u5f00\u59cb\u79ef\u7d2f&#xff0c;\u4efb\u52a1\u7b49\u5f85\u65f6\u95f4\u5f00\u59cb\u4e0a\u5347\u3002\u5bf9\u4e8e\u5ef6\u8fdf\u654f\u611f\u7684\u670d\u52a1&#xff08;\u6bd4\u5982 Web \u8bf7\u6c42&#xff09;&#xff0c;\u7528\u6237\u53ef\u80fd\u5df2\u7ecf\u611f\u53d7\u5230\u54cd\u5e94\u53d8\u6162\u4e86\u30020.7 \u662f\u4e00\u4e2a\u7ecf\u9a8c\u9608\u503c&#xff0c;\u4e0d\u662f\u7edd\u5bf9\u6570\u5b57&#xff0c;\u4f46\u5728\u8fd0\u7ef4\u5b9e\u8df5\u4e2d\u88ab\u5e7f\u6cdb\u7528\u4f5c&#034;\u5f00\u59cb\u5173\u6ce8&#034;\u7684\u8b66\u6212\u7ebf\u3002<\/p>\n<p>Q4&#xff1a;Load Average \u80fd\u53cd\u6620\u5185\u5b58\u538b\u529b\u5417&#xff1f;<\/p>\n<p>\u95f4\u63a5\u53ef\u4ee5\u3002\u5f53\u5185\u5b58\u4e0d\u8db3\u5bfc\u81f4\u7cfb\u7edf\u5927\u91cf\u4f7f\u7528 Swap \u65f6&#xff0c;\u8fdb\u7a0b\u4f1a\u9891\u7e41\u5904\u4e8e\u7b49\u5f85\u78c1\u76d8 I\/O&#xff08;\u8bfb\u5199 Swap&#xff09;\u7684 D \u72b6\u6001&#xff0c;\u8fd9\u4f1a\u63a8\u9ad8 Load Average\u3002\u4f46 Load Average \u672c\u8eab\u5e76\u4e0d\u76f4\u63a5\u6d4b\u91cf\u5185\u5b58&#xff0c;\u4f60\u9700\u8981\u540c\u65f6\u770b free \u6216 vmstat \u7684\u5185\u5b58\u7edf\u8ba1\u6765\u786e\u8ba4\u5185\u5b58\u662f\u5426\u662f\u95ee\u9898\u6839\u6e90\u3002<\/p>\n<p>Q5&#xff1a;\u5728\u865a\u62df\u673a\u91cc\u770b Load Average \u51c6\u5417&#xff1f;<\/p>\n<p>\u5728\u865a\u62df\u673a&#xff08;\u6bd4\u5982 KVM\u3001VMware\u3001VirtualBox&#xff09;\u91cc&#xff0c;Load Average \u53cd\u6620\u7684\u662f\u4ece\u865a\u62df\u673a\u89c6\u89d2\u770b\u5230\u7684\u8d1f\u8f7d&#xff0c;\u5373\u865a\u62df\u673a\u5185\u7684\u8fdb\u7a0b\u6392\u961f\u60c5\u51b5\u3002top \u7684 st&#xff08;steal time&#xff09;\u5b57\u6bb5\u53ef\u4ee5\u544a\u8bc9\u4f60\u6709\u591a\u5c11 CPU \u65f6\u95f4\u88ab\u5bbf\u4e3b\u673a&#034;\u5077\u8d70&#034;\u4e86\u2014\u2014\u5982\u679c steal time \u5f88\u9ad8&#xff0c;\u5373\u4fbf\u4f60\u7684\u865a\u62df\u673a Load Average \u770b\u8d77\u6765\u5408\u7406&#xff0c;\u5b9e\u9645\u6027\u80fd\u4e5f\u53ef\u80fd\u5f88\u5dee&#xff0c;\u56e0\u4e3a\u4f60\u5206\u914d\u5230\u7684 CPU \u65f6\u95f4\u5b9e\u9645\u4e0a\u5728\u7f29\u6c34\u3002<\/p>\n<p>\u5728\u4e91\u670d\u52a1\u5668&#xff08;AWS EC2\u3001\u963f\u91cc\u4e91 ECS \u7b49&#xff09;\u4e0a&#xff0c;\u8fd9\u4e2a\u95ee\u9898\u540c\u6837\u5b58\u5728&#xff0c;\u5c24\u5176\u662f\u5728&#034;\u7a81\u53d1\u578b&#034;\u5b9e\u4f8b\u4e0a&#xff0c;CPU \u914d\u989d\u7528\u5b8c\u540e\u4f1a\u6709\u4e25\u91cd\u7684 CPU \u8282\u6d41\u3002<\/p>\n<p>Q6&#xff1a;D \u72b6\u6001\u8fdb\u7a0b\u6301\u7eed\u5b58\u5728\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<p>\u9996\u5148\u8981\u786e\u8ba4\u539f\u56e0\u3002\u5982\u679c\u662f\u56e0\u4e3a\u6b63\u5e38\u7684\u78c1\u76d8 I\/O&#xff08;\u6bd4\u5982\u5927\u6587\u4ef6\u62f7\u8d1d&#xff09;&#xff0c;\u7b49\u64cd\u4f5c\u5b8c\u6210\u8fdb\u7a0b\u4f1a\u81ea\u52a8\u6062\u590d&#xff1b;\u5982\u679c\u662f\u56e0\u4e3a NFS \u8fde\u63a5\u65ad\u6389\u5bfc\u81f4\u8fdb\u7a0b\u65e0\u6cd5\u5524\u9192&#xff0c;\u9700\u8981\u4fee\u590d NFS \u8fde\u63a5\u6216\u8005\u5378\u8f7d NFS \u6302\u8f7d\u70b9&#xff1b;\u5982\u679c\u662f\u5185\u6838 bug \u6216\u9a71\u52a8\u95ee\u9898&#xff0c;\u53ef\u80fd\u9700\u8981\u91cd\u542f\u624d\u80fd\u89e3\u51b3\u2014\u2014D \u72b6\u6001\u8fdb\u7a0b\u662f\u65e0\u6cd5\u88ab kill -9 \u6740\u6b7b\u7684&#xff0c;\u8fd9\u4e00\u70b9\u5f88\u591a\u4eba\u4e0d\u77e5\u9053&#xff0c;\u8017\u8d39\u5927\u91cf\u65f6\u95f4\u5c1d\u8bd5\u5404\u79cd kill \u65b9\u5f0f\u90fd\u65e0\u6548\u3002<\/p>\n<p>Q7&#xff1a;top \u663e\u793a\u7684 running \u8fdb\u7a0b\u6570\u548c Load Average \u4e0d\u5bf9\u5e94\u600e\u4e48\u56de\u4e8b&#xff1f;<\/p>\n<p>top \u7684 running \u5b57\u6bb5\u662f\u5f53\u524d\u77ac\u95f4\u7684 R \u72b6\u6001\u8fdb\u7a0b\u6570&#xff0c;\u800c Load Average \u662f\u65f6\u95f4\u52a0\u6743\u5e73\u5747\u503c\u3002\u77ac\u95f4\u503c\u548c\u5386\u53f2\u5747\u503c\u672c\u6765\u5c31\u4e0d\u4f1a\u5b8c\u5168\u5bf9\u5e94\u3002\u53e6\u5916&#xff0c;top \u7684 Tasks \u884c\u6ca1\u6709\u5355\u72ec\u663e\u793a D \u72b6\u6001\u8fdb\u7a0b\u6570&#xff08;\u5b83\u4eec\u88ab\u5f52\u5165 sleeping&#xff09;&#xff0c;\u6240\u4ee5\u4f60\u53ef\u80fd\u770b\u5230 running \u6570\u91cf\u4e0d\u591a&#xff0c;\u4f46\u8d1f\u8f7d\u4f9d\u7136\u5f88\u9ad8\u2014\u2014\u522b\u5fd8\u4e86\u68c0\u67e5 D \u72b6\u6001\u8fdb\u7a0b\u7684\u6570\u91cf\u3002<\/p>\n<p>Q8&#xff1a;Watch \u547d\u4ee4\u600e\u4e48\u7528\u6765\u6301\u7eed\u89c2\u5bdf Load Average&#xff1f;<\/p>\n<p><span class=\"token comment\"># \u6bcf 2 \u79d2\u5237\u65b0\u4e00\u6b21 uptime \u8f93\u51fa<\/span><br \/>\n<span class=\"token function\">watch<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">2<\/span> <span class=\"token function\">uptime<\/span><\/p>\n<p><span class=\"token comment\"># \u7ed3\u5408 date \u663e\u793a\u65f6\u95f4\u6233&#xff0c;\u65b9\u4fbf\u8bb0\u5f55\u89c2\u5bdf\u65f6\u95f4<\/span><br \/>\n<span class=\"token function\">watch<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">2<\/span> <span class=\"token string\">&#039;date; uptime&#039;<\/span><\/p>\n<p><span class=\"token comment\"># \u9ad8\u4eae\u663e\u793a\u53d8\u5316\u7684\u5185\u5bb9<\/span><br \/>\n<span class=\"token function\">watch<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">2<\/span> <span class=\"token parameter variable\">-d<\/span> <span class=\"token function\">uptime<\/span><\/p>\n<p>Q9&#xff1a;Load Average \u548c Kubernetes \u7684\u8282\u70b9\u8d44\u6e90\u6709\u4ec0\u4e48\u5173\u7cfb&#xff1f;<\/p>\n<p>\u5728 Kubernetes \u73af\u5883\u91cc&#xff0c;\u8282\u70b9\u7684 Load Average \u4f9d\u7136\u6709\u53c2\u8003\u610f\u4e49&#xff0c;\u4f46 Pod \u7684\u8d44\u6e90\u8c03\u5ea6\u57fa\u4e8e CPU Request \/ Limit&#xff0c;\u800c\u4e0d\u662f Load Average\u3002\u4e00\u4e2a\u8282\u70b9\u7684 Load Average \u5f88\u9ad8&#xff0c;\u4e0d\u4e00\u5b9a\u4f1a\u89e6\u53d1 Kubernetes \u7684\u8c03\u5ea6\u5e72\u9884&#xff1b;\u4f46\u5982\u679c CPU \u8282\u6d41&#xff08;throttling&#xff09;\u6216\u5185\u5b58 OOM \u53d1\u751f&#xff0c;Kubernetes \u4f1a\u6709\u5bf9\u5e94\u7684\u4e8b\u4ef6\u548c\u6307\u6807\u3002\u4e0d\u80fd\u7528 Load Average \u76f4\u63a5\u66ff\u4ee3 Kubernetes \u7684 metrics-server \u6307\u6807\u6765\u505a\u8d44\u6e90\u51b3\u7b56\u3002<\/p>\n<p>Q10&#xff1a;\u4e3a\u4ec0\u4e48\u540c\u6837\u662f 4 \u6838\u673a\u5668&#xff0c;\u6709\u4e9b\u670d\u52a1 Load Average \u4e3a 3 \u4e5f\u6ca1\u95ee\u9898&#xff0c;\u6709\u4e9b\u5230 1.5 \u5c31\u5f88\u6162&#xff1f;<\/p>\n<p>\u8fd9\u53d6\u51b3\u4e8e\u670d\u52a1\u7684\u5ef6\u8fdf\u5bb9\u5fcd\u5ea6\u548c\u4efb\u52a1\u7279\u6027\u3002\u6279\u5904\u7406\u4efb\u52a1&#xff08;\u6bd4\u5982\u79bb\u7ebf\u6570\u636e\u5904\u7406&#xff09;\u5bf9\u5ef6\u8fdf\u4e0d\u654f\u611f&#xff0c;\u5373\u4fbf\u6392\u961f\u7b49\u5f85&#xff0c;\u6700\u7ec8\u5b8c\u6210\u5c31\u884c&#xff0c;\u6240\u4ee5 Load Average \u4e3a 3~4 \u4e5f\u53ef\u4ee5\u63a5\u53d7\u3002\u5728\u7ebf\u670d\u52a1&#xff08;Web API\u3001\u6570\u636e\u5e93\u67e5\u8be2&#xff09;\u5bf9\u5ef6\u8fdf\u6781\u654f\u611f&#xff0c;\u4efb\u4f55\u6392\u961f\u90fd\u4f1a\u76f4\u63a5\u8868\u73b0\u4e3a\u7528\u6237\u4fa7\u7684\u54cd\u5e94\u65f6\u95f4\u4e0a\u5347&#xff0c;\u6240\u4ee5\u5b83\u4eec\u7684&#034;\u5408\u7406\u8d1f\u8f7d&#034;\u9608\u503c\u8981\u8bbe\u7f6e\u5f97\u66f4\u4fdd\u5b88\u3002\u8fd0\u7ef4\u4e2d\u9488\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684\u670d\u52a1\u8bbe\u7f6e\u4e0d\u540c\u7684\u544a\u8b66\u9608\u503c\u662f\u5f88\u6b63\u5e38\u7684\u505a\u6cd5\u3002<\/p>\n<p>Q11&#xff1a;\u670d\u52a1\u5668\u7684 Load Average \u4e00\u76f4\u662f 0&#xff0c;\u6b63\u5e38\u5417&#xff1f;<\/p>\n<p>\u5b8c\u5168\u6b63\u5e38&#xff0c;\u751a\u81f3\u662f\u5f88\u591a\u7a7a\u95f2\u670d\u52a1\u5668\u7684\u5e38\u6001\u3002Load Average \u4e3a 0 \u6216\u63a5\u8fd1 0 \u8bf4\u660e\u7cfb\u7edf\u975e\u5e38\u7a7a\u95f2&#xff0c;\u6ca1\u6709\u4ec0\u4e48\u4efb\u52a1\u5728\u7ade\u4e89\u8d44\u6e90\u3002\u8fd9\u4e0d\u4ee3\u8868\u670d\u52a1\u5668&#034;\u6ca1\u5728\u5de5\u4f5c&#034;&#xff0c;\u6709\u4e9b\u670d\u52a1\u672c\u8eab\u5c31\u662f\u4f4e\u9891\u8fd0\u884c\u7684&#xff0c;\u6bd4\u5982\u7eaf\u7cb9\u7684\u5b9a\u65f6\u4efb\u52a1\u670d\u52a1\u5668\u6216\u8005\u5f00\u53d1\u6d4b\u8bd5\u673a\u3002<\/p>\n<p>Q12&#xff1a;nproc \u548c lscpu \u8fd4\u56de\u7684\u6570\u5b57\u4e0d\u4e00\u6837\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>nproc \u8fd4\u56de\u7684\u662f\u5f53\u524d\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u7684 CPU \u6570\u91cf&#xff0c;\u53ef\u80fd\u53d7 cgroups&#xff08;\u5bb9\u5668\u73af\u5883&#xff09;\u6216 taskset \u7684\u9650\u5236\u3002lscpu \u8fd4\u56de\u7684\u662f\u7cfb\u7edf\u5b9e\u9645\u7684\u903b\u8f91 CPU \u6570\u91cf\u3002\u5728\u5bb9\u5668\u6216 Docker \u5185&#xff0c;nproc \u53ef\u80fd\u4f1a\u8fd4\u56de\u4e00\u4e2a\u6bd4\u5bbf\u4e3b\u673a\u5c0f\u7684\u503c&#xff08;\u5982\u679c\u505a\u4e86 CPU \u9650\u5236&#xff09;&#xff0c;\u7528 nproc \u66f4\u7b26\u5408\u5b9e\u9645\u53ef\u7528\u8d44\u6e90&#xff1b;\u5728\u7269\u7406\u673a\u4e0a&#xff0c;\u4e24\u8005\u901a\u5e38\u4e00\u81f4\u3002<\/p>\n<p>Q13&#xff1a;top \u91cc\u7684 iowait \u662f\u6574\u4e2a\u7cfb\u7edf\u7684&#xff0c;\u5982\u679c\u6211\u60f3\u77e5\u9053\u5177\u4f53\u662f\u54ea\u4e2a\u8fdb\u7a0b\u4ea7\u751f\u4e86 iowait \u8be5\u600e\u4e48\u505a&#xff1f;<\/p>\n<p>iowait \u672c\u8d28\u4e0a\u662f CPU \u5728\u67d0\u4e2a\u65f6\u523b\u6ca1\u6709\u53ef\u8fd0\u884c\u7684\u8fdb\u7a0b&#xff0c;\u540c\u65f6\u53c8\u6709\u8fdb\u7a0b\u5728\u7b49\u5f85 I\/O\u2014\u2014\u6240\u4ee5\u5b83\u662f\u4e00\u4e2a CPU \u89c6\u89d2\u7684\u7edf\u8ba1&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u6620\u5c04\u5230\u67d0\u4e2a\u8fdb\u7a0b\u3002\u4f46\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u95f4\u63a5\u5b9a\u4f4d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e00&#xff1a;iotop \u76f4\u63a5\u663e\u793a\u5404\u8fdb\u7a0b\u7684\u5b9e\u65f6 I\/O \u8bfb\u5199\u901f\u7387<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> iotop<br \/>\n<span class=\"token function\">sudo<\/span> iotop <span class=\"token parameter variable\">-o<\/span>   <span class=\"token comment\"># -o \u53ea\u663e\u793a\u6709 I\/O \u6d3b\u52a8\u7684\u8fdb\u7a0b<\/span><\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e8c&#xff1a;pidstat \u6309\u8fdb\u7a0b\u7edf\u8ba1 I\/O<\/span><br \/>\npidstat <span class=\"token parameter variable\">-d<\/span> <span class=\"token number\">1<\/span> <span class=\"token number\">5<\/span><\/p>\n<p><span class=\"token comment\"># \u65b9\u6cd5\u4e09&#xff1a;\u7ed3\u5408 D \u72b6\u6001\u8fdb\u7a0b&#xff0c;\u627e\u51fa\u88ab I\/O \u963b\u585e\u7684\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-eo<\/span> pid,stat,comm <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;$2 ~ \/^D\/&#039;<\/span><\/p>\n<p>Q14&#xff1a;Load Average \u9ad8\u4f46\u7cfb\u7edf\u54cd\u5e94\u8fd8\u633a\u5feb&#xff0c;\u8fd9\u8bf4\u660e\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u4e24\u79cd\u53ef\u80fd&#xff1a;\u7b2c\u4e00&#xff0c;\u867d\u7136\u4efb\u52a1\u6570\u91cf\u591a&#xff0c;\u4f46\u6bcf\u4e2a\u4efb\u52a1\u90fd\u5f88\u77ed\u6682&#xff0c;\u5f88\u5feb\u5b8c\u6210\u540e\u9000\u51fa&#xff0c;\u7cfb\u7edf\u5728\u9ad8\u901f\u6d41\u8f6c&#xff1b;\u7b2c\u4e8c&#xff0c;\u4f60\u7684 CPU \u6838\u5fc3\u6570\u8db3\u591f\u591a&#xff0c;\u5373\u4fbf Load Average \u7684\u7edd\u5bf9\u503c\u770b\u8d77\u6765\u9ad8&#xff0c;\u5b9e\u9645\u4e0a\u6bcf\u4e2a\u6838\u5fc3\u7684\u8d1f\u62c5\u5e76\u4e0d\u91cd\u3002\u8bb0\u4f4f&#xff0c;\u5224\u65ad\u6807\u51c6\u6c38\u8fdc\u662f load average \/ nproc \u7684\u6bd4\u503c&#xff0c;\u4e0d\u662f Load Average \u7684\u7edd\u5bf9\u503c\u3002<\/p>\n<p>Q15&#xff1a;\u80fd\u4e0d\u80fd\u5199\u4e00\u4e2a\u7b80\u5355\u7684 Shell \u811a\u672c\u6765\u81ea\u52a8\u68c0\u6d4b Load Average \u5e76\u53d1\u544a\u8b66&#xff1f;<\/p>\n<p>\u5b8c\u5168\u53ef\u4ee5&#xff0c;\u8fd9\u662f\u8fd0\u7ef4\u81ea\u52a8\u5316\u7684\u57fa\u7840\u6280\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># \u6587\u4ef6\u8def\u5f84&#xff1a;\/usr\/local\/bin\/check_load.sh<\/span><br \/>\n<span class=\"token comment\"># \u529f\u80fd&#xff1a;\u68c0\u67e5\u7cfb\u7edf\u8d1f\u8f7d&#xff0c;\u8d85\u8fc7\u9608\u503c\u65f6\u8f93\u51fa\u544a\u8b66\u4fe1\u606f<\/span><\/p>\n<p><span class=\"token comment\"># \u83b7\u53d6 CPU \u6838\u5fc3\u6570<\/span><br \/>\n<span class=\"token assign-left variable\">CPU_CORES<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span>nproc<span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u83b7\u53d6 1 \u5206\u949f\u8d1f\u8f7d\u503c<\/span><br \/>\n<span class=\"token assign-left variable\">LOAD_1MIN<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $1}&#039;<\/span> \/proc\/loadavg<span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u544a\u8b66\u9608\u503c&#xff1a;\u6838\u5fc3\u6570\u7684 1.5 \u500d<\/span><br \/>\n<span class=\"token assign-left variable\">THRESHOLD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">awk<\/span> <span class=\"token string\">&#034;BEGIN {printf <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>%.1f<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>, <span class=\"token variable\">$CPU_CORES<\/span> * 1.5}&#034;<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u6bd4\u8f83\u8d1f\u8f7d\u548c\u9608\u503c<\/span><br \/>\n<span class=\"token assign-left variable\">ALERT<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">awk<\/span> <span class=\"token string\">&#034;BEGIN {<br \/>\n    if (<span class=\"token variable\">$LOAD_1MIN<\/span> &gt; <span class=\"token variable\">$THRESHOLD<\/span>) print <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>YES<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span><br \/>\n    else print <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>NO<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span><br \/>\n}&#034;<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$ALERT<\/span>&#034;<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;YES&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;[<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> <span class=\"token string\">&#039;&#043;%Y-%m-%d %H:%M:%S&#039;<\/span><span class=\"token variable\">)<\/span><\/span>] \u8b66\u544a&#xff1a;1\u5206\u949f\u8d1f\u8f7d <span class=\"token variable\">$LOAD_1MIN<\/span> \u8d85\u8fc7\u9608\u503c <span class=\"token variable\">$THRESHOLD<\/span>&#xff08;<span class=\"token variable\">${CPU_CORES}<\/span> \u6838\u5fc3 \u00d7 1.5&#xff09;&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u8fd9\u91cc\u53ef\u4ee5\u52a0\u5165\u53d1\u9001\u90ae\u4ef6\u6216\u8c03\u7528\u544a\u8b66 API \u7684\u903b\u8f91<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;[<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> <span class=\"token string\">&#039;&#043;%Y-%m-%d %H:%M:%S&#039;<\/span><span class=\"token variable\">)<\/span><\/span>] \u6b63\u5e38&#xff1a;1\u5206\u949f\u8d1f\u8f7d <span class=\"token variable\">$LOAD_1MIN<\/span>&#xff0c;\u9608\u503c <span class=\"token variable\">$THRESHOLD<\/span>&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">0<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u7ed9\u811a\u672c\u6dfb\u52a0\u6267\u884c\u6743\u9650<\/span><br \/>\n<span class=\"token function\">chmod<\/span> &#043;x \/usr\/local\/bin\/check_load.sh<\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5\u8fd0\u884c<\/span><br \/>\n\/usr\/local\/bin\/check_load.sh<\/p>\n<p><span class=\"token comment\"># \u6dfb\u52a0\u5230 crontab&#xff0c;\u6bcf 5 \u5206\u949f\u68c0\u67e5\u4e00\u6b21<\/span><br \/>\n<span class=\"token function\">crontab<\/span> <span class=\"token parameter variable\">-e<\/span><br \/>\n<span class=\"token comment\"># \u6dfb\u52a0\u8fd9\u4e00\u884c&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># *\/5 * * * * \/usr\/local\/bin\/check_load.sh &gt;&gt; \/var\/log\/load_check.log 2&gt;&amp;1<\/span><\/p>\n<h3>\u5341\u56db\u3001\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/h3>\n<p>\u8fd9\u4e00\u8282\u603b\u7ed3\u4e86\u5728\u771f\u5b9e\u670d\u52a1\u5668\u8fd0\u7ef4\u4e2d\u5173\u4e8e Load Average \u76d1\u63a7\u548c\u9ad8\u8d1f\u8f7d\u5904\u7406\u7684\u7ecf\u9a8c\u505a\u6cd5\u3002<\/p>\n<p>\u5efa\u7acb\u57fa\u7ebf&#xff0c;\u800c\u4e0d\u662f\u4f7f\u7528\u56fa\u5b9a\u9608\u503c<\/p>\n<p>\u6bcf\u53f0\u670d\u52a1\u5668\u7684\u6b63\u5e38\u8d1f\u8f7d\u6c34\u5e73\u90fd\u4e0d\u4e00\u6837\u3002\u4e00\u53f0 Web \u670d\u52a1\u5668\u5728\u4e1a\u52a1\u9ad8\u5cf0\u671f\u8d1f\u8f7d\u4e3a 3.0 \u53ef\u80fd\u5b8c\u5168\u6b63\u5e38&#xff1b;\u800c\u4e00\u53f0\u53ea\u8dd1 Nginx \u9759\u6001\u6587\u4ef6\u670d\u52a1\u7684\u673a\u5668&#xff0c;\u8d1f\u8f7d\u8d85\u8fc7 1.0 \u5c31\u503c\u5f97\u5173\u6ce8\u4e86\u3002\u6211\u5efa\u8bae\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u7ebf\u540e&#xff0c;\u89c2\u5bdf\u4e00\u5230\u4e24\u5468\u7684\u6b63\u5e38\u4e1a\u52a1\u5468\u671f&#xff0c;\u8bb0\u5f55\u8d1f\u8f7d\u7684\u5178\u578b\u8303\u56f4&#xff08;\u5305\u62ec\u65e5\u5e38\u4f4e\u8c37\u548c\u4e1a\u52a1\u9ad8\u5cf0&#xff09;&#xff0c;\u4ee5\u6b64\u4f5c\u4e3a\u544a\u8b66\u9608\u503c\u7684\u8bbe\u5b9a\u4f9d\u636e\u3002\u7528\u56fa\u5b9a\u7684&#034;\u6838\u5fc3\u6570 \u00d7 1.5&#034;\u8fd9\u7c7b\u516c\u5f0f\u53ea\u662f\u8d77\u70b9&#xff0c;\u4e0d\u662f\u7ec8\u70b9\u3002<\/p>\n<p>\u4e09\u4e2a\u503c\u4e00\u8d77\u770b&#xff0c;\u4e0d\u8981\u53ea\u76ef\u7740\u4e00\u4e2a<\/p>\n<p>\u5f88\u591a\u76d1\u63a7\u5927\u76d8\u53ea\u5c55\u793a 1 \u5206\u949f\u8d1f\u8f7d&#xff0c;\u8fd9\u662f\u6709\u5c40\u9650\u6027\u7684\u3002\u771f\u6b63\u6709\u4ef7\u503c\u7684\u5224\u65ad\u9700\u8981\u540c\u65f6\u770b\u4e09\u4e2a\u503c\u7684\u76f8\u5bf9\u5173\u7cfb\u548c\u53d8\u5316\u8d8b\u52bf\u3002\u5982\u679c\u4f60\u53ea\u6709\u4e00\u4e2a\u503c\u53ef\u4ee5\u9009&#xff0c;\u9009 5 \u5206\u949f\u7684\u2014\u2014\u5b83\u6bd4 1 \u5206\u949f\u7684\u7a33\u5b9a&#xff0c;\u6bd4 15 \u5206\u949f\u7684\u66f4\u53ca\u65f6\u3002<\/p>\n<p>\u8d1f\u8f7d\u9ad8\u65f6&#xff0c;\u5148\u5224\u65ad\u7c7b\u578b\u518d\u91c7\u53d6\u884c\u52a8<\/p>\n<p>\u9ad8\u8d1f\u8f7d\u7684\u5904\u7406\u65b9\u5f0f\u5b8c\u5168\u53d6\u51b3\u4e8e\u5b83\u7684\u7c7b\u578b\u3002CPU \u5bc6\u96c6\u578b\u548c I\/O \u5bc6\u96c6\u578b\u7684\u4f18\u5316\u601d\u8def\u5b8c\u5168\u4e0d\u540c&#xff1a;\u524d\u8005\u8003\u8651\u51cf\u5c11\u8ba1\u7b97\u91cf\u3001\u62c6\u5206\u4efb\u52a1\u3001\u6269\u5145 CPU&#xff1b;\u540e\u8005\u8003\u8651\u4f18\u5316 I\/O \u6a21\u5f0f\u3001\u6362\u7528\u66f4\u5feb\u7684\u78c1\u76d8\u3001\u589e\u52a0\u5185\u5b58\u51cf\u5c11 Swap \u4f7f\u7528\u3002\u76f2\u76ee\u91cd\u542f\u670d\u52a1\u4e0d\u4f1a\u89e3\u51b3\u6839\u672c\u95ee\u9898&#xff0c;\u6709\u65f6\u751a\u81f3\u4f1a\u8ba9\u60c5\u51b5\u66f4\u7cdf&#xff08;\u6bd4\u5982\u91cd\u542f\u4f1a\u89e6\u53d1\u66f4\u591a\u7684\u78c1\u76d8\u64cd\u4f5c&#xff0c;\u52a0\u5267 I\/O \u538b\u529b&#xff09;\u3002<\/p>\n<p>iowait \u9ad8\u65f6&#xff0c;\u5148\u68c0\u67e5\u5185\u5b58&#xff0c;\u518d\u68c0\u67e5\u78c1\u76d8<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u4ece\u5b9e\u6218\u4e2d\u603b\u7ed3\u51fa\u6765\u7684\u7ecf\u9a8c\u3002\u5927\u91cf\u7684&#034;\u78c1\u76d8 I\/O \u95ee\u9898&#034;\u5b9e\u9645\u4e0a\u662f\u5185\u5b58\u95ee\u9898\u89e6\u53d1\u7684&#xff1a;\u7269\u7406\u5185\u5b58\u4e0d\u8db3 \u2192 \u5927\u91cf Swap \u6362\u51fa\u6362\u5165 \u2192 \u78c1\u76d8 I\/O \u66b4\u589e \u2192 iowait \u4e0a\u5347\u3002\u5982\u679c\u4f60\u76f4\u63a5\u53bb\u68c0\u67e5\u78c1\u76d8&#xff0c;\u53ef\u80fd\u53d1\u73b0\u78c1\u76d8\u672c\u8eab\u662f\u5065\u5eb7\u7684&#xff0c;\u4f46\u5c31\u662f\u5f88\u5fd9\u3002\u8fd9\u65f6\u5019 free -h \u4e00\u770b&#xff0c;\u53d1\u73b0 Swap \u7528\u4e86 80%&#xff0c;\u771f\u6b63\u7684\u89e3\u6cd5\u662f\u7ed9\u7cfb\u7edf\u52a0\u5185\u5b58\u6216\u8005\u627e\u51fa\u5185\u5b58\u6cc4\u6f0f\u7684\u8fdb\u7a0b&#xff0c;\u800c\u4e0d\u662f\u6362\u78c1\u76d8\u3002<\/p>\n<p>\u5728\u751f\u4ea7\u73af\u5883\u4f7f\u7528 sar \u7559\u5b58\u5386\u53f2\u6570\u636e<\/p>\n<p>\u6211\u5f3a\u70c8\u5efa\u8bae\u5728\u6240\u6709\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u542f\u7528 sysstat \u7684\u5b9a\u65f6\u6570\u636e\u6536\u96c6&#xff0c;\u7279\u522b\u662f sar\u3002\u544a\u8b66\u5f80\u5f80\u5728\u4f60\u6700\u5fd9\u6216\u8005\u6700\u4e0d\u6ce8\u610f\u7684\u65f6\u5019\u89e6\u53d1&#xff0c;\u4e8b\u540e\u56de\u6eaf\u9700\u8981\u5386\u53f2\u6570\u636e\u3002sar \u7684\u6570\u636e\u5360\u7528\u7a7a\u95f4\u5f88\u5c0f&#xff0c;\u4f46\u5728\u4e8b\u6545\u590d\u76d8\u65f6\u4ef7\u503c\u6781\u5927\u3002\u786e\u8ba4 sysstat \u670d\u52a1\u6b63\u5728\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u786e\u8ba4 sysstat \u6570\u636e\u6536\u96c6\u670d\u52a1\u6b63\u5e38\u8fd0\u884c<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status sysstat<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6570\u636e\u6536\u96c6\u7684 cron \u914d\u7f6e<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/etc\/cron.d\/sysstat<\/p>\n<p>\u4e0d\u8981\u8f7b\u6613\u4fee\u6539\u5185\u6838\u7684\u8d1f\u8f7d\u8ba1\u7b97\u53c2\u6570<\/p>\n<p>Linux \u5185\u6838\u5141\u8bb8\u901a\u8fc7 \/proc\/sys\/ \u8c03\u6574\u67d0\u4e9b\u8c03\u5ea6\u53c2\u6570&#xff0c;\u4f46 Load Average \u7684\u8ba1\u7b97\u53c2\u6570&#xff08;EWMA \u7684\u8870\u51cf\u7cfb\u6570&#xff09;\u662f\u786c\u7f16\u7801\u5728\u5185\u6838\u91cc\u7684&#xff0c;\u666e\u901a\u7528\u6237\u65e0\u6cd5\u4fee\u6539\u3002\u7f51\u7edc\u4e0a\u5076\u5c14\u6709\u4eba\u5efa\u8bae\u901a\u8fc7\u4fee\u6539 vm.dirty_ratio\u3001vm.swappiness \u7b49\u53c2\u6570\u6765&#034;\u95f4\u63a5\u6539\u5584\u8d1f\u8f7d&#034;&#xff0c;\u8fd9\u4e9b\u6709\u4e00\u5b9a\u9053\u7406&#xff0c;\u4f46\u5c5e\u4e8e\u8fdb\u9636\u8c03\u4f18&#xff0c;\u4e0d\u662f\u521d\u5b66\u8005\u5e94\u8be5\u968f\u610f\u5c1d\u8bd5\u7684\u3002\u5bf9\u4e8e\u65b0\u624b\u6765\u8bf4&#xff0c;\u5148\u628a\u95ee\u9898\u7684\u6839\u672c\u539f\u56e0\u627e\u6e05\u695a&#xff0c;\u518d\u8003\u8651\u8c03\u4f18&#xff0c;\u8fd9\u624d\u662f\u6b63\u786e\u7684\u987a\u5e8f\u3002<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5f53\u524d\u7684 vm \u76f8\u5173\u5185\u6838\u53c2\u6570&#xff08;\u4ec5\u4f9b\u4e86\u89e3&#xff0c;\u4e0d\u5efa\u8bae\u968f\u610f\u4fee\u6539&#xff09;<\/span><br \/>\n<span class=\"token function\">sysctl<\/span> vm.swappiness<br \/>\n<span class=\"token function\">sysctl<\/span> vm.dirty_ratio<br \/>\n<span class=\"token function\">sysctl<\/span> vm.dirty_background_ratio<\/p>\n<p>\u591a\u6838\u673a\u5668\u4e0a\u517b\u6210\u5148\u770b top -1 \u7684\u4e60\u60ef<\/p>\n<p>\u5728 top \u8fd0\u884c\u65f6\u6309\u4e0b 1 \u952e&#xff0c;\u4f1a\u5c55\u5f00\u6bcf\u4e2a CPU \u6838\u5fc3\u7684\u72ec\u7acb\u4f7f\u7528\u7387\u3002\u8fd9\u5728\u6392\u67e5\u67d0\u4e9b\u7279\u5b9a\u95ee\u9898\u65f6\u975e\u5e38\u6709\u7528\u2014\u2014\u6bd4\u5982\u4f60\u53ef\u80fd\u53d1\u73b0 Load Average \u5f88\u9ad8&#xff0c;\u4f46\u53ea\u6709\u67d0\u4e00\u4e24\u4e2a CPU \u6838\u5fc3\u8dd1\u6ee1\u4e86&#xff0c;\u5176\u4ed6\u6838\u5fc3\u90fd\u5f88\u7a7a\u95f2&#xff0c;\u8fd9\u8bf4\u660e\u53ef\u80fd\u5b58\u5728\u5355\u7ebf\u7a0b\u7684\u74f6\u9888&#xff08;\u67d0\u4e2a\u8fdb\u7a0b\u6ca1\u6709\u5145\u5206\u5229\u7528\u591a\u6838&#xff09;\u3002<\/p>\n<p>\u4e3a Load Average \u544a\u8b66\u8bbe\u7f6e\u5408\u7406\u7684\u7f13\u51b2\u65f6\u95f4<\/p>\n<p>\u5982\u679c\u4f60\u5728\u76d1\u63a7\u7cfb\u7edf\u4e2d\u5bf9 Load Average \u8bbe\u7f6e\u4e86\u544a\u8b66\u89c4\u5219&#xff0c;\u5efa\u8bae\u4f7f\u7528&#034;\u6301\u7eed\u8d85\u8fc7\u9608\u503c N \u5206\u949f\u624d\u544a\u8b66&#034;\u7684\u673a\u5236&#xff0c;\u800c\u4e0d\u662f&#034;\u4efb\u4f55\u65f6\u5019\u8d85\u8fc7\u9608\u503c\u5c31\u544a\u8b66&#034;\u3002\u6bd4\u5982\u8981\u6c42 1 \u5206\u949f\u8d1f\u8f7d\u8fde\u7eed\u8d85\u8fc7\u9608\u503c 5 \u5206\u949f\u624d\u53d1\u51fa\u544a\u8b66&#xff0c;\u8fd9\u6837\u53ef\u4ee5\u8fc7\u6ee4\u6389\u7edd\u5927\u591a\u6570\u6b63\u5e38\u7684\u77ed\u6682\u8d1f\u8f7d\u5cf0\u503c&#xff0c;\u51cf\u5c11\u544a\u8b66\u566a\u58f0\u3002Prometheus &#043; Alertmanager \u7684 for: 5m \u914d\u7f6e\u5c31\u662f\u505a\u8fd9\u4e2a\u7528\u7684\u3002<\/p>\n<p>\u7406\u89e3 Load Average \u4e0d\u662f\u4e07\u80fd\u6307\u6807<\/p>\n<p>Load Average \u662f\u4e00\u4e2a\u975e\u5e38\u7c97\u7c92\u5ea6\u7684\u7efc\u5408\u6307\u6807&#xff0c;\u5b83\u53cd\u6620\u4e86&#034;\u7cfb\u7edf\u7e41\u5fd9\u7a0b\u5ea6&#034;\u7684\u4e00\u4e2a\u4fa7\u9762&#xff0c;\u4f46\u65e0\u6cd5\u544a\u8bc9\u4f60\u66f4\u7ec6\u8282\u7684\u4fe1\u606f&#xff1a;\u5b83\u4e0d\u80fd\u76f4\u63a5\u544a\u8bc9\u4f60\u662f\u54ea\u4e2a\u8fdb\u7a0b\u6709\u95ee\u9898&#xff0c;\u4e0d\u80fd\u544a\u8bc9\u4f60\u7f51\u7edc\u5e26\u5bbd\u662f\u5426\u6253\u6ee1&#xff0c;\u4e0d\u80fd\u544a\u8bc9\u4f60\u5e94\u7528\u7684\u5185\u90e8\u6027\u80fd\u74f6\u9888\u5728\u54ea\u91cc\u3002\u628a\u5b83\u5f53\u505a\u4e00\u4e2a&#034;\u9700\u8981\u8fdb\u4e00\u6b65\u6392\u67e5&#034;\u7684\u4fe1\u53f7\u6e90&#xff0c;\u800c\u4e0d\u662f\u7ed3\u8bba\u672c\u8eab\u3002<\/p>\n<h3>\u5341\u4e94\u3001\u6269\u5c55\u77e5\u8bc6&#xff1a;\u4ece Load Average \u5ef6\u4f38\u51fa\u7684\u7cfb\u7edf\u8c03\u4f18\u65b9\u5411<\/h3>\n<p>\u7406\u89e3\u4e86 Load Average \u4e4b\u540e&#xff0c;\u81ea\u7136\u4f1a\u5f15\u51fa\u51e0\u4e2a\u76f8\u5173\u7684\u8c03\u4f18\u65b9\u5411\u3002\u8fd9\u91cc\u505a\u7b80\u5355\u7684\u5ef6\u4f38\u4ecb\u7ecd&#xff0c;\u6bcf\u4e00\u4e2a\u65b9\u5411\u90fd\u53ef\u4ee5\u5355\u72ec\u5199\u4e00\u7bc7\u6df1\u5ea6\u6587\u7ae0\u3002<\/p>\n<p>I\/O \u8c03\u5ea6\u5668<\/p>\n<p>Linux \u5185\u6838\u5141\u8bb8\u4e3a\u4e0d\u540c\u7684\u78c1\u76d8\u8bbe\u5907\u914d\u7f6e\u4e0d\u540c\u7684 I\/O \u8c03\u5ea6\u7b97\u6cd5\u3002\u5728 Ubuntu 22.04 \/ 24.04 \u4e0a&#xff0c;\u5e38\u89c1\u7684\u8c03\u5ea6\u5668\u6709&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5f53\u524d\u78c1\u76d8\u7684 I\/O \u8c03\u5ea6\u5668<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/block\/sda\/queue\/scheduler<\/p>\n<p>[mq-deadline] kyber bfq none<\/p>\n<p>\u65b9\u62ec\u53f7\u5185\u7684\u662f\u5f53\u524d\u4f7f\u7528\u7684\u8c03\u5ea6\u5668\u3002\u5bf9\u4e8e\u666e\u901a HDD&#xff0c;mq-deadline \u901a\u5e38\u662f\u4e0d\u9519\u7684\u9009\u62e9&#xff1b;\u5bf9\u4e8e NVMe SSD&#xff0c;none&#xff08;\u4e0d\u8c03\u5ea6&#xff0c;\u76f4\u63a5\u63d0\u4ea4&#xff09;\u5f80\u5f80\u6027\u80fd\u66f4\u597d&#xff0c;\u56e0\u4e3a SSD \u672c\u8eab\u7684\u968f\u673a\u8bbf\u95ee\u5ef6\u8fdf\u5df2\u7ecf\u5f88\u4f4e\u4e86&#xff0c;\u8c03\u5ea6\u53cd\u800c\u4f1a\u589e\u52a0\u5f00\u9500\u3002<\/p>\n<p>Swap \u914d\u7f6e\u4e0e vm.swappiness<\/p>\n<p>vm.swappiness \u63a7\u5236\u5185\u6838\u5728\u591a\u5927\u7a0b\u5ea6\u4e0a\u503e\u5411\u4e8e\u5c06\u5185\u5b58\u9875\u9762\u6362\u51fa\u5230 Swap\u3002\u9ed8\u8ba4\u503c\u662f 60&#xff0c;\u8868\u793a\u5f53\u53ef\u7528\u5185\u5b58\u964d\u4f4e\u5230\u4e00\u5b9a\u7a0b\u5ea6\u65f6&#xff0c;\u5185\u6838\u4f1a\u6bd4\u8f83\u79ef\u6781\u5730\u4f7f\u7528 Swap\u3002\u5bf9\u4e8e\u5185\u5b58\u5145\u8db3\u7684\u670d\u52a1\u5668&#xff0c;\u628a\u8fd9\u4e2a\u503c\u8c03\u4f4e&#xff08;\u6bd4\u5982 10&#xff09;\u53ef\u4ee5\u8ba9\u5185\u6838\u66f4\u503e\u5411\u4e8e\u4fdd\u7559\u70ed\u6570\u636e\u5728\u5185\u5b58\u4e2d&#xff0c;\u51cf\u5c11\u56e0\u4e0d\u5fc5\u8981\u7684 Swap \u64cd\u4f5c\u5bfc\u81f4\u7684 Load Average \u4e0a\u5347\u3002<\/p>\n<p><span class=\"token comment\"># \u4e34\u65f6\u4fee\u6539&#xff08;\u91cd\u542f\u540e\u5931\u6548&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">sysctl<\/span> <span class=\"token assign-left variable\">vm.swappiness<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">10<\/span><\/p>\n<p><span class=\"token comment\"># \u6c38\u4e45\u4fee\u6539<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;vm.swappiness&#061;10&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> <span class=\"token parameter variable\">-a<\/span> \/etc\/sysctl.d\/99-tuning.conf<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">sysctl<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/sysctl.d\/99-tuning.conf<\/p>\n<p>CPU \u4eb2\u548c\u6027&#xff08;CPU Affinity&#xff09;<\/p>\n<p>\u5bf9\u4e8e\u67d0\u4e9b\u7279\u5b9a\u7684\u9ad8\u6027\u80fd\u573a\u666f&#xff0c;\u53ef\u4ee5\u628a\u67d0\u4e2a\u8fdb\u7a0b\u7ed1\u5b9a\u5230\u7279\u5b9a\u7684 CPU \u6838\u5fc3\u4e0a\u8fd0\u884c&#xff0c;\u51cf\u5c11\u8de8\u6838\u5fc3\u8c03\u5ea6\u5e26\u6765\u7684 cache miss \u5f00\u9500\u3002\u8fd9\u5c5e\u4e8e\u8f83\u6df1\u5165\u7684\u6027\u80fd\u8c03\u4f18&#xff0c;\u5728\u666e\u901a Ubuntu \u670d\u52a1\u5668\u8fd0\u7ef4\u4e2d\u4e0d\u5e38\u7528&#xff0c;\u4f46\u5728\u9ad8\u9891\u4ea4\u6613\u3001\u5b9e\u65f6\u97f3\u89c6\u9891\u5904\u7406\u7b49\u573a\u666f\u4e0b\u6709\u5b9e\u9645\u610f\u4e49\u3002<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u8fdb\u7a0b\u5f53\u524d\u7ed1\u5b9a\u7684 CPU \u6838\u5fc3<\/span><br \/>\ntaskset <span class=\"token parameter variable\">-p<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\"># \u5c06\u8fdb\u7a0b\u7ed1\u5b9a\u5230 CPU 0 \u548c 1<\/span><br \/>\n<span class=\"token function\">sudo<\/span> taskset <span class=\"token parameter variable\">-cp<\/span> <span class=\"token number\">0,1<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span><\/p>\n<p>cgroups \u8d44\u6e90\u9650\u5236<\/p>\n<p>\u5982\u679c\u4f60\u9700\u8981\u9650\u5236\u67d0\u4e2a\u8fdb\u7a0b\u6216\u8fdb\u7a0b\u7ec4\u7684\u8d44\u6e90\u4f7f\u7528&#xff08;\u9632\u6b62\u67d0\u4e2a\u5931\u63a7\u7684\u8fdb\u7a0b\u5403\u6389\u6240\u6709 CPU&#xff09;&#xff0c;\u53ef\u4ee5\u4f7f\u7528 cgroups&#xff08;Control Groups&#xff09;\u3002systemd \u5728\u7ba1\u7406\u670d\u52a1\u65f6\u5b9e\u9645\u4e0a\u5c31\u662f\u901a\u8fc7 cgroups \u5b9e\u73b0\u8d44\u6e90\u9694\u79bb\u7684&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u67d0\u4e2a systemd \u670d\u52a1\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5&#xff08;\u901a\u8fc7 cgroup&#xff09;<\/span><br \/>\nsystemctl status nginx<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u670d\u52a1\u7684\u8be6\u7ec6 cgroup \u8d44\u6e90\u7edf\u8ba1<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemd-cgtop<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u4e3a\u67d0\u4e2a\u670d\u52a1\u8bbe\u7f6e CPU \u4f7f\u7528\u7387\u4e0a\u9650&#xff0c;\u53ef\u4ee5\u5728 systemd unit \u6587\u4ef6\u4e2d\u914d\u7f6e&#xff1a;<\/p>\n<p># \u5728 \/etc\/systemd\/system\/myapp.service \u4e2d\u6dfb\u52a0<br \/>\n[Service]<br \/>\nCPUQuota&#061;50%        # \u6700\u591a\u4f7f\u7528 50% \u7684 CPU&#xff08;\u5355\u6838\u7b49\u4ef7&#xff09;<br \/>\nMemoryMax&#061;512M      # \u6700\u591a\u4f7f\u7528 512MB \u5185\u5b58<\/p>\n<h3>\u5341\u516d\u3001\u5b8c\u6574\u6392\u67e5\u6d41\u7a0b\u56de\u987e<\/h3>\n<p>\u7528\u4e00\u5f20\u6d41\u7a0b\u56fe\u6765\u603b\u7ed3\u672c\u6587\u4ecb\u7ecd\u7684 Load Average \u5206\u6790\u5168\u6d41\u7a0b&#xff0c;\u76f8\u5173\u793a\u610f\u56fe\u7ed8\u5236\u5982\u4e0b&#xff0c;\u4ec5\u4f9b\u5927\u5bb6\u4fdd\u5b58\u67e5\u9605&#xff1a;<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025719-6ae1648f31144.png\" \/> <\/p>\n<p>\u8fd9\u4e2a\u6d41\u7a0b\u56fe\u662f\u672c\u6587\u6838\u5fc3\u5185\u5bb9\u7684\u5b8c\u6574\u68b3\u7406\u3002\u5728\u771f\u5b9e\u7684\u6392\u67e5\u5de5\u4f5c\u4e2d&#xff0c;\u4e0d\u4e00\u5b9a\u6bcf\u4e2a\u6b65\u9aa4\u90fd\u9700\u8981\u8d70\u5b8c\u2014\u2014\u6709\u65f6\u5019 Step 3 \u5c31\u80fd\u627e\u5230\u660e\u786e\u7b54\u6848&#xff0c;\u6709\u65f6\u5019\u53ef\u80fd\u9700\u8981\u66f4\u6df1\u5165\u7684\u5de5\u5177\u548c\u5206\u6790\u3002\u4f46\u8fd9\u4e2a\u601d\u8def\u6846\u67b6\u662f\u7a33\u5b9a\u7684&#xff1a;\u4ece\u6574\u4f53\u5230\u5c40\u90e8&#xff0c;\u4ece\u8868\u8c61\u5230\u6839\u56e0&#xff0c;\u6bcf\u4e00\u6b65\u7f29\u5c0f\u8303\u56f4\u3002<\/p>\n<h3>\u5341\u4e03\u3001\u603b\u7ed3<\/h3>\n<p>Load Average \u662f Linux \u7cfb\u7edf\u76d1\u63a7\u9886\u57df\u91cc\u770b\u4f3c\u7b80\u5355\u3001\u5b9e\u5219\u5185\u6db5\u4e30\u5bcc\u7684\u4e00\u4e2a\u6307\u6807\u3002\u7528\u4e86\u8fd9\u7bc7\u6587\u7ae0\u6bd4\u8f83\u5927\u7684\u7bc7\u5e45\u6765\u8bb2\u5b83&#xff0c;\u6838\u5fc3\u539f\u56e0\u53ea\u6709\u4e00\u4e2a&#xff1a;\u5f88\u591a\u4eba\u5929\u5929\u770b\u8fd9\u4e2a\u6570\u5b57&#xff0c;\u4f46\u771f\u6b63\u7406\u89e3\u5b83\u7684\u4eba\u5e76\u4e0d\u591a\u3002<\/p>\n<p>\u8ba9\u6211\u4eec\u56de\u987e\u4e00\u4e0b\u672c\u6587\u8986\u76d6\u7684\u6838\u5fc3\u77e5\u8bc6&#xff1a;<\/p>\n<p>\u7b2c\u4e00&#xff0c;Load Average \u7684\u672c\u8d28\u662f\u7cfb\u7edf\u4e2d\u5904\u4e8e&#034;\u53ef\u8fd0\u884c&#034;\u548c&#034;\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#034;\u72b6\u6001\u7684\u8fdb\u7a0b\u6570\u91cf\u7684\u6307\u6570\u52a0\u6743\u79fb\u52a8\u5e73\u5747\u503c\u3002\u5b83\u5305\u542b\u4e86 CPU \u6392\u961f\u548c I\/O \u7b49\u5f85\u4e24\u90e8\u5206&#xff0c;\u4e0d\u7b49\u4e8e CPU \u4f7f\u7528\u7387\u3002<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u5224\u65ad Load Average \u9ad8\u4e0d\u9ad8&#xff0c;\u5fc5\u987b\u4ee5 CPU \u6838\u5fc3\u6570\u4e3a\u57fa\u51c6\u3002\u5355\u72ec\u770b\u7edd\u5bf9\u503c\u6beb\u65e0\u610f\u4e49&#xff0c;load \/ nproc \u7684\u6bd4\u503c\u624d\u662f\u5224\u65ad\u4f9d\u636e\u3002<\/p>\n<p>\u7b2c\u4e09&#xff0c;wa&#xff08;iowait&#xff09;\u662f\u533a\u5206 CPU \u5bc6\u96c6\u578b\u548c I\/O \u5bc6\u96c6\u578b\u8d1f\u8f7d\u7684\u5173\u952e\u6307\u6807\u3002\u9ad8 iowait &#043; \u4f4e CPU idle \u901a\u5e38\u6307\u5411\u78c1\u76d8\u6216\u5185\u5b58\u4e0d\u8db3\u5bfc\u81f4\u7684 Swap \u98ce\u66b4\u3002<\/p>\n<p>\u7b2c\u56db&#xff0c;\u4e09\u4e2a Load Average \u503c\u7684\u76f8\u5bf9\u5173\u7cfb\u544a\u8bc9\u4f60\u8d1f\u8f7d\u662f\u7a81\u7136\u53d1\u751f\u7684\u3001\u6301\u7eed\u79ef\u7d2f\u7684&#xff0c;\u8fd8\u662f\u6b63\u5728\u6062\u590d\u4e2d\u7684\u3002\u8fd9\u6bd4\u4efb\u4f55\u4e00\u4e2a\u7edd\u5bf9\u503c\u90fd\u66f4\u6709\u5224\u65ad\u4ef7\u503c\u3002<\/p>\n<p>\u7b2c\u4e94&#xff0c;\u5b8c\u6574\u7684\u6392\u67e5\u5de5\u5177\u94fe\u662f&#xff1a;uptime \u2192 top \u2192 ps&#xff08;D \u72b6\u6001&#xff09;\u2192 iostat&#xff08;\u78c1\u76d8&#xff09;\u2192 pidstat \/ iotop&#xff08;\u8fdb\u7a0b I\/O&#xff09;\u2192 free&#xff08;\u5185\u5b58&#xff09;\u3002\u6bcf\u4e2a\u5de5\u5177\u6709\u5b83\u7684\u4fa7\u91cd\u70b9&#xff0c;\u7ec4\u5408\u4f7f\u7528\u624d\u80fd\u8986\u76d6\u6240\u6709\u5e38\u89c1\u573a\u666f\u3002<\/p>\n<p>\u7b2c\u516d&#xff0c;sar \u7684\u5386\u53f2\u6570\u636e\u6536\u96c6\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u3002\u544a\u8b66\u5f80\u5f80\u5728\u4f60\u4e0d\u5728\u573a\u65f6\u89e6\u53d1&#xff0c;\u6709\u5386\u53f2\u6570\u636e\u624d\u80fd\u4e8b\u540e\u590d\u76d8\u3002<\/p>\n<p>\u672c\u7ae0\u5230\u8fd9\u91cc&#xff0c;\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u7406\u89e3\u548c\u5206\u6790 Linux \u7cfb\u7edf\u8d1f\u8f7d\u7684\u6838\u5fc3\u65b9\u6cd5\u3002\u5728\u4e0b\u4e00\u8282&#xff08;\u7b2c9\u8282&#xff1a;\u50f5\u5c38\u8fdb\u7a0b\u4e0e\u5b64\u513f\u8fdb\u7a0b&#xff09;\u91cc&#xff0c;\u6211\u4eec\u4f1a\u6df1\u5165\u8bb2\u89e3\u4f60\u5728\u672c\u6587 top \u8f93\u51fa\u91cc\u89c1\u5230\u7684\u90a3\u4e2a zombie \u8fdb\u7a0b\u2014\u2014\u5b83\u662f\u4ec0\u4e48\u3001\u4e3a\u4ec0\u4e48\u5b58\u5728\u3001\u6709\u6ca1\u6709\u5371\u5bb3\u3001\u4ee5\u53ca\u5982\u4f55\u5904\u7406\u3002<\/p>\n<p>\u2026<\/p>\n<p>ok&#xff0c;\u540c\u5b66\u4eec&#xff0c;\u672c\u8282\u8bfe\u5c31\u4e0a\u5230\u8fd9\u513f&#xff0c;\u4e0b\u8bfe~<\/p>\n<h3>&#x1f9e7; \u5b66\u4e60\u798f\u5229 \u00b7 \u9650\u65f6\u5f00\u653e &#x1f9e7;<\/h3>\n<p>\u5f53\u7136&#xff0c;\u65e0\u8bba\u4f60\u662f\u8ba1\u7b97\u673a\u4e13\u4e1a\u5728\u8bfb\u5b66\u751f&#xff0c;\u8fd8\u662f\u521a\u5f00\u59cb\u63a5\u89e6 Linux \u7684\u5165\u95e8\u8005&#xff0c;\u4ea6\u6216\u662f\u5e0c\u671b\u63d0\u5347\u5f00\u53d1\u73af\u5883\u642d\u5efa\u3001\u670d\u52a1\u5668\u7ba1\u7406\u3001\u7cfb\u7edf\u8fd0\u7ef4\u80fd\u529b\u7684\u5f00\u53d1\u8005&#xff0c;\u90fd\u5f3a\u70c8\u5efa\u8bae\u7cfb\u7edf\u5b66\u4e60 Ubuntu \u5168\u4f53\u7cfb\u4e13\u680f&#xff1a;&#x1f449; \u300c\u6eda\u96ea\u7403\u5b66 Ubuntu\u300d&#xff1b;\u6db5\u76d6 Ubuntu \u4ece\u5165\u95e8\u5230\u8fdb\u9636\u7684\u5b8c\u6574\u5b66\u4e60\u5185\u5bb9\u3002<\/p>\n<p>\u8be5\u4e13\u680f\u4ee5\u201c\u5faa\u5e8f\u6e10\u8fdb &#043; \u5b9e\u6218\u9a71\u52a8 &#043; \u573a\u666f\u843d\u5730\u201d\u4e3a\u6838\u5fc3\u7406\u5ff5&#xff0c;\u4ece\u57fa\u7840\u8ba4\u77e5\u5230\u7cfb\u7edf\u5b89\u88c5&#xff0c;\u4ece\u684c\u9762\u64cd\u4f5c\u5230\u547d\u4ee4\u884c\u5b9e\u8df5&#xff0c;\u4ece\u7cfb\u7edf\u7ba1\u7406\u5230\u7f51\u7edc\u914d\u7f6e&#xff0c;\u518d\u5230\u5b89\u5168\u52a0\u56fa\u3001\u5f00\u53d1\u73af\u5883\u642d\u5efa\u3001\u6027\u80fd\u4f18\u5316\u3001\u6545\u969c\u6392\u67e5\u3001\u670d\u52a1\u5668\u90e8\u7f72\u4e0e\u4e91\u5e73\u53f0\u5e94\u7528&#xff0c;\u9010\u5c42\u5c55\u5f00&#xff0c;\u5e2e\u52a9\u4f60\u5feb\u901f\u5efa\u7acb\u5b8c\u6574\u7684 Ubuntu \/ Linux \u6280\u672f\u4f53\u7cfb&#xff0c;\u771f\u6b63\u628a Ubuntu \u7528\u660e\u767d\u3001\u7528\u719f\u7ec3\u3001\u7528\u7a33\u5b9a\u3002<\/p>\n<p>&#x1f4cc; \u5b66\u4e60\u627f\u8bfa&#xff1a; \u901a\u8fc7\u8be5\u4e13\u680f&#xff0c;\u4f60\u5c06\u80fd\u591f&#xff1a;<\/p>\n<ul>\n<li>\u5feb\u901f\u638c\u63e1 Ubuntu \u7cfb\u7edf\u5b89\u88c5\u3001\u914d\u7f6e\u4e0e\u65e5\u5e38\u4f7f\u7528\u80fd\u529b<\/li>\n<li>\u719f\u7ec3\u4f7f\u7528 Linux \u5e38\u7528\u547d\u4ee4\u3001\u7ec8\u7aef\u5de5\u5177\u4e0e\u7cfb\u7edf\u7ba1\u7406\u6280\u5de7<\/li>\n<li>\u642d\u5efa\u7a33\u5b9a\u53ef\u590d\u7528\u7684\u5f00\u53d1\u73af\u5883\u3001\u6d4b\u8bd5\u73af\u5883\u4e0e\u670d\u52a1\u5668\u73af\u5883<\/li>\n<li>\u638c\u63e1\u7f51\u7edc\u914d\u7f6e\u3001SSH \u8fdc\u7a0b\u8bbf\u95ee\u3001\u9632\u706b\u5899\u3001\u5b89\u5168\u52a0\u56fa\u4e0e\u5907\u4efd\u6062\u590d<\/li>\n<li>\u5efa\u7acb\u4ece\u201c\u5165\u95e8\u4f7f\u7528\u201d\u5230\u201c\u72ec\u7acb\u8fd0\u7ef4\u201d\u7684\u5b8c\u6574 Ubuntu \u5b9e\u6218\u80fd\u529b<\/li>\n<\/ul>\n<p>\u5c31\u50cf\u201c\u6eda\u96ea\u7403\u201d\u4e00\u6837&#xff0c;\u5148\u6253\u7262\u57fa\u7840&#xff0c;\u518d\u6301\u7eed\u53e0\u52a0\u7cfb\u7edf\u7ba1\u7406\u3001\u5f00\u53d1\u73af\u5883\u3001\u7f51\u7edc\u5b89\u5168\u3001\u6027\u80fd\u4f18\u5316\u4e0e\u670d\u52a1\u5668\u90e8\u7f72\u80fd\u529b&#xff0c;\u8ba9\u77e5\u8bc6\u4e0d\u65ad\u79ef\u7d2f\u3001\u7ecf\u9a8c\u6301\u7eed\u653e\u5927&#xff0c;\u6700\u7ec8\u5f62\u6210\u5c5e\u4e8e\u81ea\u5df1\u7684 Linux \u6280\u672f\u62a4\u57ce\u6cb3 &#x1f680;<\/p>\n<p>\u6700\u540e&#xff0c;\u5982\u679c\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9&#xff0c;\u5e2e\u5fd9\u7ed9\u4f5c\u8005\u6765\u4e2a\u4e00\u952e\u4e09\u8fde&#xff0c;\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u5c31\u662f\u6211\u575a\u6301\u5199\u4f5c\u6700\u5927\u7684\u52a8\u529b\u3002<\/p>\n<p>\u540c\u65f6\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u6280\u672f\u53f7&#xff1a;\u300c\u733f\u5708\u5947\u5999\u5c4b\u300d &#xff0c;\u4ee5\u4fbf\u5b66\u4e60\u66f4\u591a\u540c\u7c7b\u578b\u7684\u6280\u672f\u6587\u7ae0&#xff0c;\u514d\u8d39\u767d\u5ad6\u6700\u65b0 BAT \u4e92\u8054\u7f51\u516c\u53f8\u9762\u8bd5\u9898\u30014000G PDF \u7f16\u7a0b\u7535\u5b50\u4e66\u3001\u7b80\u5386\u6a21\u677f\u3001\u6280\u672f\u6587\u7ae0 Markdown \u6587\u6863\u7b49\u6d77\u91cf\u8d44\u6599\u3002<\/p>\n<p>ps&#xff1a;\u672c\u6587\u6d89\u53ca\u7684 Ubuntu \u5e38\u7528\u547d\u4ee4\u3001\u7cfb\u7edf\u914d\u7f6e\u3001\u73af\u5883\u642d\u5efa\u6b65\u9aa4\u3001\u670d\u52a1\u90e8\u7f72\u601d\u8def\u4e0e\u6392\u969c\u65b9\u6cd5&#xff0c;\u5747\u5df2\u5728\u6587\u7ae0\u4e2d\u7ed3\u5408\u5b9e\u6218\u573a\u666f\u8fdb\u884c\u6574\u7406&#xff0c;\u540c\u5b66\u4eec\u53ef\u4ee5\u76f4\u63a5\u5bf9\u7167\u5b66\u4e60\u3001\u8fb9\u770b\u8fb9\u7ec3\u3002\u539f\u521b\u6574\u7406\u4e0d\u6613&#xff0c;\u5982\u679c\u89c9\u5f97\u5185\u5bb9\u6709\u5e2e\u52a9&#xff0c;\u6b22\u8fce\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8bc4\u8bba\u652f\u6301\u4e00\u6ce2&#xff0c;\u975e\u5e38\u611f\u8c22\u2757<\/p>\n<h3>&#x1faf5; Who am I&#xff1f;<\/h3>\n<p>\u6211\u662f bug\u83cc&#xff0c;\u4e00\u540d\u957f\u671f\u6df1\u8015\u540e\u7aef\u5f00\u53d1\u3001Linux \u7cfb\u7edf\u5b9e\u8df5\u4e0e\u670d\u52a1\u5668\u8fd0\u7ef4\u9886\u57df\u7684\u4e00\u7ebf\u6280\u672f\u521b\u4f5c\u8005&#xff0c;\u66fe\u62c5\u4efb\u72ec\u89d2\u517d\u4f01\u4e1a\u540e\u7aef\u6280\u672f\u7ecf\u7406\u3001\u7814\u53d1\u67b6\u6784\u5e08\u7b49\u804c\u4f4d&#xff0c;\u957f\u671f\u4e13\u6ce8\u4e8e Java \u540e\u7aef\u3001Linux \/ Ubuntu \u7cfb\u7edf\u7ba1\u7406\u3001\u670d\u52a1\u5668\u90e8\u7f72\u3001\u5206\u5e03\u5f0f\u67b6\u6784\u3001\u5fae\u670d\u52a1\u6cbb\u7406\u3001\u9ad8\u5e76\u53d1\u7cfb\u7edf\u3001\u5de5\u7a0b\u6548\u80fd\u4e0e\u7814\u53d1\u7ba1\u7406\u7b49\u65b9\u5411\u3002<\/p>\n<p>\u76ee\u524d\u6d3b\u8dc3\u4e8e\u591a\u4e2a\u4e3b\u6d41\u6280\u672f\u793e\u533a&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<p>CSDN&#xff5c;\u7a00\u571f\u6398\u91d1&#xff5c;InfoQ&#xff5c;51CTO&#xff5c;\u534e\u4e3a\u4e91\u5f00\u53d1\u8005\u793e\u533a&#xff5c;\u963f\u91cc\u4e91\u5f00\u53d1\u8005\u793e\u533a&#xff5c;\u817e\u8baf\u4e91\u5f00\u53d1\u8005\u793e\u533a&#xff5c;\u5f00\u6e90\u4e2d\u56fd&#xff5c;\u535a\u5ba2\u56ed&#xff5c;\u58a8\u5929\u8f6e \u7b49\u5e73\u53f0\u3002<\/p>\n<p>\u66fe\u83b7\u5f97&#xff1a;<\/p>\n<ul>\n<li>CSDN \u535a\u5ba2\u4e4b\u661f Top30<\/li>\n<li>\u534e\u4e3a\u4e91\u591a\u5e74\u5ea6\u5341\u4f73\u535a\u4e3b &amp; \u5353\u8d8a\u8d21\u732e\u5956<\/li>\n<li>\u6398\u91d1\u591a\u5e74\u5ea6\u4eba\u6c14\u4f5c\u8005 Top40<\/li>\n<li>CSDN\u3001\u6398\u91d1\u3001InfoQ\u300151CTO \u7b49\u5e73\u53f0\u7b7e\u7ea6\u4f5c\u8005 \/ \u4f18\u8d28\u4f5c\u8005<\/li>\n<\/ul>\n<p>\u622a\u81f3\u76ee\u524d&#xff0c;\u5168\u7f51\u6280\u672f\u5185\u5bb9\u7d2f\u8ba1\u5f71\u54cd\u8bfb\u8005\u4f17\u591a&#xff0c;\u5168\u7f51\u7c89\u4e1d\u5df2\u8d85\u8fc7 30w&#043;\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u5173\u6ce8 Linux\u3001Ubuntu\u3001Java \u540e\u7aef\u3001\u670d\u52a1\u5668\u8fd0\u7ef4\u3001\u67b6\u6784\u8bbe\u8ba1\u3001\u6280\u672f\u6210\u957f\u3001\u804c\u573a\u8fdb\u9636\u4e0e\u7814\u53d1\u7ba1\u7406&#xff0c;\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u6280\u672f\u5185\u5bb9\u5408\u96c6\u5165\u53e3&#xff1a;&#x1f449; \u70b9\u51fb\u67e5\u770b &#x1f448;\ufe0f<\/p>\n<p>\u786c\u6838\u6280\u672f\u53f7 \u300c\u733f\u5708\u5947\u5999\u5c4b\u300d \u671f\u5f85\u4f60\u7684\u52a0\u5165\u3002<\/p>\n<p>\u8fd9\u91cc\u4e0d\u4ec5\u5206\u4eab\u6280\u672f\u5e72\u8d27&#xff0c;\u4e5f\u8bb0\u5f55\u4e00\u7ebf\u7814\u53d1\u4eba\u7684\u6210\u957f\u3001\u8e29\u5751\u3001\u601d\u8003\u4e0e\u8fdb\u9636\u8def\u5f84\u3002<\/p>\n<p>\u613f\u6211\u4eec\u4e00\u8d77\u6253\u602a\u5347\u7ea7&#xff0c;\u628a Ubuntu \u7528\u6210\u751f\u4ea7\u529b\u5de5\u5177&#xff0c;\u628a Linux \u7ec3\u6210\u6838\u5fc3\u7ade\u4e89\u529b&#xff0c;\u5728\u6280\u672f\u8def\u4e0a\u6301\u7eed\u8fdb\u9636\u3002<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025720-6ae164905c455.png\" \/> <\/p>\n<p>&#8211; End &#8211;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f3c6; \u672c\u6587\u6536\u5f55\u4e8e \u300a\u6eda\u96ea\u7403\u5b66 Ubuntu\u300b \u4e13\u680f\u3002 \u672c\u4e13\u680f\u9762\u5411\u6709\u4e00\u5b9a\u8ba1\u7b97\u673a\u57fa\u7840&#xff0c;\u4f46\u5c1a\u672a\u7cfb\u7edf\u5b66\u4e60 Linux \/ Ubuntu \u7684\u8bfb\u8005&#xff0c;\u91c7\u7528\u201c\u6eda\u96ea\u7403\u5f0f\u5b66\u4e60\u6cd5\u201d&#xff1a;\u5148\u88c5\u597d\u3001\u518d\u4f1a\u7528\u3001\u518d\u7406\u89e3\u3001\u518d\u4f18\u5316\u3001\u518d\u5b9e\u6218&#xff0c;\u5e26\u4f60\u4ece\u7b2c\u4e00\u6b21\u8fdb\u5165 Ubuntu \u684c\u9762 \/ \u7ec8\u7aef\u5f00\u59cb&#xff0c;\u9010\u6b65\u638c\u63e1 Ubuntu \u7684\u65e5\u5e38\u4f7f\u7528\u3001\u547d\u4ee4\u64cd\u4f5c\u3001\u8f6f\u4ef6\u5b89\u88c5\u3001\u7cfb\u7edf\u914d\u7f6e\u3001\u5f00\u53d1\u73af\u5883\u642d\u5efa\u4e0e\u670d\u52a1\u5668\u90e8\u7f72\u80fd\u529b\u3002 \u2003 &#x1f3af; \u9002\u5408\u4eba\u7fa4&amp;#xff1a<\/p>\n","protected":false},"author":2,"featured_media":118888,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13178,13512,13513,58,103,43],"topic":[],"class_list":["post-118894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-1024---","tag-load-average","tag-13513","tag-linux","tag-ubuntu","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \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\/118894.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f3c6; \u672c\u6587\u6536\u5f55\u4e8e \u300a\u6eda\u96ea\u7403\u5b66 Ubuntu\u300b \u4e13\u680f\u3002 \u672c\u4e13\u680f\u9762\u5411\u6709\u4e00\u5b9a\u8ba1\u7b97\u673a\u57fa\u7840&#xff0c;\u4f46\u5c1a\u672a\u7cfb\u7edf\u5b66\u4e60 Linux \/ Ubuntu \u7684\u8bfb\u8005&#xff0c;\u91c7\u7528\u201c\u6eda\u96ea\u7403\u5f0f\u5b66\u4e60\u6cd5\u201d&#xff1a;\u5148\u88c5\u597d\u3001\u518d\u4f1a\u7528\u3001\u518d\u7406\u89e3\u3001\u518d\u4f18\u5316\u3001\u518d\u5b9e\u6218&#xff0c;\u5e26\u4f60\u4ece\u7b2c\u4e00\u6b21\u8fdb\u5165 Ubuntu \u684c\u9762 \/ \u7ec8\u7aef\u5f00\u59cb&#xff0c;\u9010\u6b65\u638c\u63e1 Ubuntu \u7684\u65e5\u5e38\u4f7f\u7528\u3001\u547d\u4ee4\u64cd\u4f5c\u3001\u8f6f\u4ef6\u5b89\u88c5\u3001\u7cfb\u7edf\u914d\u7f6e\u3001\u5f00\u53d1\u73af\u5883\u642d\u5efa\u4e0e\u670d\u52a1\u5668\u90e8\u7f72\u80fd\u529b\u3002 \u2003 &#x1f3af; \u9002\u5408\u4eba\u7fa4&amp;#xff1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/118894.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-28T02:57:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025711-6ae16487d3a7c.png\" \/>\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=\"20 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/118894.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/118894.html\",\"name\":\"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-28T02:57:23+00:00\",\"dateModified\":\"2026-10-28T02:57:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/118894.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/118894.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/118894.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01\"}]},{\"@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":"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \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\/118894.html","og_locale":"zh_CN","og_type":"article","og_title":"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f3c6; \u672c\u6587\u6536\u5f55\u4e8e \u300a\u6eda\u96ea\u7403\u5b66 Ubuntu\u300b \u4e13\u680f\u3002 \u672c\u4e13\u680f\u9762\u5411\u6709\u4e00\u5b9a\u8ba1\u7b97\u673a\u57fa\u7840&#xff0c;\u4f46\u5c1a\u672a\u7cfb\u7edf\u5b66\u4e60 Linux \/ Ubuntu \u7684\u8bfb\u8005&#xff0c;\u91c7\u7528\u201c\u6eda\u96ea\u7403\u5f0f\u5b66\u4e60\u6cd5\u201d&#xff1a;\u5148\u88c5\u597d\u3001\u518d\u4f1a\u7528\u3001\u518d\u7406\u89e3\u3001\u518d\u4f18\u5316\u3001\u518d\u5b9e\u6218&#xff0c;\u5e26\u4f60\u4ece\u7b2c\u4e00\u6b21\u8fdb\u5165 Ubuntu \u684c\u9762 \/ \u7ec8\u7aef\u5f00\u59cb&#xff0c;\u9010\u6b65\u638c\u63e1 Ubuntu \u7684\u65e5\u5e38\u4f7f\u7528\u3001\u547d\u4ee4\u64cd\u4f5c\u3001\u8f6f\u4ef6\u5b89\u88c5\u3001\u7cfb\u7edf\u914d\u7f6e\u3001\u5f00\u53d1\u73af\u5883\u642d\u5efa\u4e0e\u670d\u52a1\u5668\u90e8\u7f72\u80fd\u529b\u3002 \u2003 &#x1f3af; \u9002\u5408\u4eba\u7fa4&amp;#xff1a","og_url":"https:\/\/www.wsisp.com\/helps\/118894.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-28T02:57:23+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261028025711-6ae16487d3a7c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"20 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/118894.html","url":"https:\/\/www.wsisp.com\/helps\/118894.html","name":"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-28T02:57:23+00:00","dateModified":"2026-10-28T02:57:23+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/118894.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/118894.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/118894.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Ubuntu\u96f6\u57fa\u7840\u5165\u95e8\u5230\u7cbe\u901a\u301010.8\u8bb2\u3011\uff1aLoad Average \u6df1\u5ea6\u89e3\u6790 - \u4ece\u201c\u7cfb\u7edf\u8d1f\u8f7d\u201c\u5230\u771f\u6b63\u8bfb\u61c2\u670d\u52a1\u5668\u538b\u529b\uff01"}]},{"@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\/118894","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=118894"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/118894\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/118888"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=118894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=118894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=118894"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=118894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}