{"id":256897,"date":"2022-11-29T09:08:44","date_gmt":"2022-11-29T01:08:44","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=256897"},"modified":"2022-11-07T08:34:16","modified_gmt":"2022-11-07T00:34:16","slug":"total-linux-sourse","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/total-linux-sourse.html","title":{"rendered":"\u5408\u96c6\uff01Linux\u7684\u67e5\u770b\u7cfb\u7edf\u8d44\u6e90\u547d\u4ee4"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u6709\u65f6\u5019\uff0c\u6709\u4e9b\u5e94\u7528\u83ab\u540d\u5176\u5999\u542f\u52a8\u4e0d\u4e86\u4e86\uff0c\u6216\u8005\u8bf4\u6ca1\u53cd\u5e94\uff0c\u6216\u8005web\u754c\u9762\u8fdb\u4e0d\u53bb\u4e86\uff0c\u8fd9\u65f6\u5019\u5c31\u5f97\u770b\u4e00\u4e0b\u673a\u5668\u8d44\u6e90\u662f\u5426\u591f\u7528\uff0c\u8fd9\u91cc\u5c31\u6765\u4ecb\u7ecd\u4e0b\u5e38\u7528\u7684\u68c0\u67e5\u547d\u4ee4\u5427\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n 1\u3001Top\u547d\u4ee4<\/strong><\/div>\n \u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u5b9e\u65f6\u67e5\u770b\u8fdb\u7a0b\u7684\u72b6\u6001\uff0c\u770b\u53ef\u4ee5\u770b\u5230\u603b\u4f53\u7684\u7cfb\u7edf\u8fd0\u884c\u72b6\u6001cpu\u3001\u5185\u5b58\u7b49\uff0c\u5982\u56fe<\/p>\n <\/p>\n \uff081\uff09\u7b2c\u4e00\u884c\u4e2d\u7684Tasks\u3001total\u3001running\u3001sleeping\u3001stoped\u3001zombie\u76f8\u5f53\u4e8e\u4efb\u52a1\u680f\u6982\u51b5\uff0c\u6bd4\u5982\u4e0a\u56fe\u4e2d\uff0c\u603b\u5171356\u4e2a\u8fdb\u7a0b\u30012\u4e2a\u5904\u4e8e\u8fd0\u884c\u72b6\u6001\u3001354\u4e2a\u5904\u4e8e\u4f11\u7720\u3001\u505c\u6b62\u7684\u67090\u4e2a\u3001\u50f5\u5c38\u72b6\u6001\u7684\u67090\u4e2a\uff0c\u4e0d\u662f0\u5c31\u5f97\u624b\u5de5\u68c0\u67e5\u4e0b\uff0c\u4ee5\u4e0b\u56fe\u6765\u81ea\u7f51\u7edc\u56fe\uff0c\u4ec5\u4f9b\u5b66\u4e60\u53c2\u8003\u3002<\/p>\n <\/p>\n 2\uff09\u7b2c\u4e8c\u884c\u4e2d\u663e\u793a\u7684\u5c31\u662fcpu\u7684\u72b6\u6001\uff0c\u5177\u4f53\u53c2\u6570\u542b\u4e49\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4e3b\u8981\u770b\u7684\u5c31\u662f\u7528\u6237\u72b6\u6001\u8fdb\u7a0b\u6240\u5360\u7528cpu\u7684\u767e\u5206\u6bd4\uff0c\u8fd9\u91cc\u5982\u679c\u6bd4\u8f83\u9ad8\u7684\u8bdd\u5c31\u5f97\u68c0\u67e5\u4e00\u4e0b\u90a3\u4e9b\u8fdb\u7a0b\u5360\u7528\u8fc7\u591a\u3002<\/p>\n <\/p>\n \uff083\uff09\u7b2c\u4e09\u884c\u79cd\u663e\u793a\u7684\u5c31\u662f\u5173\u4e8e\u5185\u5b58\u4f7f\u7528\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5305\u62ec\u603b\u5185\u5b58\u3001\u7a7a\u95f2\u5185\u5b58\u3001\u5df2\u4f7f\u7528\u5185\u5b58\u3001\u4ee5\u53ca\u7f13\u5b58\u3002\u4e00\u822c\u5927\u81f4\u7684\u8ba1\u7b97\u53ef\u7528\u5185\u5b58\u4e3a\u7a7a\u95f2free\u5185\u5b58+\u7f13\u5b58<\/p>\n <\/p>\n \uff084\uff09\u7b2c\u56db\u884c\u663e\u793a\u7684\u5c31\u662fswap\u4ea4\u6362\u5206\u533a\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u6240\u4ee5\u5728\u770btop\u547d\u4ee4\u7684\u65f6\u5019\u5982\u679c\u4ea4\u6362\u5185\u5b58\u529f\u80fd\u6ca1\u5173\u95ed\u7684\u8bdd\uff0c\u5c31\u8981\u591a\u5173\u6ce8\u4e0b\uff0c\u5982\u679c\u6570\u503c\u4e00\u76f4\u53d8\u5316\uff0c\u8bf4\u660e\u5185\u5b58\u5c31\u771f\u7684\u4e0d\u591f\u7528\u4e86\u3002<\/p>\n <\/p>\n \uff085\uff09\u5269\u4f59\u7684\u5c31\u662f\u5173\u4e8e\u8fdb\u7a0b\u72b6\u6001\u7684\u63cf\u8ff0<\/p>\n
\u5230\u8fd9\u91cc\u6574\u4f53\u7684top\u547d\u4ee4\u5c31\u53ef\u4ee5\u770b\u61c2\u4e86\uff0c\u5982\u679c\u8fd8\u9700\u8981\u7814\u7a76\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528h\u547d\u4ee4\u67e5\u770b\u5e2e\u52a9<\/p>\n <\/p>\n \u63091\u5c31\u53ef\u4ee5\u76d1\u63a7\u6bcf\u4e2a\u903b\u8f91cpu\u7684\u72b6\u6001\uff0c\u6309m\u5c31\u5f00\u663e\u793a\u5185\u5b58\u7edf\u8ba1\u6570\u636e<\/p>\n <\/p>\n 2\u3001vmstat<\/strong><\/div>\n \u8fd9\u4e2a\u662f\u865a\u62df\u5185\u5b58\u7edf\u8ba1\uff08virtual memory statistics\uff09\uff0c\u4e5f\u53ef\u4ee5\u67e5\u770bcpu\u3001\u8fdb\u7a0b\u3001\u5185\u5b58\u3001\u865a\u62df\u5185\u5b58\u3001\u8fd8\u6709\u4e00\u4e2a\u786c\u76d8IO\u7684\u72b6\u6001<\/p>\n <\/p>\n \uff081\uff09procs\u8fdb\u7a0b\u4fe1\u606f \uff1ar\u4ee3\u8868\u7b49\u5f85\u8fd0\u884c\u8fdb\u7a0b\u6570\u3001\u8d8a\u5927\u7cfb\u7edf\u8d8a\u5fd9\uff0cb\u4ee3\u8868\u4e0d\u53ef\u88ab\u5524\u9192\u7684\u8fdb\u7a0b\u6570\u91cf\uff0c\u8d8a\u5927\u8d8a\u5fd9<\/p>\n \uff082\uff09memory\u4fe1\u606f\uff1a\u4ea4\u6362\u5185\u5b58\u3001\u7a7a\u95f2\u5185\u5b58\u3001buff\u7f13\u51b2\u3001cache\u7f13\u5b58\u5bb9\u91cf\uff0c\u5355\u4f4d\u90fd\u662fKB<\/p>\n \uff083\uff09swap\u4fe1\u606f\uff1asi\u5c31\u662f\u78c1\u76d8\u4ea4\u6362\u5230\u5185\u5b58\u7684\u6570\u636e\u91cf\u3001so\u662f\u5185\u5b58\u4ea4\u6362\u5230\u78c1\u76d8\u4e2d\u6570\u636e\u91cf\uff0c\u5355\u4f4dKB\uff0c\u6570\u8d8a\u5927\uff0c\u6027\u80fd\u8d8a\u5dee\uff0c\u8fd0\u7ef4\u8981\u5728\u78c1\u76d8\u548c\u5185\u5b58\u95f4\u9891\u7e41\u4ea4\u6362\u6570\u636e<\/p>\n \uff084\uff09io\u4fe1\u606f\uff1abi\u5757\u8bbe\u5907\u4e2d\u8bfb\u53d6\u3001bo\u5199\u5230\u5757\u8bbe\u5907\u7684\u6570\u636e\u91cf\uff0c\u8d8a\u5927IO\u8d8a\u7e41\u5fd9<\/p>\n \uff085\uff09system\u4fe1\u606f\uff1ain\u4ee3\u8868\u6bcf\u79d2\u88ab\u4e2d\u65ad\u7684\u8fdb\u7a0b\u6b21\u6570\u3001cs\u662f\u6bcf\u79d2\u4e8b\u4ef6\u5207\u6362\u6b21\u6570\uff0c\u6570\u8d8a\u5927\uff0c\u4ee3\u8868\u7cfb\u7edf\u548c\u63a5\u53e3\u8bbe\u5907\u901a\u4fe1\u8d8a\u7e41\u5fd9<\/p>\n \uff086\uff09cpu\u5b57\u6bb5\uff1aus\u975e\u5185\u6838\u8fdb\u7a0bcpu\u5360\u7528\u3001sy\u5185\u6838\u5360\u7528\u3001id\u7a7a\u95f2cpu\u3001wa\u7b49\u5f85io\u3001st\u865a\u62df\u673a\u6240\u7528cpu\u5360\u7528<\/p>\n 3\u3001free -h<\/strong><\/div>\n \u67e5\u770b\u5185\u5b58\u5360\u7528\u60c5\u51b5<\/p>\n <\/p>\n \u8fd9\u91cc\u7684\u53c2\u6570\u548c\u4e0a\u9762top\u4e2d\u6240\u4ecb\u7ecd\u7684\u5dee\u4e0d\u591a\uff0c\u53ea\u662f\u52a0\u4e86\u4e00\u4e2a-h\u7684\u53c2\u6570\uff0c\u4fbf\u4e8e\u4eba\u67e5\u770b\u3002<\/p>\n 4\u3001df -h<\/strong><\/div>\n \u8fd9\u91cc\u662f\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/p>\n <\/p>\n 5\u3001\u67e5\u770b\u6587\u4ef6\u5939\u5927\u5c0f<\/strong><\/div>\n du -sh * \u67e5\u770b\u5f53\u524d\u8def\u5f84\u4e0b\u7684\u6587\u4ef6\u5927\u5c0f<\/pre>\n |