{"id":10006929,"date":"2022-11-28T16:49:04","date_gmt":"2022-11-28T08:49:04","guid":{"rendered":"https:\/\/ityet.com\/?p=10006929"},"modified":"2022-11-28T16:49:04","modified_gmt":"2022-11-28T08:49:04","slug":"intel-pause-%e6%8c%87%e4%bb%a4%e5%8f%98%e5%8c%96%e5%a6%82%e4%bd%95%e5%bd%b1%e5%93%8d-mysql-%e7%9a%84%e6%80%a7%e8%83%bd","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006929","title":{"rendered":"Intel PAUSE \u6307\u4ee4\u53d8\u5316\u5982\u4f55\u5f71\u54cd MySQL \u7684\u6027\u80fd"},"content":{"rendered":"<h2>\u5bfc\u8bfb<\/h2>\n<p>x86\u3001arm\u6307\u4ee4\u90fd\u5f88\u591a\uff0c\u65e0\u8bba\u662f\u5e94\u7528\u7a0b\u5e8f\u5458\u8fd8\u662f\u6570\u636e\u5e93\u5185\u6838\u7814\u53d1\u5927\u591a\u65f6\u5019\u90fd\u4e0d\u9700\u8981\u5bf9\u8fd9\u4e9b\u6307\u4ee4\u6df1\u5165\u7406\u89e3\uff0c\u4f46\u662f Pause \u6307\u4ee4\u548c\u6570\u636e\u5e93\u64cd\u4f5c\u592a\u7d27\u5bc6\u4e86\uff0c\u672c\u6587\u901a\u8fc7\u4e00\u6b21\u975e\u5e38\u6709\u8da3\u7684\u6027\u80fd\u4f18\u5316\u6765\u5f15\u5165\u5bf9 Pause \u6307\u4ee4\u7684\u7406\u89e3\uff0c\u671f\u671b\u53ef\u4ee5\u4e8b\u534a\u529f\u500d\u5730\u641e\u6e05\u695a CPU\u6307\u4ee4\u96c6\u662f\u5982\u4f55\u5f71\u54cd\u4f60\u7684\u7a0b\u5e8f\u7684\u3002<\/p>\n<p>\u6587\u7ae0\u5206\u6210\u4e24\u5927\u90e8\u5206\uff0c\u7b2c\u4e00\u90e8\u5206\u662f MySQL \u96c6\u7fa4\u7684\u4e00\u6b21\u5168\u8868\u626b\u63cf\u6027\u80fd\u4f18\u5316\u8fc7\u7a0b\uff1b \u7b2c\u4e8c\u90e8\u5206\u662f\u95ee\u9898\u89e3\u51b3\u540e\u7684\u539f\u7406\u5206\u6790\u4ee5\u53caPause\u6307\u4ee4\u7684\u6765\u9f99\u53bb\u8109\u548c\u4f18\u7f3a\u70b9\u4ee5\u53ca\u5e94\u7528\u573a\u666f\u5206\u6790\u3002<\/p>\n<h2>\u4e1a\u52a1\u7ed3\u6784<\/h2>\n<p>\u4e3a\u7406\u89e3\u65b9\u4fbf\u505a\u4e86\u90e8\u5206\u7b80\u5316\uff1a<\/p>\n<p>client -&gt; Tomcat -&gt; LVS -&gt; MySQL\uff0832 \u4e2a MySQLD\u5b9e\u4f8b\u96c6\u7fa4\uff0c\u6bcf\u4e2a\u5b9e\u4f8b8Core\uff09<\/p>\n<h2>\u573a\u666f\u63cf\u8ff0<\/h2>\n<p>\u901a\u8fc7 client \u538b Tomcat \u548c MySQL \u96c6\u7fa4\uff08\u5bf9\u6570\u636e\u505a\u5206\u5e93\u5206\u8868\uff09\uff0cMySQL \u96c6\u7fa4\u662f32\u4e2a\u5b9e\u4f8b\uff0c\u6bcf\u4e2a\u4e1a\u52a1 SQL \u90fd\u9700\u8981\u7ecf\u8fc7 Tomcat \u62c6\u5206\u6210 256 \u4e2a SQL \u53d1\u9001\u7ed9 32 \u4e2aMySQL\uff08\u6bcf\u4e2aMySQL\u4e0a\u67098\u4e2a\u5206\u5e93\uff09\uff0c\u8fd9 256 \u6761\u4e0b\u53d1\u7ed9 MySQL \u7684 SQL \u4e0d\u662f\u5b8c\u5168\u4e32\u884c\uff0c\u4f46\u4e5f\u4e0d\u662f\u5b8c\u5168\u5e76\u884c\uff0c\u6709\u4e00\u5b9a\u7684\u5e76\u884c\u6027\u3002<\/p>\n<p>\u4e1a\u52a1 SQL \u5982\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684select sum\u6c42\u548c\uff0c\u8fd9\u4e2a SQL\u5728\u6bcf\u4e2aMySQL\u4e0a\u90fd\u5f88\u5feb\uff08\u6709\u7d22\u5f15\uff09<\/p>\n<pre><code>SELECT SUM(emp_arr_amt) FROM table_c WHERE INSUTYPE='310' AND Revs_Flag='Z' AND accrym='201910' AND emp_no='1050457';<\/code><\/pre>\n<h2>\u76d1\u63a7\u6307\u6807\u8bf4\u660e<\/h2>\n<ul>\n<li>\u540e\u8ff0\u6216\u8005\u622a\u56fe\u4e2d\u7684\u903b\u8f91RT\/QPS\u662f\u6307 client \u4e0a\u770b\u5230\u7684Tomcat\u7684 RT \u548c QPS\uff1b<\/li>\n<li>RT \uff1aresponse time \u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\uff0c\u5224\u65ad\u6027\u80fd\u74f6\u9888\u7684\u552f\u4e00\u6307\u6807;<\/li>\n<li>\u7269\u7406RT\/QPS\u662f\u6307Tomcat\u770b\u5230\u7684MySQL RT \u548cQPS\uff08\u8fd9\u91cc\u7684 RT \u662f\u6307\u5230\u8fbeTomcat\u8282\u70b9\u7f51\u5361\u7684 RT \uff0c\u6240\u4ee5\u8fd8\u5305\u542b\u4e86\u7f51\u7edc\u6d88\u8017\uff09<\/li>\n<\/ul>\n<p>\u95ee\u9898\u63cf\u8ff0\uff1a<\/p>\n<p>\u901a\u8fc7client\u538b\u4e00\u4e2aTomcat\u8282\u70b9+32\u4e2aMySQL\uff0cQPS\u5927\u6982\u662f430\uff0cTomcat\u8282\u70b9CPU\u8dd1\u6ee1\uff0cMySQL RT \u662f0.5ms\uff0c\u589e\u52a0\u4e00\u4e2aTomcat\u8282\u70b9\uff0cQPS\u5927\u6982\u662f700\uff0cTomcat CPU\u63a5\u8fd1\u8dd1\u6ee1\uff0cMySQL RT \u662f0.6ms\uff0c\u5230\u8fd9\u91cc\u6027\u80fd\u57fa\u672c\u968f\u7740\u6269\u5bb9\u7ebf\u6027\u589e\u52a0\uff0c\u662f\u7b26\u5408\u9884\u671f\u7684\u3002<\/p>\n<p>\u7ee7\u7eed\u589e\u52a0Tomcat\u8282\u70b9\u6765\u6a2a\u5411\u6269\u5bb9\u6027\u80fd\uff0c\u901a\u8fc7client\u538b\u4e09\u4e2aTomcat\u8282\u70b9+32\u4e2aMySQL\uff0cQPS\u8fd8\u662f700\uff0cTomcat\u8282\u70b9CPU\u8dd1\u4e0d\u6ee1\uff0cMySQL RT \u662f0.8ms\uff0c\u8fd9\u5c31\u4e25\u91cd\u4e0d\u7b26\u5408\u9884\u671f\u4e86\u3002<\/p>\n<p><strong>\u6027\u80fd\u538b\u6d4b\u539f\u5219\uff1a<\/strong><\/p>\n<p>\u52a0\u5e76\u53d1QPS\u4e0d\u518d\u4e0a\u5347\u8bf4\u660e\u5230\u4e86\u67d0\u4e2a\u74f6\u9888\uff0c\u54ea\u4e2a\u73af\u8282RT\u589e\u52a0\u6700\u591a\u74f6\u9888\u5c31\u5728\u54ea\u91cc<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915321\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u5230\u8fd9\u91cc\u4e00\u5207\u90fd\u8fd8\u662f\u7b26\u5408\u6211\u4eec\u7684\u7ecf\u9a8c\u7684\uff0c\u770b\u8d77\u6765\u5c31\u662f MySQL \u6709\u74f6\u9888\uff08RT \u589e\u52a0\u660e\u663e\uff09\u3002<\/p>\n<h2>\u6392\u67e5 MySQL<\/h2>\n<p>\u73b0\u573aDBA\u901a\u8fc7\u76d1\u63a7\u770b\u5230MySQL CPU\u4e0d\u523020%\uff0c\u6ca1\u6709\u6162\u67e5\u8be2\uff0c\u5e76\u4e14\u5c1d\u8bd5\u7528client\u8d8a\u8fc7\u6240\u6709\u4e2d\u95f4\u73af\u8282\u76f4\u63a5\u538b\u5176\u4e2d\u4e00\u4e2aMySQL\uff0c\u53ef\u4ee5\u5c06 MySQL CPU \u8dd1\u6ee1\uff0c\u8fd9\u65f6\u7684QPS\u5927\u6982\u662f38000\uff08\u5bf9\u5e94\u4e0a\u9762\u7684\u573a\u666fclient QPS\u4e3a700\u7684\u65f6\u5019\uff0c\u5355\u4e2aMySQL\u4e0a\u7684QPS\u624d\u8dd1\u52306000) \u6240\u4ee5\u6392\u9664\u4e86MySQL\u7684\u5acc\u7591(\u8fd9\u4e2a\u63a8\u7406\u4e0d\u591f\u4e25\u8c28\u4e3a\u540e\u9762\u6392\u67e5\u57cb\u4e0b\u4e86\u5927\u5751)\u3002<\/p>\n<p>\u90a3\u4e48\u63a5\u4e0b\u6765\u7684\u5acc\u7591\u5728\u7f51\u7edc\u3001LVS \u7b49\u4e2d\u95f4\u73af\u8282\u4e0a\u3002<\/p>\n<h2>LVS\u548c\u7f51\u7edc\u7684\u5acc\u7591<\/h2>\n<p>\u9996\u5148\u901a\u8fc7\u5927\u67e5\u8be2\u6392\u9664\u4e86\u5e26\u5bbd\u7684\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u91cc\u90fd\u662f\u5c0f\u5305\uff0cpps\u5230\u4e8672\u4e07\uff0c\u5f88\u81ea\u7136\u60f3\u5230\u4e86\u7f51\u5173\u3001LVS\u7684\u9650\u6d41\u4e4b\u7c7b\u7684pps\u76d1\u63a7\uff0c\u8fd9\u53f0\u7269\u7406\u673a\u67094\u4e2aMySQL\u5b9e\u4f8b\u4e0a\uff0cpps 9\u4e07\u5de6\u53f3\uff0c9*32\/4=72\u4e07<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915322\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u6700\u7ec8\u6240\u6709\u7f51\u7edc\u56e0\u7d20\u90fd\u88ab\u6392\u9664\uff0c\u6838\u5fc3\u8bc1\u636e\u662f\uff1a\u505a\u538b\u6d4b\u7684\u65f6\u5019\u53cd\u590d\u4ece Tomcat \u4e0a ping \u540e\u9762\u7684MySQL\uff0cRT \u8ddf\u6ca1\u6709\u538b\u529b\u7684\u65f6\u5019\u4e00\u6837\uff0c\u4e5f\u8bf4\u660e\u4e86\u7f51\u7edc\u6ca1\u6709\u95ee\u9898(\u8bf7\u601d\u8003\u8fd9\u4e2a ping \u7684\u4f5c\u7528)\u3002<\/p>\n<h2>\u95ee\u9898\u7684\u786e\u8ba4<\/h2>\n<p>\u5c1d\u8bd5\u5728Tomcat\u4e0a\u6253\u5f00\u65e5\u5fd7\uff0c\u5e76\u5c06\u6162 SQL \u9608\u503c\u8bbe\u7f6e\u4e3a100ms\uff0c\u8fd9\u4e2a\u65f6\u5019\u786e\u5b9e\u80fd\u4ece\u65e5\u5fd7\u4e2d\u770b\u5230\u5927\u91cfMySQL\u4e0a\u7684\u6162\u67e5\u8be2\uff0c\u56e0\u4e3a\u8fd9\u4e2aSQL\u9700\u8981\u5728Tomcat\u4e0a\u505a\u62c6\u5206\u6210256\u4e2aSQL\uff0c\u540c\u65f6\u4e0b\u53d1\uff0c\u4e00\u65e6\u6709\u4e00\u4e2aSQL\u8fd4\u56de\u6162\uff0c\u6574\u4e2a\u8bf7\u6c42\u5c31\u56e0\u4e3a\u8fd9\u4e2a\u77ed\u677f\u88ab\u62d6\u7d2f\u4e86\u3002\u5e73\u5747 RT 0.8ms\uff0c\u4f46\u662f\u7ecf\u5e38\u6709\u8d85\u8fc7100ms\u7684\u8bdd\u5bf9\u6574\u4f53\u5f71\u54cd\u8fd8\u662f\u5f88\u5927\u7684\u3002<\/p>\n<p>\u5c06Tomcat\u8bb0\u5f55\u4e0b\u6765\u7684\u6162\u67e5\u8be2\uff08Tomcat\u589e\u52a0\u4e86\u4e00\u4e2a\u552f\u4e00id\u4e0b\u53d1\u7ed9MySQL\uff09\u5230MySQL\u65e5\u5fd7\u4e2d\u67e5\u627e\uff0c\u679c\u7136\u53d1\u73b0MySQL\u4e0a\u786e\u5b9e\u6162\u4e86\uff0c\u6240\u4ee5\u5230\u8fd9\u91cc\u57fa\u672c\u786e\u8ba4\u662fMySQL\u7684\u95ee\u9898\uff0c\u7ec8\u4e8e\u4e0d\u7528\u518d\u7ea0\u7ed3\u662f\u5426\u662f\u7f51\u7edc\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u540c\u65f6\u5728Tomcat\u8fdb\u884c\u6293\u5305\uff0c\u5bf9\u7f51\u5361\u4e0a\u7684 RT \u8fdb\u884c\u7edf\u8ba1\u5206\u6790\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915323\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u4e0a\u662fTomcat\u4e0a\u6293\u5230\u7684\u6bcf\u4e2asql\u7684\u7269\u7406RT \u5e73\u5747\u503c\uff0c\u4e0a\u9762\u662fQPS 430\u7684\u65f6\u5019\uff0c RT 0.6ms\uff0c\u4e0b\u9762\u662f3\u4e2aserver\uff0cQPS\u4e3a700\uff0c\u4f46\u662f RT \u4e0a\u5347\u5230\u4e860.9ms\uff0c\u57fa\u672c\u8ddfTomcat\u76d1\u63a7\u8bb0\u5f55\u5230\u7684\u7269\u7406RT\u4e00\u81f4\u3002\u5982\u679cMySQL\u4e0a\u4e5f\u6709\u7c7b\u4f3c\u6293\u5305\u8ba1\u7b97 RT \u65f6\u95f4\u7684\u8bdd\u53ef\u4ee5\u5feb\u901f\u6392\u9664\u7f51\u7edc\u95ee\u9898\u3002<\/p>\n<p>\u7f51\u7edc\u6293\u5305\u5f97\u5230\u7684 RT \u6570\u636e\u66f4\u5bb9\u6613\u88ab\u6240\u6709\u4eba\u63a5\u53d7\u3002\u5c1d\u8bd5\u8fc7\u5728MySQL\u4e0a\u6293\u5305\uff0c\u4f46\u662f\u56e0\u4e3aLVS\u6a21\u5757\u7684\u539f\u56e0\uff0c\u8fdb\u51fa\u7aef\u53e3\u3001ip\u90fd\u88ab\u4fee\u6539\u8fc7\uff0c\u6240\u4ee5\u6ca1\u6cd5\u5206\u6790\u4e00\u4e2a\u6d41\u7684\u54cd\u5e94\u65f6\u95f4\u3002<\/p>\n<p>\u91cd\u5fc3\u518d\u6b21\u8f6c\u5411MySQL<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\u56e0\u4e3a\u95ee\u9898\u70b9\u57fa\u672c\u786e\u8ba4\uff0c\u518d\u53bb\u67e5\u770bMySQL\u662f\u5426\u6709\u95ee\u9898\u7684\u91cd\u5fc3\u90fd\u4e0d\u4e00\u6837\u4e86\uff0c\u4e0d\u518d\u53ea\u662f\u770b\u770bCPU\u548c\u6162\u67e5\u8be2\uff0c\u8fd9\u4e2a\u95ee\u9898\u660e\u663e\u66f4\u590d\u6742\u4e00\u4e9b\u3002<\/p>\n<p>\u6559\u8bad\uff1aCPU\u53ea\u662f\u5f71\u54cd\u6027\u80fd\u7684\u4e00\u4e2a\u56e0\u7d20\uff0cRT \u624d\u662f\u7ed3\u679c\uff0c\u8981\u8ffd\u7740 RT \u8dd1\uff0c\u800c\u4e0d\u662f\u53ea\u770b CPU\u3002<\/p>\n<p>\u901a\u8fc7\u76d1\u63a7\u53d1\u73b0MySQL CPU\u867d\u7136\u4e00\u76f4\u4e0d\u9ad8\uff0c\u4f46\u662f\u7ecf\u5e38\u770b\u5230running thread\u98d9\u5230100\u591a\uff0c\u5f88\u5feb\u53c8\u964d\u4e0b\u53bb\u4e86\uff0c\u770b\u8d77\u6765\u50cf\u662f\u7a81\u53d1\u6027\u7684\u5e76\u53d1\u67e5\u8be2\u8bf7\u6c42\u592a\u591a\u5bfc\u81f4\u4e86\u6392\u961f\u7b49\u5f85\uff0c\u6bcf\u4e2aMySQL\u5b9e\u4f8b\u662f8Core\u7684CPU\uff0c\u5c1d\u8bd5\u5c06MySQL\u5b9e\u4f8b\u6269\u5bb9\u523016Core\uff08\u53ea\u662f\u4e3a\u4e86\u9a8c\u8bc1\u8fd9\u4e2a\u95ee\u9898\uff09\uff0cQPS\u786e\u5b9e\u53ef\u4ee5\u4e0a\u5347\u52301000\uff08\u6ca1\u6709\u5230\u8fbe\u7406\u60f3\u76841400\uff09\u3002<\/p>\n<p>\u8fd9\u662fTomcat\u4e0a\u76d1\u63a7\u5230\u7684MySQL\u72b6\u6001\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915324\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u540c\u65f6\u5728MySQL\u673a\u5668\u4e0a\u901a\u8fc7vmstat\u4e5f\u53ef\u4ee5\u770b\u5230\u8fd9\u79cd\u98d9\u5347\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915325\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u4ee5\u4e0a\u5206\u6790\u53ef\u4ee5\u6e05\u6670\u770b\u5230\u867d\u7136 MySQL \u6574\u4f53\u538b\u529b\u4e0d\u5927\uff0c\u4f46\u662f\u4f3c\u4e4e\u4f1a\u5076\u5c14\u6765\u4e00\u6ce2\u5361\u987f\u3001running \u4efb\u52a1\u98d9\u5347\u3002<\/p>\n<p>\u50cf\u8fd9\u79cd\u77ed\u6682\u7a81\u53d1\u6027\u7684\u5e76\u53d1\u6d41\u91cf\u4f3c\u4e4e\u76d1\u63a7\u90fd\u5f88\u96be\u770b\u5230\uff08\u57fa\u672c\u90fd\u88ab\u5e73\u5747\u6389\u4e86\uff09\uff0c\u53ea\u6709\u4e00\u4e9b\u5b9e\u65f6\u6027\u76d1\u63a7\u5076\u5c14\u4f1a\u91c7\u96c6\u5230\u8fd9\u79cd\u77ed\u6682\u7a81\u53d1\u6027\u98d9\u5347\uff0c\u8fd9\u4e5f\u5bfc\u81f4\u4e86\u4e00\u5f00\u59cb\u5ffd\u89c6\u4e86MySQL\u3002<\/p>\n<p>\u6240\u4ee5\u63a5\u4e0b\u6765\u7684\u6838\u5fc3\u95ee\u9898\u5c31\u662fMySQL\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u98d9\u5347\u3001\u8fd9\u79cd\u98d9\u5347\u7684\u5f71\u54cd\u5230\u5e95\u662f\u4ec0\u4e48\uff1f<\/p>\n<h2>perf top<\/h2>\n<p>\u76f4\u63a5\u7528 perf \u770b\u4e0b MySQLD \u8fdb\u7a0b\uff0c\u53d1\u73b0 ut_delay \u9ad8\u5f97\u4e0d\u7b26\u5408\u903b\u8f91\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915326\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u5c55\u5f00\u770b\u4e00\u4e0b\uff0c\u57fa\u672c\u662f\u5728\u4f18\u5316\u5668\u4e2d\u505a\u7d22\u5f15\u547d\u4e2d\u884c\u6570\u7684\u9009\u62e9\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915327\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u8ddf\u76f4\u63a5\u5728 MySQL \u547d\u4ee4\u884c\u4e2d\u901a\u8fc7 show processlist\u770b\u5230\u7684\u57fa\u672c\u4e00\u81f4\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915328\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u8fd9\u662f MySQL \u7684\u4f18\u5316\u5668\u5728\u5bf9\u7d22\u5f15\u8fdb\u884c\u7edf\u8ba1\uff0c\u7edf\u8ba1\u7684\u65f6\u5019\u8981\u52a0\u9501\uff0cthread running \u6296\u52a8\u7684\u65f6\u5019\u901a\u8fc7 show processlist \u770b\u5230\u5f88\u591a thread\u5904\u4e8e statistics \u72b6\u6001\u3002\u4e5f\u5c31\u662f\u9ad8\u5e76\u53d1\u4e0b\u52a0\u9501\u5f71\u54cd\u4e86 CPU \u538b\u4e0d\u4e0a\u53bb\u540c\u65f6 RT \u5267\u70c8\u589e\u52a0\u3002<\/p>\n<p>\u8fd9\u91ccut_delay \u6d88\u8017\u4e86 28% \u7684 CPU \u80af\u5b9a\u592a\u4e0d\u6b63\u5e38\u4e86\uff0c\u4e8e\u662f\u5c06 innodb_spin_wait_delay \u4ece 30 \u6539\u6210 6 \u540e\u6027\u80fd\u7acb\u5373\u4e0a\u53bb\u4e86\uff0c\u7ee7\u7eed\u589e\u52a0 Tomcat \u8282\u70b9\uff0cQPS\u4e5f\u53ef\u4ee5\u7ebf\u6027\u589e\u52a0\u3002<\/p>\n<p>\u8017CPU\u6700\u9ad8\u7684\u8c03\u7528\u51fd\u6570\u6808\u662f\u2026mutex_spin_wait-&gt;ut_delay\uff0c\u5c5e\u4e8e\u9501\u7b49\u5f85\u7684\u903b\u8f91\u3002InnoDB\u5728\u8fd9\u91cc\u7528\u7684\u662f\u81ea\u65cb\u9501\uff0c\u9501\u7b49\u5f85\u662f\u901a\u8fc7\u8c03\u7528 ut_delay \u8ba9 CPU\u505a\u7a7a\u5faa\u73af\u5728\u7b49\u9501\u7684\u65f6\u5019\u4e0d\u91ca\u653eCPU\u4ece\u800c\u907f\u514d\u4e0a\u4e0b\u6587\u5207\u6362\uff0c\u4f1a\u6d88\u8017\u6bd4\u8f83\u9ad8\u7684CPU\u3002<\/p>\n<h2>\u6700\u7ec8\u7684\u6027\u80fd<\/h2>\n<p>\u8c03\u6574\u53c2\u6570 innodb_spin_wait_delay=6 \u540e\u57284\u4e2aTomcat\u8282\u70b9\u4e0b\uff0c\u5e76\u53d140\u65f6\uff0cQPS\u8dd1\u5230\u4e861700\uff0c\u7269\u7406RT\uff1a0.7\uff0c\u903b\u8f91RT\uff1a19.6\uff0ccpu\uff1a90%\uff0c\u8fd9\u4e2a\u65f6\u5019\u53ea\u9700\u8981\u7ee7\u7eed\u6269\u5bb9 Tomcat \u8282\u70b9\u7684\u6570\u91cf\u5c31\u53ef\u4ee5\u589e\u52a0QPS<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915329\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u518d\u8ddf\u8c03\u6574\u524d\u6bd4\u8f83\u4e00\u4e0b\uff0cinnodb_spin_wait_delay=30\uff0c\u5e76\u53d140\u65f6\uff0cQPS 500+\uff0c\u7269\u7406RT\uff1a2.6ms \u903b\u8f91RT\uff1a72.1ms cpu\uff1a37%<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915330\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u518d\u770b\u770b\u8c03\u6574\u524d\u538b\u6d4b\u7684\u65f6\u5019\u7684vmstat\u548ctsar &#8211;cpu\uff0c\u53ef\u4ee5\u770b\u5230process running\u6296\u52a8\u660e\u663e<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915331\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u5bf9\u6bd4\u4fee\u6539delay\u540e\u7684process running\u5c31\u5f88\u7a33\u5b9a\u4e86\uff0c\u5373\u4f7fQPS\u5927\u4e863\u500d<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915332\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u4e8b\u540e\u601d\u8003\u548c\u5206\u6790<\/h2>\n<p>\u5230\u8fd9\u91cc\u95ee\u9898\u5f97\u5230\u4e86\u5b8c\u7f8e\u89e3\u51b3\uff0c\u4f46\u662f\u4e0d\u7981\u8981\u95ee\u4e3a\u4ec0\u4e48\uff1fut_delay \u662f\u600e\u4e48\u5de5\u4f5c\u7684\uff1f \u548c innodb_spin_wait_delay \u4ee5\u53ca\u81ea\u65cb\u9501\u7684\u5173\u7cfb\uff1f<\/p>\n<h2>\u539f\u7406\u89e3\u6790\u65e2<\/h2>\n<p>\u7136\u8c03\u6574 innodb_spin_wait_delay \u5c31\u80fd\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u90a3\u5c31\u8981\u5148\u5206\u6790\u4e00\u4e0b innodb_spin_wait_delay \u7684\u4f5c\u7528<\/p>\n<h2>\u5173\u4e8e innodb_spin_wait_delay<\/h2>\n<p>innodb\u901a\u8fc7\u5927\u91cf\u7684\u81ea\u65cb\u9501(\u6bd4\u5982 InnoDB mutexes and rw-locks)\u6765\u7528\u9ad8CPU\u6d88\u8017\u907f\u514d\u4e0a\u4e0b\u6587\u5207\u6362\uff0c\u8fd9\u662f\u81ea\u65cb\u9501\u7684\u6b63\u786e\u4f7f\u7528\u65b9\u5f0f\uff0c\u5728\u591a\u6838\u573a\u666f\u4e0b\uff0c\u5b83\u4eec\u4e00\u8d77\u81ea\u65cb\u62a2\u540c\u4e00\u4e2a\u9501\uff0c\u5bb9\u6613\u9020\u6210cache ping-pong\uff0c\u8fdb\u800c\u591a\u4e2aCPU\u6838\u4e4b\u95f4\u4f1a\u4e92\u76f8\u4f7f\u5bf9\u65b9\u7f13\u5b58\u90e8\u5206\u65e0\u6548\u3002\u6240\u4ee5\u8fd9\u91ccinnodb\u901a\u8fc7\u589e\u52a0 innodb_spin_wait_delay \u548c Pause \u914d\u5408\u6765\u7f13\u89e3cache ping-pong\uff0c\u4e5f\u5c31\u662f\u672c\u6765\u901a\u8fc7CPU \u9ad8\u901f\u81ea\u65cb\u62a2\u9501\uff0c\u6362\u6210\u4e86\u62a2\u9501\u5931\u8d25\u540e delay\u4e00\u4e0b\uff08Pause\uff09\u4f46\u662f\u4e0d\u91ca\u653eCPU\uff0cdelay \u65f6\u95f4\u5230\u540e\u7ee7\u7eed\u62a2\u9501\uff0c\u4e5f\u5c31\u662f\u628a\u8fde\u7eed\u7684\u81ea\u65cb\u62a2\u9501\u8f6c\u6362\u6210\u4e86\u66f4\u7a00\u758f\u7684\u70b9\u72b6\u7684\u62a2\u9501\uff08\u95f4\u9694\u7684 delay\u662f\u4e2a\u968f\u673a\u6570\uff09\uff0c\u8fd9\u6837\u4e0d\u4f46\u907f\u514d\u4e86\u4e0a\u4e0b\u6587\u5207\u6362\u4e5f\u5927\u5927\u51cf\u5c11\u4e86cache ping-pong\u3002<\/p>\n<h2>\u81ea\u65cb\u9501\u5982\u4f55\u51cf\u5c11\u4e86cache ping-pong<\/h2>\n<p>\u591a\u7ebf\u7a0b\u7ade\u4e89\u9501\u7684\u65f6\u5019\uff0c\u52a0\u9501\u5931\u8d25\u7684\u7ebf\u7a0b\u4f1a\u201c\u5fd9\u7b49\u5f85\u201d\uff0c\u76f4\u5230\u5b83\u62ff\u5230\u9501\u3002\u4ec0\u4e48\u53eb\u201c\u5fd9\u7b49\u5f85\u201d\u5462\uff1f\u5b83\u5e76\u4e0d\u610f\u5473\u7740\u4e00\u76f4\u6267\u884c CAS \u51fd\u6570\uff0c\u800c\u662f\u4f1a\u4e0e CPU \u7d27\u5bc6\u914d\u5408 \uff0c\u5b83\u901a\u8fc7 CPU \u63d0\u4f9b\u7684 PAUSE \u6307\u4ee4\uff0c\u51cf\u5c11\u5faa\u73af\u7b49\u5f85\u65f6\u7684cache ping-pong\u548c\u8017\u7535\u91cf\uff1b\u5bf9\u4e8e\u5355\u6838 CPU\uff0c\u5fd9\u7b49\u5f85\u5e76\u6ca1\u6709\u610f\u4e49\uff0c\u6b64\u65f6\u5b83\u4f1a\u4e3b\u52a8\u628a\u7ebf\u7a0b\u4f11\u7720\u3002<\/p>\n<h2>X86 PAUSE \u6307\u4ee4<\/h2>\n<p>X86\u8bbe\u8ba1\u4e86Pause\u6307\u4ee4\uff0c\u4e5f\u5c31\u662f\u8c03\u7528 Pause \u6307\u4ee4\u7684\u4ee3\u7801\u4f1a\u62a2\u7740 CPU \u4e0d\u91ca\u653e\uff0c\u4f46\u662fCPU \u4f1a\u6253\u4e2a\u76f9\uff0c\u6bd4\u5982 10\u4e2a\u65f6\u949f\u5468\u671f\uff0c\u76f8\u5bf9\u4e00\u6b21\u4e0a\u4e0b\u6587\u5207\u6362\u662f\u5927\u51e0\u5343\u4e2a\u65f6\u949f\u5468\u671f\u3002<\/p>\n<p>\u8fd9\u6837\u5e94\u7528\u4e00\u65e6\u81ea\u65cb\u62a2\u9501\u5931\u8d25\u53ef\u4ee5\u5148 Pause \u4e00\u4e0b\uff0c\u53ea\u662f\u8fd9\u4e2aPause \u65f6\u95f4\u5bf9\u4e8e MySQL \u6765\u8bf4\u8fd8\u4e0d\u591f\u4e45\uff0c\u6240\u4ee5\u9700\u8981\u589e\u52a0\u53c2\u6570 innodb_spin_wait_delay \u6765\u5c06\u4f11\u606f\u65f6\u95f4\u653e\u5927\u4e00\u4e9b\u3002<\/p>\n<p>\u5728\u6211\u4eec\u7684\u8fd9\u4e2a\u573a\u666f\u4e0b\u5bf9\u6bcf\u4e2a SQL\u7684 RT \u6296\u52a8\u975e\u5e38\u654f\u611f\uff08\u653e\u5927256\u500d\uff09\uff0c\u6240\u4ee5\u8fc7\u9ad8\u7684 delay \u4f1a\u5bfc\u81f4\u90e8\u5206SQL RT \u53d8\u9ad8\u3002\u51fd\u6570 ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)) \u7528\u6765\u6267\u884c\u8fd9\u4e2adelay\uff1a<\/p>\n<pre><code>\/***************************MySQL\u4ee3\u7801****************************\/\/**\nRuns an idle loop on CPU. The argument gives the desired delay\nin microseconds on 100 MHz Pentium + Visual C++.\n@return dummy value *\/\nUNIV_INTERN\nulint\nut_delay(ulint delay)  \/\/delay \u662f[0,innodb_spin_wait_delay)\u4e4b\u95f4\u7684\u4e00\u4e2a\u968f\u673a\u6570\n{\n        ulint   i, j;<\/code><\/pre>\n<p>UT_LOW_PRIORITY_CPU();<\/p>\n<pre><code>j = 0;\n \n       for (i = 0; i &lt; delay * 50; i++) {  \/\/delay \u653e\u592750\u500d\n               j += i;\n               UT_RELAX_CPU();             \/\/\u8c03\u7528 CPU Pause\n       }\n \n       UT_RESUME_PRIORITY_CPU();\n \n       return(j);\n}<\/code><\/pre>\n<p>innodb_spin_wait_delay\u7684\u9ed8\u8ba4\u503c\u4e3a6. spin \u7b49\u5f85\u5ef6\u8fdf\u662f\u4e00\u4e2a\u52a8\u6001\u5168\u5c40\u53c2\u6570\uff0c\u60a8\u53ef\u4ee5\u5728MySQL\u9009\u9879\u6587\u4ef6\uff08my.cnf\u6216my.ini\uff09\u4e2d\u6307\u5b9a\u8be5\u53c2\u6570\uff0c\u6216\u8005\u5728\u8fd0\u884c\u65f6\u4f7f\u7528SET GLOBAL \u6765\u4fee\u6539\u3002\u5728\u6211\u4eec\u7684MySQL\u914d\u7f6e\u4e2d\u9ed8\u8ba4\u6539\u6210\u4e8630\uff0c\u5bfc\u81f4\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<h2>CPU \u4e3a\u4ec0\u4e48\u8981\u6709Pause<\/h2>\n<p>\u9996\u5148\u53ef\u4ee5\u770b\u5230 Pause\u6307\u4ee4\u7684\u4f5c\u7528\uff1a<\/p>\n<ul>\n<li>\u907f\u514d\u4e0a\u4e0b\u6587\u5207\u6362\uff0c\u5e94\u7528\u5c42\u60f3\u8981\u4f11\u606f\u53ef\u80fd\u4f1a\u7528yield\u3001sleep\uff0c\u8fd9\u4e24\u64cd\u4f5c\u5bf9\u4e8eCPU\u6765\u8bf4\u592a\u91cd\u4e86(\u4f34\u968f\u4e0a\u4e0b\u6587\u5207\u6362)<\/li>\n<li>\u80fd\u7ed9\u8d85\u7ebf\u7a0b\u817e\u51fa\u8ba1\u7b97\u80fd\u529b\uff08HT\u5171\u4eab\u6838\uff0c\u4f46\u662f\u6709\u5355\u72ec\u7684\u5bc4\u5b58\u5668\u7b49\u5b58\u50a8\u5355\u5143\uff0cCPU Pause\u7684\u65f6\u5019\uff0c\u5bf9\u5e94\u7684HT\u53ef\u4ee5\u5360\u7528\u8ba1\u7b97\u8d44\u6e90\uff09\uff0c\u6bd4\u5982\u540c\u4e00\u4e2acore\u4e0a\u5148\u8dd1\u591a\u4e2aPause\uff0c\u540c\u65f6\u518d\u8dd1 nop \u6307\u4ee4\uff0c\u8fd9\u65f6 nop\u6307\u4ee4\u7684 IPC\u57fa\u672c\u4e0d\u53d7Pause\u7684\u5f71\u54cd<\/li>\n<li>\u8282\u80fd\uff08CPU\u53ef\u4ee5\u4f11\u606f\u3001\u4f46\u662f\u4e0d\u8ba9\u51fa\u6765\uff09\uff0cCPU Pause \u7684\u65f6\u5019\u4f60\u4ece top \u80fd\u770b\u5230 CPU 100%\uff0c\u4f46\u662f\u4e0d\u8017\u80fd\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u6709\u4e86 Pause \u6307\u4ee4\u540e\u80fd\u591f\u63d0\u9ad8\u8d85\u7ebf\u7a0b\u7684\u5229\u7528\u7387,\u8282\u80fd\uff0c\u51cf\u5c11\u4e0a\u4e0b\u6587\u5207\u6362\u63d0\u9ad8\u81ea\u65cb\u9501\u7684\u6548\u7387\u3002<\/p>\n<blockquote><p>The PAUSE instruction is first introduced for Intel Pentium 4 processor to improve the performance of \u201cspin-wait loop\u201d. The PAUSE instruction is typically used with software threads executing on two logical processors located in the same processor core, waiting for a lock to be released. Such short wait loops tend to last between tens and a few hundreds of cycles. When the wait loop is expected to last for thousands of cycles or more, it is preferable to yield to the operating system by calling one of the OS synchronization API functions, such as WaitForSingleObject on Windows OS.An Intel\u00ae processor suffers a severe performance penalty when exiting the loop because it detects a possible memory order violation. The PAUSE instruction provides a hint to the processor that the code sequence is a spin-wait loop. The processor uses this hint to avoid the memory order violation in most situations. The PAUSE instruction can improve the performance of the processors supporting Intel Hyper-Threading Technology when executing \u201cspin-wait loops\u201d. With Pause instruction, processors are able to avoid the memory order violation and pipeline flush, and reduce power consumption through pipeline stall.<\/p><\/blockquote>\n<p>\u4eceintel sdm\u624b\u518c\u4ee5\u53ca\u5b9e\u9645\u6d4b\u8bd5\u9a8c\u8bc1\u6765\u770b\uff0cPause \u6307\u4ee4\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\uff0c\u57fa\u672c\u4e0d\u5360\u7528\u6d41\u6c34\u7ebf\u6267\u884c\u8d44\u6e90\u3002<\/p>\n<p>Skylake \u67b6\u6784\u76848163 \u548c Broadwell\u67b6\u6784 E5-2682 CPU\u578b\u53f7\u7684\u4e0d\u540c<\/p>\n<p>\u4e3a\u4ec0\u4e48\u7528\u5f97\u597d\u597d\u7684 innodb_spin_wait_delay \u53c2\u6570\u8fd9\u6b21\u5c31\u4e0d\u884c\u4e86\u5462\uff1f<\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u4ee5\u524d\u4e1a\u52a1\u4e00\u76f4\u4f7f\u7528\u7684\u662f E5-2682 CPU\uff0c\u8fd9\u6b21\u7528\u7684\u662f\u65b0\u4e00\u4ee3\u67b6\u6784\u7684 Skylake 8163\uff0c\u90a3\u8fd9\u4e24\u6b3eCPU\u5728\u8fd9\u91cc\u7684\u6838\u5fc3\u5dee\u522b\u662f\uff1f<\/p>\n<p>\u5728Intel 64-ia-32-architectures-optimization-manual\u624b\u518c\u4e2d\u63d0\u5230\uff1a<\/p>\n<blockquote><p>The latency of the PAUSE instruction in prior generation microarchitectures is about 10 cycles, whereas in Skylake microarchitecture it has been extended to as many as 140 cycles.The PAUSE instruction can improves the performance of processors supporting Intel Hyper-Threading Technology when executing \u201cspin-wait loops\u201d and other routines where one thread is accessing a shared lock or semaphore in a tight polling loop. When executing a spin-wait loop, the processor can suffer a severe performance penalty when exiting the loop because it detects a possible memory order violation and flushes the core processor\u2019s pipeline. The PAUSE instruction provides a hint to the processor that the code sequence is a spin-wait loop. The processor uses this hint to avoid the memory order violation and prevent the pipeline flush. In addition, the PAUSE instruction de-pipelines the spin-wait loop to prevent it from consuming execution resources excessively and consume power needlessly. (See Section 8.10.6.1, \u201cUse the PAUSE Instruction in Spin-Wait Loops,\u201d for more information about using the PAUSE instruction with IA-32 processors supporting Intel Hyper-Threading Technology.)<\/p><\/blockquote>\n<p>\u4e5f\u5c31\u662fSkylake\u67b6\u6784\u7684CPU\u7684PAUSE\u6307\u4ee4\u4ece\u4e4b\u524d\u768410 cycles \u6539\u6210\u4e86 140 cycles\u3002\u8fd9\u53ef\u662f14\u500d\u7684\u53d8\u5316\u5440\u3002<\/p>\n<p>MySQL \u4f7f\u7528 innodb_spin_wait_delay \u63a7\u5236 spin lock\u7b49\u5f85\u65f6\u95f4\uff0c\u7b49\u5f85\u65f6\u95f4\u65f6\u95f4\u4ece050\u4e2aPause\u5230innodb_spin_wait_delay50\u4e2aPause\u3002\u4ee5\u524d innodb_spin_wait_delay \u9ed8\u8ba4\u914d\u7f6e30\uff0c\u5bf9\u4e8eE5-2682 CPU\uff0c\u7b49\u5f85\u7684\u6700\u957f\u65f6\u95f4\u4e3a\uff1a30 50 10=15000 cycles\uff0c\u5bf9\u4e8e2.5GHz\u7684CPU\uff0c\u7b49\u5f85\u65f6\u95f4\u4e3a6us\u3002\u5bf9\u5e94\u8ba1\u7b97 Skylake CPU\u7684\u7b49\u5f85\u65f6\u95f4\uff1a30 50 140=210000 cycles\uff0cCPU\u4e3b\u9891\u4e5f\u662f2.5GHz\uff0c\u7b49\u5f85\u65f6\u95f484us\u3002<\/p>\n<p>E5-2682 CPU\u578b\u53f7\u5728\u4e0d\u540c\u7684delay\u53c2\u6570\u548c\u4e0d\u540c\u5e76\u53d1\u538b\u529b\u4e0b\u7684\u5199\u5165\u6027\u80fd\u6570\u636e\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915333\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>Skylake 8163 CPU\u578b\u53f7\u5728\u4e0d\u540c\u7684delay\u53c2\u6570\u548c\u4e0d\u540c\u5e76\u53d1\u538b\u529b\u4e0b\u7684\u5199\u5165\u6027\u80fd\u6570\u636e\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042915334\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u56e0\u4e3a8163\u7684cycles\u4ece10\u6539\u5230\u4e86140\uff0c\u6240\u4ee5\u53ef\u4ee5\u770b\u5230delay\u53c2\u6570\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u66f4\u52a0\u9661\u5cfb\u3002<\/p>\n<h2>\u603b\u7ed3\u5206\u6790<\/h2>\n<p>Intel CPU \u67b6\u6784\u4e0d\u540c\u4f7f\u5f97 Pause \u6307\u4ee4\u7684CPU Cycles\u4e0d\u540c\u5bfc\u81f4\u4e86 MySQL innodb_spin_wait_delay \u5728 spin lock \u5931\u8d25\u7684\u65f6\u5019\uff08\u6b64\u65f6\u9700\u8981 Pause innodb_spin_wait_delayN\uff09delay\u66f4\u4e45\uff0c\u4f7f\u5f97\u8c03\u7528\u65b9\u770b\u5230\u4e86MySQL\u66f4\u5927\u7684 RT \uff0c\u8fdb\u800c\u5bfc\u81f4 Tomcat Server\u4e0a\u4e1a\u52a1\u5e76\u53d1\u8dd1\u4e0d\u8d77\u6765\uff0c\u6240\u4ee5\u6700\u7ec8\u538b\u529b\u4e0a\u4e0d\u53bb\u3002<\/p>\n<p>\u5728\u957f\u94fe\u8def\u7684\u6392\u67e5\u4e2d\uff0c\u7ec6\u5316\u5b9a\u4f4d\u662f\u54ea\u4e2a\u8282\u70b9\u51fa\u4e86\u95ee\u9898\u662f\u6700\u96be\u7684\uff0c\u8981\u76ef\u4f4f RT \u800c\u4e0d\u662f CPU\u3002<\/p>\n<p>\u6b32\u901f\u5219\u4e0d\u8fbe\uff0c\u505a\u538b\u6d4b\u7684\u65f6\u5019\u8fd8\u662f\u8981\u8001\u8001\u5b9e\u5b9e\u5730\u4ece\u4e00\u4e2a\u5e76\u53d1\u5f00\u59cb\u89c2\u5bdfQPS\u3001 RT \uff0c\u7136\u540e\u4e00\u76f4\u589e\u52a0\u538b\u529b\u5230\u538b\u4e0d\u4e0a\u53bb\u4e86\uff0c\u518d\u770bQPS\u3001 RT \u53d8\u5316\uff0c\u7136\u540e\u786e\u8ba4\u74f6\u9888\u70b9\u3002<\/p>\n<p>\u4f5c\u8005\uff1a\u86f0\u5251<\/p>\n<p><strong><a href=\"https:\/\/link.segmentfault.com\/?enc=GDv6J7FEv8r7i1tpj5danQ%3D%3D.6PBOMeQvvGeKxOO%2F%2F34FG1jcniAexZ9Oren3BEiU4HgDIP%2BdMWTH0jMhmi5oDMd1\" rel=\"nofollow\">\u539f\u6587\u94fe\u63a5<\/a><\/strong><\/p>\n<p><strong>\u672c\u6587\u4e3a\u963f\u91cc\u4e91\u539f\u521b\u5185\u5bb9\uff0c\u672a\u7ecf\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042915319\">https:\/\/segmentfault.com\/a\/1190000042915319<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfc\u8bfb x86\u3001arm\u6307\u4ee4\u90fd\u5f88\u591a\uff0c\u65e0\u8bba\u662f\u5e94\u7528\u7a0b\u5e8f\u5458\u8fd8\u662f\u6570\u636e\u5e93\u5185\u6838\u7814\u53d1\u5927\u591a\u65f6\u5019\u90fd\u4e0d\u9700\u8981\u5bf9\u8fd9\u4e9b\u6307\u4ee4\u6df1\u5165\u7406\u89e3\uff0c\u4f46\u662f P [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10006929","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006929"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006929\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}