{"id":203470,"date":"2025-05-22T12:49:56","date_gmt":"2025-05-22T04:49:56","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203470\/"},"modified":"2025-05-22T12:49:56","modified_gmt":"2025-05-22T04:49:56","slug":"%e7%ba%bf%e7%a8%8b%e6%b1%a0%e9%9a%94%e7%a6%bb%ef%bc%9a%e5%a6%82%e4%bd%95%e6%8f%90%e5%8d%87%e5%ba%94%e7%94%a8%e7%a8%b3%e5%ae%9a%e6%80%a7%e3%80%81%e8%b5%84%e6%ba%90%e5%88%a9%e7%94%a8%e7%8e%87%e5%92%8c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203470\/","title":{"rendered":"\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1a\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7a33\u5b9a\u6027\u3001\u8d44\u6e90\u5229\u7528\u7387\u548c\u5b89\u5168\u6027\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1a\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7a33\u5b9a\u6027\u3001\u8d44\u6e90\u5229\u7528\u7387\u548c\u5b89\u5168\u6027\uff1f<\/h1>\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300a\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1a\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7a33\u5b9a\u6027\u3001\u8d44\u6e90\u5229\u7528\u7387\u548c\u5b89\u5168\u6027\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241109\/1731121613672ed1cd4c0af.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u7ebf\u7a0b\u6c60\u9694\u79bb\u7684\u610f\u4e49\u53ca\u5e94\u7528<\/strong><\/p>\n<p><strong>\u4ec0\u4e48\u662f\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1f <\/strong><\/p>\n<p>\u7ebf\u7a0b\u6c60\u9694\u79bb\u662f\u4e00\u79cd\u6280\u672f\uff0c\u7528\u4e8e\u5c06\u7ebf\u7a0b\u6c60\u4e0e\u5e94\u7528\u7a0b\u5e8f\u5176\u4ed6\u90e8\u5206\u9694\u79bb\uff0c\u4ee5\u9632\u6b62\u4e00\u4e2a\u7ebf\u7a0b\u6c60\u7684\u9519\u8bef\u6216\u5f02\u5e38\u5f71\u54cd\u5230\u5176\u4ed6\u7ebf\u7a0b\u6c60\u3002 <\/p>\n<p><strong>\u7ebf\u7a0b\u6c60\u9694\u79bb\u7684\u610f\u4e49<\/strong><\/p>\n<ol>\n<li><strong>\u63d0\u9ad8\u7a33\u5b9a\u6027\uff1a<\/strong>\u9694\u79bb\u7ebf\u7a0b\u6c60\u53ef\u9632\u6b62\u4e00\u4e2a\u7ebf\u7a0b\u6c60\u7684\u6545\u969c\u6216\u9519\u8bef\u6ce2\u53ca\u5230\u5176\u4ed6\u7ebf\u7a0b\u6c60\uff0c\u4ece\u800c\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u6574\u4f53\u7a33\u5b9a\u6027\u3002 <\/li>\n<li><strong>\u63d0\u5347\u8d44\u6e90\u5229\u7528\u7387\uff1a<\/strong>\u901a\u8fc7\u9694\u79bb\u7ebf\u7a0b\u6c60\uff0c\u6bcf\u4e2a\u7ebf\u7a0b\u6c60\u53ef\u4ee5\u72ec\u7acb\u914d\u7f6e\uff0c\u4ee5\u6700\u4f18\u5316\u4f7f\u7528\u53ef\u7528\u7684\u8d44\u6e90\u3002 <\/li>\n<li><strong>\u52a0\u5f3a\u5b89\u5168\u6027\uff1a<\/strong>\u9694\u79bb\u7ebf\u7a0b\u6c60\u53ef\u9632\u6b62\u6076\u610f\u4ee3\u7801\u6216\u653b\u51fb\u7834\u574f\u5e94\u7528\u7a0b\u5e8f\u5176\u4ed6\u90e8\u5206\u3002 <\/li>\n<\/ol>\n<p><strong>Spring Boot \u4e2d\u7684\u7ebf\u7a0b\u6c60\u9694\u79bb<\/strong><\/p>\n<p>\u5728 Spring Boot \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7 @Async \u6ce8\u89e3\u548c ExecutorService \u6765\u5b9e\u73b0\u7ebf\u7a0b\u6c60\u9694\u79bb\u3002 ExecutorService \u53ef\u4ee5\u914d\u7f6e\u7ebf\u7a0b\u6570\u3001\u961f\u5217\u957f\u5ea6\u7b49\u5c5e\u6027\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u7ebf\u7a0b\u6c60\u9700\u6c42\u3002 <\/p>\n<p><strong>Java \u7a0b\u5e8f\u4e2d\u7ebf\u7a0b\u6c60\u6570\u91cf\u7684\u9650\u5236<\/strong><\/p>\n<p>JVM \u5bf9\u7ebf\u7a0b\u6c60\u6570\u91cf\u7684\u9650\u5236\u4e3b\u8981\u53d6\u51b3\u4e8e\u53ef\u7528\u7684\u5185\u5b58\u548c\u786c\u4ef6\u8d44\u6e90\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e2a JVM \u53ef\u4ee5\u652f\u6301 2000-5000 \u4e2a\u7ebf\u7a0b\uff0c\u4f46\u8fd9\u4e2a\u6570\u5b57\u4f1a\u6839\u636e\u5177\u4f53\u5e94\u7528\u7a0b\u5e8f\u7684\u9700\u6c42\u800c\u6709\u6240\u4e0d\u540c\u3002 <\/p>\n<p><strong>\u7ebf\u7a0b\u6570\u4e0e CPU \u6838\u5fc3\u6570<\/strong><\/p>\n<p>\u7ebf\u7a0b\u6570\u4e0e CPU \u6838\u5fc3\u6570\u6ca1\u6709\u76f4\u63a5\u76f8\u5173\u5173\u7cfb\u3002\u5c3d\u7ba1\u6bcf\u4e2a CPU \u6838\u5fc3\u540c\u65f6\u53ea\u80fd\u8fd0\u884c\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u4f46\u7531\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u91c7\u7528\u5206\u65f6\u8c03\u5ea6\u673a\u5236\uff0cCPU \u53ef\u4ee5\u5feb\u901f\u5728\u4e0d\u540c\u7684\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\uff0c\u4ece\u800c\u521b\u5efa\u4e00\u4e2a\u5e76\u884c\u7684\u6267\u884c\u73af\u5883\u3002\u56e0\u6b64\uff0c\u5728\u4e00\u4e2a JVM \u4e2d\uff0c\u7ebf\u7a0b\u6570\u53ef\u4ee5\u8fdc\u8d85 CPU \u6838\u5fc3\u6570\u3002 <\/p>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300a\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1a\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7a33\u5b9a\u6027\u3001\u8d44\u6e90\u5229\u7528\u7387\u548c\u5b89\u5168\u6027\uff1f\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ebf\u7a0b\u6c60\u9694\u79bb\uff1a\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7a33\u5b9a\u6027\u3001&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203470","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203470"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203470\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}