{"id":552330,"date":"2022-02-04T12:26:31","date_gmt":"2022-02-04T04:26:31","guid":{"rendered":"http:\/\/4563.org\/?p=552330"},"modified":"2022-02-04T12:26:31","modified_gmt":"2022-02-04T04:26:31","slug":"%e8%b6%85%e5%94%ae%e7%9a%84%e8%a7%a3%e9%87%8a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=552330","title":{"rendered":"\u8d85\u552e\u7684\u89e3\u91ca"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>philsilver<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u8d85\u552e\u7684\u89e3\u91ca<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 philsilver \u4e8e 2022-2-4 00:02 \u7f16\u8f91 <\/p>\n<p> \u865a\u62df\u5316\u6280\u672f\u5e26\u6765\u7684\u6700\u5927\u76f4\u63a5\u6536\u76ca\u662f\u670d\u52a1\u5668\u6574\u5408\uff08Server Consolidation\uff09, \u901a\u8fc7CPU, \u5185\u5b58\uff0c\u5b58\u50a8\uff0c\u7f51\u7edc\u7684\u8d85\u5206\u914d\uff08Overcommitment\uff09\u6280\u672f\uff0c\u6700\u5927\u5316\u670d\u52a1\u5668\u7684\u4f7f\u7528\u7387\u3002\u4e00\u822c\u4f01\u4e1a\u4f1a\u901a\u8fc7\u91c7\u8d2dVMware\u865a\u62df\u5316\u6765\u505a\u8d44\u6e90\u6574\u5408\uff0c\u800cAWS, \u963f\u91cc\u4e91\uff0cAzure\u7b49\u4e91\u63d0\u4f9b\u5546\u4e5f\u5206\u522b\u91c7\u7528\u4e86Xen\uff0c KVM\uff0cHyper-V\u865a\u62df\u5316\u6280\u672f\u7528\u4f5c\u5176\u57fa\u7840\u67b6\u6784\u4e2d\u7269\u7406\u8d44\u6e90\u6574\u5408\u3002<\/p>\n<p>  CPU\u8d85\u5206\u914d\u4e0eCPU\u8d85\u5356<br \/>  \u865a\u62df\u5316\u7684\u6280\u80fd\u4e4b\u4e00\u5c31\u662f\u968f\u5fc3\u6240\u6b32\u7684\u64cd\u63a7CPU, \u6bd4\u5982\uff0c\u5728\u4e00\u53f0\u670d\u52a1\u5668\u67092\u4e2aCPU\uff0c\u6bcfCPU 4\u4e2a\u8ba1\u7b97\u6838\u5fc3\uff0c\u865a\u62df\u5316\u80fd\u5728\u8fd9\u53f0\u670d\u52a1\u5668\u4e0a\u521b\u5efa10\u53f0\u751a\u81f320\u53f08\u4e2a\u8ba1\u7b97\u6838\u5fc3\u7684\u865a\u62df\u670d\u52a1\u5668\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u539f\u6765\u4e00\u53f0\u670d\u52a1\u5668\u7ed91\u4e2a\u7cfb\u7edf\u4f7f\u7528\uff0c\u73b0\u5728\u4e00\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u7ed910\u4e2a\u751a\u81f320\u4e2a\u7cfb\u7edf\u4f7f\u7528\uff0c\u8fd9\u53f0\u670d\u52a1\u5668\u7684\u4f7f\u7528\u7387\u4e0d\u9ad8\u624d\u602a\u3002\u5982\u679c\u6211\u4eec\u628a\u7269\u7406\u670d\u52a1\u5668\u60f3\u8c61\u6210\u4e00\u6761\u516c\u8def\uff0c\u4ee5\u524d\u8fd9\u6761\u8def\u4e0a\u53ea\u6709\u4e00\u8f86\u8f66\uff0c\u865a\u62df\u5316\u5176\u5b9e\u5e76\u6ca1\u6709\u62d3\u5bbd\u516c\u8def\uff0c\u53ea\u662f\u5141\u8bb8\u66f4\u591a\u7684\u8f66\u80fd\u5728\u8fd9\u6761\u516c\u8def\u4e0a\u540c\u65f6\u884c\u8fdb\uff0c\u4f46\u662f\uff0c\u5982\u679c\u8fd9\u6761\u516c\u8def\u7684\u8f66\u592a\u591a\u4e86\uff0c\u51fa\u73b0\u62e5\u5835\u4e5f\u5c31\u662f\u5f88\u6b63\u5e38\u7684\u4e8b\u60c5\u3002<\/p>\n<p>  \u516c\u6709\u4e91\u5356\u901a\u7528\u578b\u4e91\u670d\u52a1\u5668\u7684\u65f6\u5019\uff0c\u4e00\u822c\u90fd\u4f1a\u8d85\u5356CPU\uff0c\u6bd4\u5982\u4e00\u53f0\u7269\u7406\u670d\u52a1\u5668\u670932\u4e2a\u7269\u7406\u6838\u5fc3\uff0c\u5728\u8fd9\u53f0\u670d\u52a1\u5668\u4e0a\u53ef\u80fd\u4f1a\u6700\u591a\u521b\u5efa128\u4e2a1 VCPU\u7684\u865a\u62df\u673a\uff0c\u8fd9\u65f6\u5019\u7684CPU\u8d85**\u5c31\u662f1\uff1a4\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u540c\u5382\u5546\u540c\u89c4\u683c\u7684\u4e91\u670d\u52a1\u5668\u8d8a\u4fbf\u5b9c\uff0c\u8d85**\u8d8a\u9ad8\u3002<\/p>\n<p>  CPU\u8d85\u5206\u914d\u7684\u5f71\u54cd<br \/>  \u5982\u679c\u7269\u7406\u670d\u52a1\u5668\u7684\u8d44\u6e90\u8fd8\u6709\u5927\u91cf\u95f2\u7f6e\uff0cCPU\u8d85\u5206\u914d\u4e00\u822c\u4e0d\u4f1a\u5bf9\u8fd0\u884c\u5728\u865a\u62df\u673a\u4e2d\u7684\u4e1a\u52a1\u4ea7\u751f\u660e\u663e\u7684\u5f71\u54cd\uff0c\u4f46\u662f\u5982\u679c\u8fd9\u4e9b\u8d85\u5206\u914d\u7684VCPU\u5927\u90e8\u5206\u90fd\u5904\u4e8e\u9ad8\u538b\u529b\u72b6\u6001\uff0c\u7269\u7406\u670d\u52a1\u5668\u7684PCPU\u5df2\u7ecf\u63a5\u8fd1\u9971\u548c\uff0c\u90a3\u4e48\u5404\u865a\u62df\u673a\u7684VCPU\u5c31\u8981\u76f8\u4e92\u7ade\u4e89\uff0c\u76f8\u4e92\u7b49\u5f85\uff0c\u4ece\u800c\u5404\u865a\u62df\u673a\u4e2d\u4e1a\u52a1\u7684\u5ef6\u65f6\u589e\u52a0\uff0c\u541e\u5410\u91cf\u4e0b\u964d\u3002<\/p>\n<p>  \u5404\u4e91\u670d\u52a1\u5546\u80af\u5b9a\u4e0d\u4f1a\u5bf9\u5916\u516c\u5e03\u4ed6\u4eec\u7684\u7684CPU\u8d85\u5356\u65b9\u6848\uff0c\u4f46\u662f\u5bf9\u4e8e\u4e70\u5bb6\u6765\u8bb2\uff0c\u6211\u4eec\u80af\u5b9a\u4e0d\u5e0c\u671b\u9009\u5230\u4e00\u4e2a\u4e91\u670d\u52a1\u5668\uff0c\u7ed3\u679c\u5b83\u6210\u5929\u90fd\u5728\u548c\u5176\u5b83\u7684\u4e91\u670d\u52a1\u5668\u4e4b\u95f4\u6210\u5929\u76f8\u4e92\u7ade\u4e89\uff0c\u76f8\u4e92\u4f24\u5bb3\uff0c\u5f71\u54cd\u4e1a\u52a1\u3002<\/p>\n<p>  CPU Steal Time<br \/>  Linux\u7684top\u548ciostat\u547d\u4ee4\uff0c\u63d0\u4f9b\u4e86Steal Time \uff08st\uff09 \u6307\u6807\uff0c\u7528\u6765\u8861\u91cf\u88abHypervisor\u5077\u53bb\u7ed9\u5176\u5b83\u865a\u62df\u673a\u4f7f\u7528\u7684CPU\u65f6\u95f4\u6240\u5360\u7684\u6bd4\u4f8b\uff0c\u8fd9\u4e2a\u503c\u8d8a\u9ad8\uff0c\u8bf4\u660e\u8fd9\u53f0\u7269\u7406\u670d\u52a1\u5668\u7684\u8d44\u6e90\u7ade\u4e89\u8d8a\u6fc0\u70c8\uff0c\u8d2d\u4e70\u9700\u8c28\u614e\u3002<\/p>\n<p>  \u952e\u5165\u547d\u4ee4top \u5373\u53ef\u770b\u5230\u5982\u4e0b\u753b\u9762\uff0c\u5982\u679c\u670d\u52a1\u5668CPU\u4e3a\u591a\u6838\uff0c\u952e\u51651 \u5373\u53ef\u770b\u5230\u5404\u4e2a\u6838\u5fc3\u7684\u8be6\u7ec6\u6570\u636e<br \/>  \u8865\u5145\uff1a\u4e24\u4e2a\u4f60\u53ef\u80fd\u8f83\u4e3a\u719f\u6089\u7684\u662f %id(\u7a7a\u95f2 \u767e\u5206\u6bd4) \u548c %wa(I\/O \u7b49\u5f85 \u767e\u5206\u6bd4)\u3002 \u5982\u679c %id \u5f88\u4f4e\uff0c \u90a3\u4e48\u8bf4\u660eCPU\u7684\u5de5\u4f5c\u8d1f\u8f7d\u5f88\u5927\u5e76\u4e14\u6ca1\u6709\u591a\u5c11\u8ba1\u7b97\u8d1f\u8f7d\u80fd\u529b\u5269\u4f59\u3002 \u5982\u679c %wa \u5f88\u9ad8\uff0c\u5219\u8bf4\u660e\u74f6 CPU \u5904\u4e8e\u7b49\u5f85\u8ba1\u7b97\u7684\u72b6\u6001\uff0c\u4f46\u662f\u6b63\u5728\u7b49\u5f85I\/O\u6d3b\u52a8\u7684\u5b8c\u6210(\u7c7b\u4f3c \u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6\u5b58\u50a8\u5728 \u78c1\u76d8\u4e0a \u7684\u4e00\u884c\u6570\u636e)\u3002<\/p>\n<p>  %st\uff08percent steal time\uff09 \u662fCPU\u5c55\u793a\u7684\u6700\u540e\u4e00\u4e2a\u6027\u80fd\u6307\u6807\u3002<br \/>  iostat -c\u8f93\u51fasteal \u6307\u6807<\/p>\n<p>  CPU Steal Time\u8bd5\u9a8c<br \/>  \u5728PCPU 0-5\u4e0a\u540c\u65f6\u521b\u5efa\u4e24\u4e2a\u865a\u62df\u673a\uff0c\u4f7f\u7528lookbusy\u8f6f\u4ef6\u5bf9VM1\u76846\u4e2aCPU\u5206\u522b\u630920%\u9012\u589e\u52a0\u538b\uff0c\u5bf9VM2\u76846\u4e2aCPU\u90fd\u52a0\u538b\u523050%\uff0c\u53ef\u4ee5\u770b\u51fa\u8fd9\u65f6\u5019\u7684steal time\u6574\u4f53\u5c31\u5df2\u7ecf\u975e\u5e38\u9ad8\u4e86\uff0c\u5bf9\u4e8e\u6700\u540e\u4e00\u4e2acpu\uff0csteal time\u63a5\u8fd150%\uff0c\u8bf4\u660e\u8fd0\u884c\u5728\u8fd9\u4e2acpu\u4e0a\u7684\u4efb\u52a1\u6700\u5c11\u6bd4\u8fd0\u884c\u5728\u7269\u7406\u670d\u52a1\u5668\u4e0a\u589e\u52a0\u4e86\u5e73\u5747\u4e00\u500d\u7684\u5ef6\u65f6\u3002https:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6d6a\u5f97\u4e00\u4eba\u5fc3<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u522bbb\u8fd9\u4e48\u591a\uff0cyc004t<br \/>  \u8d85\u552e\u662f:\u8d85\u7ea7\u9e21\u4fbf\u5b9c\u51fa\u552e\u7684\u7f29\u5199<br \/>  \u4e13\u95e8\u7279\u4f9b\u4f20\u5bb6\u5b9d\u9e21\uff0c\u4ee5\u6700\u4f4e\u7684\u4ef7\u683c\u7ed9\u4f60\u6700\u9ad8\u914d\u7f6e\u7684\u9e21\u3002<br \/>  \u53ef\u4ee5\u4f20\u5bb6\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6ed1\u7a3d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u522b\u8bf4\u90a3\u4e9b\u516c\u6709\u4e91\u670d\u52a1\u4e86\uff0c\u54ea\u6015\u662f\u9ad8\u6821\u91cc\u81ea\u5efa\u7684\u79c1\u6709\u90e8\u7f72\u4e00\u6837\u4e5f\u6709\u8d85\u5206\u914d\uff0c\u4e0d\u8fc7\u4e00\u822c\u662f1\uff1a3\uff0c\u6bd4oneman\u597d\u4e00\u70b9\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ipssale<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e0d\u8d85\u552e\u4f60\u4ee5\u4e3a\u4e2a\u4e2a\u90fd\u505a\u597d\u4e8b\u554a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>konololi<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tCPU\u4e0d\u8d85\u517d\u90a3\u6027\u80fd\u66f4\u62c9\u57ae\u4e86\u554a\uff0c<br \/>  32U\u4e0d\u8d85\u517d\uff0c\u7ed9\u4f60\u5206\u914d\u6210128\u4e2a1\/4 U\u7684\u9e21\u5b50:lol\uff0c\u4f60\u53ef\u4ee5\u5168\u592924\u5c0f\u65f6\u7528\u6ee1\u8fd91\/4 U\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u54c8\u767b<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u54ea\u590d\u5236\u7c98\u8d34\u7684\u6587\u7ae0\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>philsilver \u5927\u4f6c\u6709\u8bdd\u8bf4 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/552330"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=552330"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/552330\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=552330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=552330"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=552330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}