{"id":63965,"date":"2025-04-29T12:14:35","date_gmt":"2025-04-29T04:14:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63965\/"},"modified":"2025-04-29T12:14:35","modified_gmt":"2025-04-29T04:14:35","slug":"linux%e7%b3%bb%e7%bb%9f%e6%80%a7%e8%83%bd%e7%9a%84%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e6%9c%89%e5%93%aa%e4%ba%9b-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63965\/","title":{"rendered":"linux\u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\u6709\u54ea\u4e9b"},"content":{"rendered":"<blockquote><p>\n  \u76d1\u63a7 linux \u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\uff1a\u67e5\u770b\u7cfb\u7edf\u8d1f\u8f7d\uff1auptime\u3001w\u76d1\u63a7 cpu \u4f7f\u7528\u60c5\u51b5\uff1atop\u3001mpstat\u3001vmstat\u68c0\u67e5\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff1afree\u3001ps aux\u3001smem\u76d1\u63a7 io \u6027\u80fd\uff1aiostat\u3001df -h\u3001du -sh\u8bc4\u4f30\u7f51\u7edc\u6027\u80fd\uff1anetstat -antp\u3001ifconfig\u3001iperf3\u6536\u96c6\u5176\u4ed6\u7cfb\u7edf\u4fe1\u606f\uff1asar\u3001strace\u3001perf\u3001dstat\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202409\/17\/2024091718070017465.jpg\" class=\"aligncenter\" title=\"linux\u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\u6709\u54ea\u4e9b\u63d2\u56fe\" alt=\"linux\u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\u6709\u54ea\u4e9b\u63d2\u56fe\" \/><\/p>\n<p><strong>Linux \u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4<\/strong><\/p>\n<p>\u76d1\u63a7 Linux \u7cfb\u7edf\u6027\u80fd\u5bf9\u4e8e\u4f18\u5316\u5176\u8868\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u81f3\u5173\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u7528\u7684\u6027\u80fd\u547d\u4ee4\uff1a<\/p>\n<p><strong>\u7cfb\u7edf\u8d1f\u8f7d<\/strong><\/p>\n<ul>\n<li> <strong>uptime<\/strong>\uff1a\u663e\u793a\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4\u3001\u8d1f\u8f7d\u548c\u7528\u6237\u6570\u91cf\u3002<\/li>\n<li> <strong>w<\/strong>\uff1a\u663e\u793a\u5f53\u524d\u767b\u5f55\u7528\u6237\u4ee5\u53ca\u7cfb\u7edf\u8d1f\u8f7d\u3002<\/li>\n<\/ul>\n<p><strong>CPU \u4f7f\u7528\u60c5\u51b5<\/strong><\/p>\n<ul>\n<li> <strong>top<\/strong>\uff1a\u5b9e\u65f6\u76d1\u63a7 CPU \u5229\u7528\u7387\u3001\u8fdb\u7a0b\u548c\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<li> <strong>mpstat<\/strong>\uff1a\u663e\u793a\u6bcf\u4e2a CPU \u7684\u4f7f\u7528\u7edf\u8ba1\u4fe1\u606f\u3002<\/li>\n<li> <strong>vmstat<\/strong>\uff1a\u62a5\u544a\u6709\u5173\u865a\u62df\u5185\u5b58\u3001\u8fdb\u7a0b\u3001CPU \u548c I\/O \u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p><strong>\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/strong><\/p>\n<ul>\n<li> <strong>free<\/strong>\uff1a\u663e\u793a\u53ef\u7528\u5185\u5b58\u3001\u5df2\u7528\u5185\u5b58\u548c\u7f13\u5b58\u4fe1\u606f\u3002<\/li>\n<li> <strong>ps aux<\/strong>\uff1a\u663e\u793a\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u5305\u62ec\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<li> <strong>smem<\/strong>\uff1a\u663e\u793a\u6309\u8fdb\u7a0b\u548c\u6a21\u5757\u5206\u5217\u7684\u5185\u5b58\u4f7f\u7528\u660e\u7ec6\u3002<\/li>\n<\/ul>\n<p><strong>IO \u6027\u80fd<\/strong><\/p>\n<ul>\n<li> <strong>iostat<\/strong>\uff1a\u663e\u793a\u6709\u5173\u78c1\u76d8\u548c\u7f51\u7edc I\/O \u8bbe\u5907\u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/li>\n<li> <strong>df -h<\/strong>\uff1a\u663e\u793a\u6587\u4ef6\u7cfb\u7edf\u53ef\u7528\u7a7a\u95f4\u548c\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<li> <strong>du -sh<\/strong>\uff1a\u8ba1\u7b97\u76ee\u5f55\u6216\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/li>\n<\/ul>\n<p><strong>\u7f51\u7edc\u6027\u80fd<\/strong><\/p>\n<ul>\n<li> <strong>netstat -antp<\/strong>\uff1a\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u3001\u7aef\u53e3\u548c\u6d41\u91cf\u7edf\u8ba1\u4fe1\u606f\u3002<\/li>\n<li> <strong>ifconfig<\/strong>\uff1a\u663e\u793a\u7f51\u7edc\u63a5\u53e3\u7684\u72b6\u6001\u548c\u914d\u7f6e\u3002<\/li>\n<li> <strong>iperf3<\/strong>\uff1a\u6d4b\u91cf\u7f51\u7edc\u5e26\u5bbd\u548c\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>sar<\/strong>\uff1a\u6536\u96c6\u3001\u62a5\u544a\u548c\u4fdd\u5b58\u7cfb\u7edf\u6d3b\u52a8\u4fe1\u606f\u3002<\/li>\n<li> <strong>strace<\/strong>\uff1a\u8ddf\u8e2a\u7cfb\u7edf\u8c03\u7528\u5e76\u663e\u793a\u5b83\u4eec\u7684\u53c2\u6570\u548c\u8fd4\u56de\u503c\u3002<\/li>\n<li> <strong>perf<\/strong>\uff1a\u6536\u96c6\u548c\u5206\u6790\u6027\u80fd\u6570\u636e\u3002<\/li>\n<li> <strong>dstat<\/strong>\uff1a\u5b9e\u65f6\u76d1\u63a7\u5404\u79cd\u7cfb\u7edf\u6307\u6807\uff0c\u5982 CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u548c\u7f51\u7edc\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\u6709\u54ea\u4e9b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76d1\u63a7 linux \u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4\uff1a\u67e5\u770b\u7cfb\u7edf\u8d1f\u8f7d\uff1auptime\u3001w\u76d1\u63a7 cpu \u4f7f\u7528\u60c5\u51b5\uff1atop\u3001mpstat\u3001vmstat\u68c0\u67e5\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff1afree\u3001ps aux\u3001smem\u76d1\u63a7 io \u6027\u80fd\uff1aiostat\u3001df -h\u3001du -sh\u8bc4\u4f30\u7f51\u7edc\u6027\u80fd\uff1anetstat -antp\u3001ifconfig\u3001iperf3\u6536\u96c6\u5176\u4ed6\u7cfb\u7edf\u4fe1\u606f\uff1asar\u3001strace\u3001perf\u3001dstat Linux \u7cfb\u7edf\u6027\u80fd\u7684\u5e38\u7528\u547d\u4ee4 \u76d1\u63a7 Linux \u7cfb\u7edf\u6027\u80fd\u5bf9\u4e8e\u4f18\u5316\u5176\u8868\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u81f3\u5173\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u7528\u7684\u6027\u80fd\u547d\u4ee4\uff1a \u7cfb\u7edf\u8d1f\u8f7d uptime\uff1a\u663e\u793a\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4\u3001\u8d1f\u8f7d\u548c\u7528\u6237\u6570\u91cf\u3002 w\uff1a\u663e\u793a\u5f53\u524d\u767b\u5f55\u7528\u6237\u4ee5\u53ca\u7cfb\u7edf\u8d1f\u8f7d\u3002 CPU \u4f7f\u7528\u60c5\u51b5 top\uff1a\u5b9e\u65f6\u76d1\u63a7 CPU \u5229\u7528\u7387\u3001\u8fdb\u7a0b\u548c\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002 mpstat\uff1a\u663e\u793a\u6bcf\u4e2a CPU \u7684\u4f7f\u7528\u7edf\u8ba1\u4fe1\u606f\u3002 vmstat\uff1a\u62a5\u544a\u6709\u5173\u865a\u62df\u5185\u5b58\u3001\u8fdb\u7a0b\u3001CPU \u548c I\/O \u7684\u7edf\u8ba1\u4fe1\u606f\u3002 \u5185\u5b58\u4f7f\u7528\u60c5\u51b5 free\uff1a\u663e\u793a\u53ef\u7528\u5185\u5b58\u3001\u5df2\u7528\u5185\u5b58\u548c\u7f13\u5b58\u4fe1\u606f\u3002 ps aux\uff1a\u663e\u793a\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u5305\u62ec\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002 smem\uff1a\u663e\u793a\u6309\u8fdb\u7a0b\u548c\u6a21\u5757\u5206\u5217\u7684\u5185\u5b58\u4f7f\u7528\u660e\u7ec6\u3002 IO \u6027\u80fd iostat\uff1a\u663e\u793a\u6709\u5173\u78c1\u76d8\u548c\u7f51\u7edc I\/O \u8bbe\u5907\u7684\u7edf\u8ba1\u4fe1\u606f\u3002 df -h\uff1a\u663e\u793a\u6587\u4ef6\u7cfb\u7edf\u53ef\u7528\u7a7a\u95f4\u548c\u4f7f\u7528\u60c5\u51b5\u3002 du -sh\uff1a\u8ba1\u7b97\u76ee\u5f55\u6216\u6587\u4ef6\u7684\u5927\u5c0f\u3002 \u7f51\u7edc\u6027\u80fd netstat -antp\uff1a\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u3001\u7aef\u53e3\u548c\u6d41\u91cf\u7edf\u8ba1\u4fe1\u606f\u3002 ifconfig\uff1a\u663e\u793a\u7f51\u7edc\u63a5\u53e3\u7684\u72b6\u6001\u548c\u914d\u7f6e\u3002 iperf3\uff1a\u6d4b\u91cf\u7f51\u7edc\u5e26\u5bbd\u548c\u5ef6\u8fdf\u3002 \u5176\u4ed6\u547d\u4ee4 sar\uff1a\u6536\u96c6\u3001\u62a5\u544a\u548c\u4fdd\u5b58\u7cfb\u7edf\u6d3b\u52a8\u4fe1\u606f\u3002 strace\uff1a\u8ddf\u8e2a\u7cfb\u7edf\u8c03\u7528\u5e76\u663e\u793a\u5b83\u4eec\u7684\u53c2\u6570\u548c\u8fd4\u56de\u503c\u3002 perf\uff1a\u6536\u96c6\u548c\u5206\u6790\u6027\u80fd\u6570\u636e\u3002 dstat\uff1a\u5b9e\u65f6\u76d1\u63a7\u5404\u79cd\u7cfb\u7edf\u6307\u6807\uff0c\u5982 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63965","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63965"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63965\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}