{"id":133848,"date":"2019-01-17T08:18:32","date_gmt":"2019-01-17T00:18:32","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=133848"},"modified":"2019-01-10T09:19:51","modified_gmt":"2019-01-10T01:19:51","slug":"linux-vmstat-explain","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-vmstat-explain.html","title":{"rendered":"Linux vmstat\u547d\u4ee4\u8be6\u89e3"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | Linux\u547d\u4ee4\u5343\u5343\u4e07\uff0c\u800c\u6211\u4eec\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u771f\u771f\u5207\u5207\u7528\u5230\u7684\u547d\u4ee4\u5e94\u8be5\u4e0d\u8d85\u8fc750\u4e2a\uff0c\u5728\u63a5\u4e0b\u6765\u7684\u65e5\u5b50\u91cc\uff0c\u6211\u4f1a\u5bf9\u6211\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\uff0c\u4ee5\u53ca\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4e0d\u719f\u6089\u7684\u547d\u4ee4\u8fdb\u884c\u4e00\u4e2a\u603b\u7ed3\uff0c\u4e00\u662f\u81ea\u6211\u603b\u7ed3\uff0c\u52a0\u6df1\u8bb0\u5fc6\uff1b\u4e8c\u662f\u548c\u5927\u5bb6\u5206\u4eab\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u524d\u8a00<\/strong><\/div>\n Linux\u547d\u4ee4\u5343\u5343\u4e07\uff0c\u800c\u6211\u4eec\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u771f\u771f\u5207\u5207\u7528\u5230\u7684\u547d\u4ee4\u5e94\u8be5\u4e0d\u8d85\u8fc750\u4e2a\uff0c\u5728\u63a5\u4e0b\u6765\u7684\u65e5\u5b50\u91cc\uff0c\u6211\u4f1a\u5bf9\u6211\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\uff0c\u4ee5\u53ca\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4e0d\u719f\u6089\u7684\u547d\u4ee4\u8fdb\u884c\u4e00\u4e2a\u603b\u7ed3\uff0c\u4e00\u662f\u81ea\u6211\u603b\u7ed3\uff0c\u52a0\u6df1\u8bb0\u5fc6\uff1b\u4e8c\u662f\u548c\u5927\u5bb6\u5206\u4eab\u3002<\/p>\n vmstat\u662fVirtual Meomory Statistics\uff08\u865a\u62df\u5185\u5b58\u7edf\u8ba1\uff09\u7684\u7f29\u5199\uff0c\u53ef\u5bf9\u64cd\u4f5c\u7cfb\u7edf\u7684\u865a\u62df\u5185\u5b58\u3001\u8fdb\u7a0b\u3001CPU\u6d3b\u52a8\u8fdb\u884c\u76d1\u63a7\u3002\u5b83\u662f\u5bf9\u7cfb\u7edf\u7684\u6574\u4f53\u60c5\u51b5\u8fdb\u884c\u7edf\u8ba1\uff0c\u4e0d\u8db3\u4e4b\u5904\u662f\u65e0\u6cd5\u5bf9\u67d0\u4e2a\u8fdb\u7a0b\u8fdb\u884c\u6df1\u5165\u5206\u6790\u3002vmstat\u5de5\u5177\u63d0\u4f9b\u4e86\u4e00\u79cd\u4f4e\u5f00\u9500\u7684\u7cfb\u7edf\u6027\u80fd\u89c2\u5bdf\u65b9\u5f0f\u3002\u56e0\u4e3avmstat\u672c\u8eab\u5c31\u662f\u4f4e\u5f00\u9500\u5de5\u5177\uff0c\u5728\u975e\u5e38\u9ad8\u8d1f\u8377\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u4f60\u9700\u8981\u67e5\u770b\u5e76\u76d1\u63a7\u7cfb\u7edf\u7684\u5065\u5eb7\u60c5\u51b5\uff0c\u5728\u63a7\u5236\u7a97\u53e3\u8fd8\u662f\u80fd\u591f\u4f7f\u7528vmstat\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n \u865a\u62df\u5185\u5b58\u539f\u7406 \u5728\u7cfb\u7edf\u4e2d\u8fd0\u884c\u7684\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u9700\u8981\u4f7f\u7528\u5230\u5185\u5b58\uff0c\u4f46\u4e0d\u662f\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u9700\u8981\u6bcf\u65f6\u6bcf\u523b\u4f7f\u7528\u7cfb\u7edf\u5206\u914d\u7684\u5185\u5b58\u7a7a\u95f4\u3002\u5f53\u7cfb\u7edf\u8fd0\u884c\u6240\u9700\u5185\u5b58\u8d85\u8fc7\u5b9e\u9645\u7684\u7269\u7406\u5185\u5b58\uff0c\u5185\u6838\u4f1a\u91ca\u653e\u67d0\u4e9b\u8fdb\u7a0b\u6240\u5360\u7528\u4f46\u672a\u4f7f\u7528\u7684\u90e8\u5206\u6216\u6240\u6709\u7269\u7406\u5185\u5b58\uff0c\u5c06\u8fd9\u90e8\u5206\u8d44\u6599\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\u76f4\u5230\u8fdb\u7a0b\u4e0b\u4e00\u6b21\u8c03\u7528\uff0c\u5e76\u5c06\u91ca\u653e\u51fa\u7684\u5185\u5b58\u63d0\u4f9b\u7ed9\u6709\u9700\u8981\u7684\u8fdb\u7a0b\u4f7f\u7528\u3002<\/p>\n \u5728Linux\u5185\u5b58\u7ba1\u7406\u4e2d\uff0c\u4e3b\u8981\u662f\u901a\u8fc7\u201c\u8c03\u9875Paging\u201d\u548c\u201c\u4ea4\u6362Swapping\u201d\u6765\u5b8c\u6210\u4e0a\u8ff0\u7684\u5185\u5b58\u8c03\u5ea6\u3002\u8c03\u9875\u7b97\u6cd5\u662f\u5c06\u5185\u5b58\u4e2d\u6700\u8fd1\u4e0d\u5e38\u4f7f\u7528\u7684\u9875\u9762\u6362\u5230\u78c1\u76d8\u4e0a\uff0c\u628a\u6d3b\u52a8\u9875\u9762\u4fdd\u7559\u5728\u5185\u5b58\u4e2d\u4f9b\u8fdb\u7a0b\u4f7f\u7528\u3002\u4ea4\u6362\u6280\u672f\u662f\u5c06\u6574\u4e2a\u8fdb\u7a0b\uff0c\u800c\u4e0d\u662f\u90e8\u5206\u9875\u9762\uff0c\u5168\u90e8\u4ea4\u6362\u5230\u78c1\u76d8\u4e0a\u3002<\/p>\n \u5206\u9875(Page)\u5199\u5165\u78c1\u76d8\u7684\u8fc7\u7a0b\u88ab\u79f0\u4f5cPage-Out\uff0c\u5206\u9875(Page)\u4ece\u78c1\u76d8\u91cd\u65b0\u56de\u5230\u5185\u5b58\u7684\u8fc7\u7a0b\u88ab\u79f0\u4f5cPage-In\u3002\u5f53\u5185\u6838\u9700\u8981\u4e00\u4e2a\u5206\u9875\u65f6\uff0c\u4f46\u53d1\u73b0\u6b64\u5206\u9875\u4e0d\u5728\u7269\u7406\u5185\u5b58\u4e2d(\u56e0\u4e3a\u5df2\u7ecf\u88abPage-Out\u4e86)\uff0c\u6b64\u65f6\u5c31\u53d1\u751f\u4e86\u5206\u9875\u9519\u8bef\uff08Page Fault\uff09\u3002<\/p>\n \u5f53\u7cfb\u7edf\u5185\u6838\u53d1\u73b0\u53ef\u8fd0\u884c\u5185\u5b58\u53d8\u5c11\u65f6\uff0c\u5c31\u4f1a\u901a\u8fc7Page-Out\u6765\u91ca\u653e\u4e00\u90e8\u5206\u7269\u7406\u5185\u5b58\u3002\u7ecf\u7ba1Page-Out\u4e0d\u662f\u7ecf\u5e38\u53d1\u751f\uff0c\u4f46\u662f\u5982\u679cPage-out\u9891\u7e41\u4e0d\u65ad\u7684\u53d1\u751f\uff0c\u76f4\u5230\u5f53\u5185\u6838\u7ba1\u7406\u5206\u9875\u7684\u65f6\u95f4\u8d85\u8fc7\u8fd0\u884c\u7a0b\u5f0f\u7684\u65f6\u95f4\u65f6\uff0c\u7cfb\u7edf\u6548\u80fd\u4f1a\u6025\u5267\u4e0b\u964d\u3002\u8fd9\u65f6\u7684\u7cfb\u7edf\u5df2\u7ecf\u8fd0\u884c\u975e\u5e38\u6162\u6216\u8fdb\u5165\u6682\u505c\u72b6\u6001\uff0c\u8fd9\u79cd\u72b6\u6001\u4ea6\u88ab\u79f0\u4f5cthrashing(\u98a0\u7c38)\u3002<\/p>\n \u547d\u4ee4\u8be6\u89e3<\/strong><\/div>\n vmstat\u5e38\u7528\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a<\/strong><\/span><\/div>\n [cc]vmstat [-a] [-n] [-S unit] [delay [ count]] \u547d\u4ee4\u9009\u9879\u8bf4\u660e\u5982\u4e0b\uff1a<\/strong><\/span><\/div>\n [cc]-a\uff1a\u663e\u793a\u6d3b\u8dc3\u548c\u975e\u6d3b\u8dc3\u5185\u5b58 \u4e0b\u9762\u5c31\u5bf9\u6211\u4eec\u5e38\u7528\u7684\u4f7f\u7528\u65b9\u5f0f\u8fdb\u884c\u8be6\u7ec6\u7684\u603b\u7ed3\u3002<\/strong><\/div>\n \u4f7f\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n \u8f93\u5165\u547d\u4ee4\uff1a[cc]vmstat 1[\/cc]<\/p>\n \u8f93\u51fa\u7ed3\u679c\uff1a<\/strong><\/span><\/div>\n [cc]procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- \u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/span><\/div>\n [cc]procs\uff08\u8fdb\u7a0b\uff09 Linux\u547d\u4ee4\u5343\u5343\u4e07\uff0c\u800c\u6211\u4eec\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u771f\u771f\u5207\u5207\u7528\u5230\u7684\u547d\u4ee4\u5e94\u8be5\u4e0d\u8d85\u8fc750\u4e2a\uff0c\u5728\u63a5\u4e0b\u6765\u7684\u65e5\u5b50\u91cc\uff0c\u6211\u4f1a\u5bf9\u6211\u7ecf\u5e38\u4f7f\u7528 […]<\/p>\n","protected":false},"author":1893,"featured_media":133851,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-133848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/133848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1893"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=133848"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/133848\/revisions"}],"predecessor-version":[{"id":133904,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/133848\/revisions\/133904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/133851"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=133848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=133848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=133848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |