{"id":93661,"date":"2026-08-12T23:48:50","date_gmt":"2026-08-12T15:48:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/93661.html"},"modified":"2026-08-12T23:48:50","modified_gmt":"2026-08-12T15:48:50","slug":"%e9%a1%b9%e7%9b%ae%e6%8e%92%e6%9f%a5%e7%b1%bb%e5%9c%ba%e6%99%af%e6%a1%88%e4%be%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/93661.html","title":{"rendered":"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b"},"content":{"rendered":"<h2>\u4e2d\u9ad8\u7ea7 Java \u9879\u76ee\u573a\u666f\u9898&#xff1a;\u6392\u67e5\u4e0e\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u4e2d\u9ad8\u7ea7 Java \u5f00\u53d1\u9762\u8bd5\u4e2d&#xff0c;\u9762\u8bd5\u5b98\u5e38\u95ee\u201c\u7ebf\u4e0a\u9047\u5230 CPU \u98d9\u9ad8\u3001\u63a5\u53e3\u53d8\u6162\u3001Full GC\u3001\u6162 SQL\u3001MQ \u79ef\u538b&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;\u201d \u56de\u7b54\u6838\u5fc3&#xff1a;\u4e0d\u8981\u4e00\u4e0a\u6765\u731c\u539f\u56e0&#xff0c;\u8981\u6309 \u73b0\u8c61\u786e\u8ba4 -&gt; \u5f71\u54cd\u8303\u56f4 -&gt; \u5206\u5c42\u6392\u67e5 -&gt; \u5b9a\u4f4d\u6839\u56e0 -&gt; \u4e34\u65f6\u6b62\u635f -&gt; \u957f\u671f\u4f18\u5316 \u6765\u8bb2\u3002<\/p>\n<hr \/>\n<h2>\u573a\u666f\u9898\u5206\u7c7b\u76ee\u5f55<\/h2>\n<ul>\n<li>\n<p>\u4e00\u3001\u63a5\u53e3\u6027\u80fd\u4e0e\u670d\u52a1\u7a33\u5b9a\u6027\u7c7b&#xff1a;\u63a5\u53e3\u53d8\u6162\u3001\u7ebf\u7a0b\u6c60\u6253\u6ee1\u3001\u957f\u5c3e\u5ef6\u8fdf\u3001504\u3001\u5065\u5eb7\u68c0\u67e5\u3001Tomcat \u7ebf\u7a0b\u3001\u670d\u52a1\u96ea\u5d29\u3001\u4e0b\u6e38\u9694\u79bb<\/p>\n<\/li>\n<li>\n<p>\u4e8c\u3001JVM\u3001\u5185\u5b58\u4e0e\u7ebf\u7a0b\u95ee\u9898\u7c7b&#xff1a;Full GC\u3001\u9891\u7e41 GC\u3001\u5806\u5916\u5185\u5b58\u3001\u7ebf\u7a0b\u6570\u4e0a\u6da8\u3001OOM\u3001Metaspace<\/p>\n<\/li>\n<li>\n<p>\u4e09\u3001MySQL \u4e0e\u6570\u636e\u5e93\u95ee\u9898\u7c7b&#xff1a;\u6162 SQL\u3001\u8fde\u63a5\u6c60\u3001\u9501\u7b49\u5f85\u3001\u6b7b\u9501\u3001\u4e3b\u4ece\u5ef6\u8fdf\u3001\u5206\u5e93\u5206\u8868\u3001\u5927\u4e8b\u52a1<\/p>\n<\/li>\n<li>\n<p>\u56db\u3001Redis \u4e0e\u7f13\u5b58\u95ee\u9898\u7c7b&#xff1a;Redis \u53d8\u6162\u3001\u7f13\u5b58\u4e09\u5927\u95ee\u9898\u3001\u5185\u5b58\u6253\u6ee1\u3001\u70ed\u70b9 key\u3001\u7f13\u5b58\u4e00\u81f4\u6027<\/p>\n<\/li>\n<li>\n<p>\u4e94\u3001MQ \u6d88\u606f\u961f\u5217\u95ee\u9898\u7c7b&#xff1a;\u6d88\u606f\u79ef\u538b\u3001\u91cd\u590d\u6d88\u8d39\u3001\u6d88\u606f\u4e22\u5931\u3001\u987a\u5e8f\u6d88\u8d39\u3001\u6b7b\u4fe1\u961f\u5217\u3001\u5206\u533a\u79ef\u538b<\/p>\n<\/li>\n<li>\n<p>\u516d\u3001\u5e76\u53d1\u3001\u5e42\u7b49\u4e0e\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u7c7b&#xff1a;\u5206\u5e03\u5f0f\u9501\u3001\u91cd\u590d\u63d0\u4ea4\u3001\u5206\u5e03\u5f0f\u4e8b\u52a1\u3001\u5e93\u5b58\u3001\u72b6\u6001\u673a\u3001\u4f59\u989d\u8ba2\u5355\u4e00\u81f4\u6027\u3001\u8d85\u7ea7 SIM \u8ba1\u8d39\u53bb\u91cd<\/p>\n<\/li>\n<li>\n<p>\u4e03\u3001\u53d1\u5e03\u3001\u914d\u7f6e\u4e0e\u5fae\u670d\u52a1\u67b6\u6784\u7c7b&#xff1a;\u53d1\u5e03\u6545\u969c\u3001\u7070\u5ea6\u517c\u5bb9\u3001\u914d\u7f6e\u4e2d\u5fc3\u3001\u6ce8\u518c\u4e2d\u5fc3\u3001\u591a\u673a\u623f<\/p>\n<\/li>\n<li>\n<p>\u516b\u3001\u6279\u5904\u7406\u3001\u4efb\u52a1\u4e0e\u8fd0\u7ef4\u6545\u969c\u7c7b&#xff1a;\u5b9a\u65f6\u4efb\u52a1\u3001\u5927\u6570\u636e\u5bfc\u5165\u3001\u65e5\u5fd7\u78c1\u76d8\u6253\u6ee1<\/p>\n<\/li>\n<li>\n<p>\u4e5d\u3001\u7ebf\u4e0a\u95ee\u9898\u590d\u76d8\u7c7b&#xff1a;\u7ebf\u4e0a\u4e8b\u6545\u590d\u76d8\u8868\u8fbe<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e00\u3001\u63a5\u53e3\u6027\u80fd\u4e0e\u670d\u52a1\u7a33\u5b9a\u6027\u7c7b<\/h2>\n<h3>1. CPU \u98d9\u9ad8&#xff0c;\u63a5\u53e3\u53d8\u6162\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u67d0\u4e2a\u670d\u52a1 CPU \u7a81\u7136\u98d9\u5230 100%&#xff0c;\u63a5\u53e3\u54cd\u5e94\u4e5f\u53d8\u6162\u4e86&#xff0c;\u4f60\u4f1a\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6211\u4f1a\u5148\u786e\u8ba4 CPU \u98d9\u9ad8\u662f\u5355\u53f0\u673a\u5668\u95ee\u9898&#xff0c;\u8fd8\u662f\u6574\u4e2a\u96c6\u7fa4\u90fd\u9ad8\u3002 \u5982\u679c\u662f\u5355\u53f0\u673a\u5668\u9ad8&#xff0c;\u4f18\u5148\u770b\u8fd9\u53f0\u673a\u5668\u4e0a\u7684 Java \u8fdb\u7a0b\u548c\u7ebf\u7a0b&#xff1b;\u5982\u679c\u662f\u6574\u4e2a\u96c6\u7fa4\u90fd\u9ad8&#xff0c;\u518d\u7ed3\u5408\u6d41\u91cf\u3001\u53d1\u5e03\u3001\u4f9d\u8d56\u8c03\u7528\u4e00\u8d77\u6392\u67e5\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u5148\u770b\u76d1\u63a7<\/p>\n<ul>\n<li>\n<p>CPU \u662f\u77ac\u65f6\u5347\u9ad8\u8fd8\u662f\u6301\u7eed\u5347\u9ad8<\/p>\n<\/li>\n<li>\n<p>\u63a5\u53e3 RT\u3001QPS\u3001\u9519\u8bef\u7387\u662f\u5426\u540c\u65f6\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u521a\u597d\u6709\u53d1\u5e03\u3001\u5b9a\u65f6\u4efb\u52a1\u3001\u6d41\u91cf\u7a81\u589e<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b9a\u4f4d Java \u8fdb\u7a0b<\/p>\n<\/li>\n<p>top<\/p>\n<p>\u627e\u5230 CPU \u5360\u7528\u6700\u9ad8\u7684 Java \u8fdb\u7a0b PID\u3002<\/p>\n<li>\n<p>\u5b9a\u4f4d\u9ad8 CPU \u7ebf\u7a0b<\/p>\n<\/li>\n<p>top -Hp &lt;pid&gt;<\/p>\n<p>\u627e\u5230\u5360\u7528 CPU \u6700\u9ad8\u7684\u7ebf\u7a0b ID\u3002<\/p>\n<li>\n<p>\u7ebf\u7a0b ID \u8f6c\u5341\u516d\u8fdb\u5236<\/p>\n<\/li>\n<p>printf &#034;%x\\\\n&#034; &lt;tid&gt;<\/p>\n<li>\n<p>\u5bfc\u51fa\u7ebf\u7a0b\u6808<\/p>\n<\/li>\n<p>jstack &lt;pid&gt; &gt; thread.log<\/p>\n<p>\u5728 thread.log \u4e2d\u641c\u7d22\u5341\u516d\u8fdb\u5236\u7ebf\u7a0b ID&#xff0c;\u67e5\u770b\u7ebf\u7a0b\u6b63\u5728\u6267\u884c\u54ea\u6bb5\u4ee3\u7801\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u4ee3\u7801\u6b7b\u5faa\u73af\u6216\u9012\u5f52\u9000\u51fa\u6761\u4ef6\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u5927\u91cf JSON \u5e8f\u5217\u5316\u3001\u52a0\u5bc6\u3001\u538b\u7f29\u7b49 CPU \u5bc6\u96c6\u578b\u64cd\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u56de\u6eaf\u4e25\u91cd<\/p>\n<\/li>\n<li>\n<p>\u9891\u7e41 Full GC \u5bfc\u81f4 CPU \u88ab GC \u7ebf\u7a0b\u5360\u7528<\/p>\n<\/li>\n<li>\n<p>\u9501\u7ade\u4e89\u4e25\u91cd&#xff0c;\u5927\u91cf\u7ebf\u7a0b\u81ea\u65cb\u6216\u4e0a\u4e0b\u6587\u5207\u6362<\/p>\n<\/li>\n<li>\n<p>\u7a81\u53d1\u6d41\u91cf\u5bfc\u81f4\u7ebf\u7a0b\u6c60\u4efb\u52a1\u66b4\u589e<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u5982\u679c\u662f\u4ee3\u7801\u6b7b\u5faa\u73af&#xff0c;\u5c31\u4fee\u590d\u5faa\u73af\u6761\u4ef6\u5e76\u8865\u5145\u8fb9\u754c\u6d4b\u8bd5\u3002 \u5982\u679c\u662f\u5927\u5bf9\u8c61\u5e8f\u5217\u5316\u6216\u590d\u6742\u8ba1\u7b97&#xff0c;\u5c31\u4f18\u5316\u7b97\u6cd5\u3001\u51cf\u5c11\u91cd\u590d\u8ba1\u7b97&#xff0c;\u5fc5\u8981\u65f6\u505a\u5f02\u6b65\u5316\u3002 \u5982\u679c\u662f GC \u5bfc\u81f4 CPU \u9ad8&#xff0c;\u5c31\u7ee7\u7eed\u5206\u6790 GC \u65e5\u5fd7\u548c\u5806\u5feb\u7167\u3002 \u5982\u679c\u662f\u6d41\u91cf\u7a81\u589e&#xff0c;\u5c31\u5148\u9650\u6d41\u3001\u6269\u5bb9&#xff0c;\u518d\u505a\u5bb9\u91cf\u8bc4\u4f30\u3002<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u76d1\u63a7\u786e\u8ba4 CPU \u662f\u5355\u673a\u9ad8\u8fd8\u662f\u96c6\u7fa4\u90fd\u9ad8&#xff0c;\u540c\u65f6\u770b\u63a5\u53e3 RT\u3001QPS\u3001\u9519\u8bef\u7387\u6709\u6ca1\u6709\u540c\u6b65\u53d8\u5316\u3002 \u5982\u679c\u662f Java \u8fdb\u7a0b CPU \u9ad8&#xff0c;\u6211\u4f1a\u7528 top \u627e\u8fdb\u7a0b&#xff0c;\u518d\u7528 top -Hp \u627e\u5177\u4f53\u7ebf\u7a0b&#xff0c;\u628a\u7ebf\u7a0b ID \u8f6c\u6210\u5341\u516d\u8fdb\u5236\u540e&#xff0c;\u7528 jstack \u5b9a\u4f4d\u7ebf\u7a0b\u6808\u3002 \u901a\u8fc7\u7ebf\u7a0b\u6808\u5224\u65ad\u662f\u6b7b\u5faa\u73af\u3001\u590d\u6742\u8ba1\u7b97\u3001\u9501\u7ade\u4e89&#xff0c;\u8fd8\u662f GC \u7ebf\u7a0b\u5360\u7528 CPU\u3002 \u5b9a\u4f4d\u6839\u56e0\u540e&#xff0c;\u77ed\u671f\u5148\u9650\u6d41\u3001\u6458\u6d41\u91cf\u6216\u6269\u5bb9\u6b62\u635f&#xff0c;\u957f\u671f\u518d\u4fee\u4ee3\u7801\u3001\u4f18\u5316\u7b97\u6cd5\u3001\u8c03\u6574 JVM \u6216\u8865\u5145\u76d1\u63a7\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>top \u627e\u8fdb\u7a0b -&gt; top -Hp \u627e\u7ebf\u7a0b -&gt; jstack \u770b\u4ee3\u7801 -&gt; \u5224\u65ad\u4e1a\u52a1\u7ebf\u7a0b\u8fd8\u662f GC \u7ebf\u7a0b<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>2. \u7ebf\u4e0a\u63a5\u53e3\u7a81\u7136\u53d8\u6162\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7528\u6237\u53cd\u9988\u63a5\u53e3\u5f88\u6162&#xff0c;\u5e73\u65f6 100ms&#xff0c;\u73b0\u5728\u8981 3 \u79d2&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u63a5\u53e3\u53d8\u6162\u4e0d\u80fd\u5148\u731c\u6570\u636e\u5e93\u95ee\u9898&#xff0c;\u8981\u5148\u5224\u65ad\u662f\u5355\u4e2a\u63a5\u53e3\u6162&#xff0c;\u8fd8\u662f\u6574\u4e2a\u670d\u52a1\u90fd\u6162\u3002 \u7136\u540e\u6cbf\u8c03\u7528\u94fe\u62c6\u5206&#xff1a;\u7f51\u5173\u3001\u5e94\u7528\u3001\u6570\u636e\u5e93\u3001Redis\u3001MQ\u3001\u7b2c\u4e09\u65b9\u63a5\u53e3\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u76d1\u63a7\u786e\u8ba4\u8303\u56f4<\/p>\n<ul>\n<li>\n<p>\u662f\u5355\u63a5\u53e3\u6162&#xff0c;\u8fd8\u662f\u6240\u6709\u63a5\u53e3\u6162<\/p>\n<\/li>\n<li>\n<p>\u662f\u5355\u5b9e\u4f8b\u6162&#xff0c;\u8fd8\u662f\u6574\u4e2a\u670d\u52a1\u6162<\/p>\n<\/li>\n<li>\n<p>QPS \u662f\u5426\u7a81\u589e<\/p>\n<\/li>\n<li>\n<p>\u9519\u8bef\u7387\u662f\u5426\u4e0a\u5347<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u94fe\u8def\u8017\u65f6<\/p>\n<ul>\n<li>\n<p>\u7f51\u5173\u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5185\u90e8\u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>MySQL \u67e5\u8be2\u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>Redis \u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>RPC \u6216 HTTP \u4e0b\u6e38\u63a5\u53e3\u8017\u65f6<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u5e94\u7528\u6307\u6807<\/p>\n<ul>\n<li>\n<p>CPU\u3001\u5185\u5b58\u3001GC<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u6d3b\u8dc3\u6570\u3001\u961f\u5217\u957f\u5ea6\u3001\u62d2\u7edd\u6b21\u6570<\/p>\n<\/li>\n<li>\n<p>Tomcat \u7ebf\u7a0b\u6570\u662f\u5426\u6253\u6ee1<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u4f9d\u8d56\u6307\u6807<\/p>\n<ul>\n<li>\n<p>MySQL \u662f\u5426\u6709\u6162 SQL\u3001\u9501\u7b49\u5f85\u3001\u8fde\u63a5\u6c60\u8017\u5c3d<\/p>\n<\/li>\n<li>\n<p>Redis \u662f\u5426\u6709\u6162\u547d\u4ee4\u3001\u5927 key\u3001\u7f51\u7edc\u6296\u52a8<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u670d\u52a1\u662f\u5426\u8d85\u65f6<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u6162 SQL \u6216\u6570\u636e\u5e93\u9501\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>Redis \u5927 key \u6216\u7f13\u5b58\u547d\u4e2d\u7387\u4e0b\u964d<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u8d85\u65f6&#xff0c;\u628a\u4e1a\u52a1\u7ebf\u7a0b\u62d6\u4f4f<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u6216 Tomcat \u8fde\u63a5\u6570\u6253\u6ee1<\/p>\n<\/li>\n<li>\n<p>JVM Full GC<\/p>\n<\/li>\n<li>\n<p>\u65b0\u7248\u672c\u53d1\u5e03\u5f15\u5165\u6027\u80fd\u95ee\u9898<\/p>\n<\/li>\n<li>\n<p>\u7a81\u53d1\u6d41\u91cf\u8d85\u8fc7\u7cfb\u7edf\u5bb9\u91cf<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u77ed\u671f\u5148\u6b62\u635f&#xff0c;\u6bd4\u5982\u9650\u6d41\u3001\u964d\u7ea7\u3001\u6269\u5bb9\u3001\u56de\u6eda\u3001\u6458\u9664\u5f02\u5e38\u5b9e\u4f8b\u3002 \u957f\u671f\u6839\u636e\u6839\u56e0\u5904\u7406&#xff0c;\u6bd4\u5982\u4f18\u5316 SQL\u3001\u589e\u52a0\u7f13\u5b58\u3001\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4\u3001\u9694\u79bb\u7ebf\u7a0b\u6c60\u3001\u8865\u5145\u7194\u65ad\u964d\u7ea7\u3001\u4f18\u5316 JVM \u53c2\u6570\u3002<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u5224\u65ad\u662f\u5355\u4e2a\u63a5\u53e3\u6162&#xff0c;\u8fd8\u662f\u6574\u4e2a\u670d\u52a1\u6162&#xff1b;\u662f\u5355\u53f0\u673a\u5668\u6162&#xff0c;\u8fd8\u662f\u6240\u6709\u5b9e\u4f8b\u90fd\u6162\u3002 \u7136\u540e\u770b\u94fe\u8def\u8ffd\u8e2a&#xff0c;\u628a\u8017\u65f6\u62c6\u6210\u7f51\u5173\u3001\u5e94\u7528\u3001\u6570\u636e\u5e93\u3001\u7f13\u5b58\u548c\u4e0b\u6e38\u670d\u52a1\u51e0\u4e2a\u90e8\u5206\u3002 \u5982\u679c\u6162\u5728\u5e94\u7528\u5c42&#xff0c;\u5c31\u770b CPU\u3001GC\u3001\u7ebf\u7a0b\u6c60\u548c\u65e5\u5fd7&#xff1b;\u5982\u679c\u6162\u5728\u6570\u636e\u5e93&#xff0c;\u5c31\u770b\u6162 SQL\u3001\u6267\u884c\u8ba1\u5212\u548c\u9501\u7b49\u5f85&#xff1b;\u5982\u679c\u6162\u5728\u4e0b\u6e38&#xff0c;\u5c31\u770b\u8d85\u65f6\u3001\u91cd\u8bd5\u548c\u7194\u65ad\u914d\u7f6e\u3002 \u7ebf\u4e0a\u5904\u7406\u65f6\u4f1a\u5148\u6b62\u635f&#xff0c;\u6bd4\u5982\u9650\u6d41\u3001\u964d\u7ea7\u3001\u6269\u5bb9\u6216\u56de\u6eda&#xff0c;\u4e4b\u540e\u518d\u505a\u6839\u56e0\u4fee\u590d\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5148\u5b9a\u8303\u56f4 -&gt; \u518d\u62c6\u94fe\u8def -&gt; \u627e\u6700\u6162\u4e00\u6bb5 -&gt; \u5148\u6b62\u635f\u518d\u4f18\u5316<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>3. \u7ebf\u7a0b\u6c60\u6253\u6ee1\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u4e1a\u52a1\u7ebf\u7a0b\u6c60\u961f\u5217\u5806\u79ef&#xff0c;\u751a\u81f3\u89e6\u53d1\u62d2\u7edd\u7b56\u7565&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u7ebf\u7a0b\u6c60\u6253\u6ee1\u8981\u5148\u5224\u65ad\u662f\u6d41\u91cf\u592a\u5927&#xff0c;\u8fd8\u662f\u4efb\u52a1\u6267\u884c\u592a\u6162\u3002 \u7136\u540e\u770b\u7ebf\u7a0b\u90fd\u5361\u5728\u54ea\u91cc&#xff0c;\u662f\u6570\u636e\u5e93\u3001Redis\u3001\u4e0b\u6e38\u63a5\u53e3\u3001\u9501&#xff0c;\u8fd8\u662f\u672c\u5730\u8ba1\u7b97\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u7ebf\u7a0b\u6c60\u6307\u6807<\/p>\n<ul>\n<li>\n<p>corePoolSize<\/p>\n<\/li>\n<li>\n<p>maximumPoolSize<\/p>\n<\/li>\n<li>\n<p>activeCount<\/p>\n<\/li>\n<li>\n<p>queueSize<\/p>\n<\/li>\n<li>\n<p>rejectCount<\/p>\n<\/li>\n<li>\n<p>task \u8017\u65f6<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5bfc\u51fa\u7ebf\u7a0b\u6808<\/p>\n<\/li>\n<p>jstack &lt;pid&gt; &gt; thread.log<\/p>\n<li>\n<p>\u5206\u6790\u7ebf\u7a0b\u72b6\u6001<\/p>\n<ul>\n<li>\n<p>RUNNABLE&#xff1a;\u53ef\u80fd\u5728\u6267\u884c\u8ba1\u7b97\u3001IO \u6216\u6570\u636e\u5e93\u9a71\u52a8<\/p>\n<\/li>\n<li>\n<p>WAITING&#xff1a;\u53ef\u80fd\u5728\u7b49\u9501\u3001\u961f\u5217\u6216\u6761\u4ef6\u53d8\u91cf<\/p>\n<\/li>\n<li>\n<p>BLOCKED&#xff1a;\u9501\u7ade\u4e89<\/p>\n<\/li>\n<li>\n<p>\u5927\u91cf\u7ebf\u7a0b\u5361\u5728\u540c\u4e00\u4e2a\u4e0b\u6e38\u8c03\u7528&#xff1a;\u4e0b\u6e38\u6162\u6216\u8d85\u65f6\u914d\u7f6e\u4e0d\u5408\u7406<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u8bf7\u6c42\u91cf\u7a81\u589e<\/p>\n<\/li>\n<li>\n<p>\u4efb\u52a1\u6267\u884c\u8017\u65f6\u53d8\u957f<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u6162&#xff0c;\u7ebf\u7a0b\u4e00\u76f4\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u6162 SQL<\/p>\n<\/li>\n<li>\n<p>\u9501\u7ade\u4e89\u4e25\u91cd<\/p>\n<\/li>\n<li>\n<p>\u961f\u5217\u8bbe\u7f6e\u8fc7\u5927&#xff0c;\u95ee\u9898\u66b4\u9732\u592a\u665a<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u53c2\u6570\u914d\u7f6e\u4e0d\u5408\u7406<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u7ed9\u4e0b\u6e38\u8c03\u7528\u8bbe\u7f6e\u5408\u7406\u8d85\u65f6\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u589e\u52a0\u7194\u65ad\u3001\u964d\u7ea7\u3001\u9650\u6d41<\/p>\n<\/li>\n<li>\n<p>\u6309\u4e1a\u52a1\u7c7b\u578b\u9694\u79bb\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5316\u6162\u4efb\u52a1\u6216\u6539\u5f02\u6b65\u5904\u7406<\/p>\n<\/li>\n<li>\n<p>\u8c03\u6574\u7ebf\u7a0b\u6c60\u53c2\u6570\u548c\u961f\u5217\u957f\u5ea6<\/p>\n<\/li>\n<li>\n<p>\u589e\u52a0\u7ebf\u7a0b\u6c60\u76d1\u63a7\u548c\u62d2\u7edd\u544a\u8b66<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u7ebf\u7a0b\u6c60\u7684\u6d3b\u8dc3\u7ebf\u7a0b\u6570\u3001\u961f\u5217\u957f\u5ea6\u548c\u62d2\u7edd\u6b21\u6570&#xff0c;\u5224\u65ad\u662f\u6d41\u91cf\u4e0a\u6765\u4e86&#xff0c;\u8fd8\u662f\u4efb\u52a1\u53d8\u6162\u4e86\u3002 \u7136\u540e\u7528 jstack \u770b\u7ebf\u7a0b\u90fd\u5361\u5728\u54ea\u91cc&#xff0c;\u5982\u679c\u5927\u91cf\u7ebf\u7a0b\u5361\u5728\u6570\u636e\u5e93\u6216\u4e0b\u6e38\u63a5\u53e3&#xff0c;\u5c31\u7ee7\u7eed\u67e5\u5bf9\u5e94\u4f9d\u8d56&#xff1b;\u5982\u679c\u662f\u9501\u7ade\u4e89&#xff0c;\u5c31\u770b\u9501\u5bf9\u8c61\u548c\u4e34\u754c\u533a\u4ee3\u7801\u3002 \u5904\u7406\u4e0a\u77ed\u671f\u53ef\u4ee5\u9650\u6d41\u3001\u6269\u5bb9\u6216\u964d\u7ea7&#xff0c;\u957f\u671f\u4f1a\u505a\u7ebf\u7a0b\u6c60\u9694\u79bb\u3001\u8d85\u65f6\u63a7\u5236\u3001\u7194\u65ad\u964d\u7ea7\u548c\u4efb\u52a1\u8017\u65f6\u4f18\u5316\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u770b\u6d3b\u8dc3\u6570\u548c\u961f\u5217 -&gt; jstack \u770b\u7ebf\u7a0b\u5361\u54ea -&gt; \u4e0b\u6e38\u6162\u5c31\u9694\u79bb\u548c\u8d85\u65f6<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>4. \u670d\u52a1\u96ea\u5d29\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u67d0\u4e2a\u4e0b\u6e38\u670d\u52a1\u53d8\u6162&#xff0c;\u5bfc\u81f4\u4f60\u7684\u670d\u52a1\u4e5f\u88ab\u62d6\u57ae&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u96ea\u5d29\u5904\u7406\u7684\u7b2c\u4e00\u539f\u5219\u662f\u5148\u6b62\u635f&#xff0c;\u4e0d\u8981\u8ba9\u6545\u969c\u7ee7\u7eed\u6269\u6563\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u54cd\u5e94\u6162<\/p>\n<\/li>\n<li>\n<p>\u8c03\u7528\u65b9\u6ca1\u6709\u8bbe\u7f6e\u8d85\u65f6<\/p>\n<\/li>\n<li>\n<p>\u5931\u8d25\u540e\u5927\u91cf\u91cd\u8bd5<\/p>\n<\/li>\n<li>\n<p>\u6240\u6709\u4e1a\u52a1\u5171\u7528\u540c\u4e00\u4e2a\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<li>\n<p>\u6ca1\u6709\u9650\u6d41\u3001\u7194\u65ad\u3001\u964d\u7ea7<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u8bbe\u7f6e\u5408\u7406\u8d85\u65f6\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u9650\u5236\u91cd\u8bd5\u6b21\u6570&#xff0c;\u907f\u514d\u91cd\u8bd5\u98ce\u66b4<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u7194\u65ad&#xff0c;\u5931\u8d25\u7387\u9ad8\u65f6\u5feb\u901f\u5931\u8d25<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u975e\u6838\u5fc3\u4e1a\u52a1\u964d\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u6309\u4e1a\u52a1\u9694\u79bb\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u94fe\u8def\u505a\u9650\u6d41\u4fdd\u62a4<\/p>\n<\/li>\n<li>\n<p>\u5efa\u7acb\u4f9d\u8d56\u670d\u52a1\u76d1\u63a7\u548c\u544a\u8b66<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5982\u679c\u51fa\u73b0\u96ea\u5d29&#xff0c;\u6211\u4f1a\u5148\u6b62\u635f&#xff0c;\u6bd4\u5982\u9650\u6d41\u3001\u964d\u7ea7\u3001\u7194\u65ad\u3001\u6458\u6d41\u91cf\u6216\u4e34\u65f6\u5173\u95ed\u975e\u6838\u5fc3\u529f\u80fd\u3002 \u7136\u540e\u770b\u662f\u4e0d\u662f\u67d0\u4e2a\u4e0b\u6e38\u670d\u52a1\u53d8\u6162&#xff0c;\u5bfc\u81f4\u7ebf\u7a0b\u6c60\u3001\u8fde\u63a5\u6c60\u88ab\u5360\u6ee1\u3002 \u957f\u671f\u4f1a\u7ed9\u6240\u6709\u8fdc\u7a0b\u8c03\u7528\u8bbe\u7f6e\u8d85\u65f6\u548c\u7194\u65ad&#xff0c;\u9650\u5236\u91cd\u8bd5\u6b21\u6570&#xff0c;\u5e76\u6309\u6838\u5fc3\u548c\u975e\u6838\u5fc3\u4e1a\u52a1\u505a\u7ebf\u7a0b\u6c60\u9694\u79bb&#xff0c;\u907f\u514d\u4e00\u4e2a\u4f9d\u8d56\u62d6\u57ae\u6574\u4e2a\u670d\u52a1\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5148\u6b62\u635f&#xff0c;\u518d\u5b9a\u4f4d&#xff1b;\u8d85\u65f6\u3001\u7194\u65ad\u3001\u9650\u6d41\u3001\u9694\u79bb\u662f\u6838\u5fc3<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>5. \u63a5\u53e3\u5076\u53d1\u8d85\u65f6&#xff0c;\u4f46\u91cd\u8bd5\u53c8\u6210\u529f\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u67d0\u4e2a\u63a5\u53e3\u4e0d\u662f\u4e00\u76f4\u6162&#xff0c;\u800c\u662f\u5076\u53d1\u8d85\u65f6&#xff0c;\u7528\u6237\u91cd\u8bd5\u540e\u53c8\u6210\u529f\u4e86&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5076\u53d1\u8d85\u65f6\u8981\u91cd\u70b9\u770b P95\u3001P99\u3001\u6162\u8bf7\u6c42\u65e5\u5fd7\u548c\u4f9d\u8d56\u6296\u52a8\u3002 \u5e73\u5747 RT \u6b63\u5e38\u4e0d\u4ee3\u8868\u7cfb\u7edf\u6ca1\u95ee\u9898&#xff0c;\u53ef\u80fd\u53ea\u6709\u5c11\u91cf\u8bf7\u6c42\u88ab\u6162 SQL\u3001GC\u3001\u9501\u7b49\u5f85\u6216\u4e0b\u6e38\u8d85\u65f6\u62d6\u4f4f\u3002<\/p>\n<h4>\u6392\u67e5\u65b9\u5411<\/h4>\n<li>\n<p>\u770b\u6162\u8bf7\u6c42\u53d1\u751f\u65f6\u95f4\u662f\u5426\u96c6\u4e2d<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u6bd4 P95\u3001P99 \u548c\u5e73\u5747 RT<\/p>\n<\/li>\n<li>\n<p>\u67e5\u94fe\u8def\u8ffd\u8e2a\u4e2d\u6162\u8bf7\u6c42\u5361\u5728\u54ea\u4e00\u6bb5<\/p>\n<\/li>\n<li>\n<p>\u770b\u662f\u5426\u53d1\u751f Young GC\u3001Full GC \u6216\u7ebf\u7a0b\u6c60\u6392\u961f<\/p>\n<\/li>\n<li>\n<p>\u770b\u6570\u636e\u5e93\u662f\u5426\u6709\u77ac\u65f6\u9501\u7b49\u5f85\u6216\u6162 SQL<\/p>\n<\/li>\n<li>\n<p>\u770b\u4e0b\u6e38\u63a5\u53e3\u662f\u5426\u5076\u53d1\u6296\u52a8<\/p>\n<\/li>\n<li>\n<p>\u770b\u662f\u5426\u5b58\u5728\u8fde\u63a5\u6c60\u83b7\u53d6\u8fde\u63a5\u8d85\u65f6<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u6162\u8bf7\u6c42\u7684\u65f6\u95f4\u5206\u5e03\u548c P99 \u6307\u6807&#xff0c;\u56e0\u4e3a\u5076\u53d1\u8d85\u65f6\u901a\u5e38\u5e73\u5747 RT \u770b\u4e0d\u51fa\u6765\u3002 \u7136\u540e\u901a\u8fc7 trace \u628a\u6162\u8bf7\u6c42\u5355\u72ec\u62c9\u51fa\u6765&#xff0c;\u5206\u6790\u5b83\u662f\u5361\u5728\u5e94\u7528\u7ebf\u7a0b\u6c60\u3001\u6570\u636e\u5e93\u3001Redis&#xff0c;\u8fd8\u662f\u4e0b\u6e38\u63a5\u53e3\u3002 \u5982\u679c\u91cd\u8bd5\u80fd\u6210\u529f&#xff0c;\u8bf4\u660e\u53ef\u80fd\u662f\u77ac\u65f6\u6296\u52a8&#xff0c;\u6bd4\u5982\u8fde\u63a5\u6c60\u7b49\u5f85\u3001GC\u3001\u9501\u7b49\u5f85\u6216\u4e0b\u6e38\u8d85\u65f6\u3002 \u89e3\u51b3\u4e0a\u4f1a\u8865\u5145\u8d85\u65f6\u63a7\u5236\u3001\u91cd\u8bd5\u9000\u907f\u3001\u7194\u65ad\u964d\u7ea7\u548c\u6162\u8bf7\u6c42\u65e5\u5fd7\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5076\u53d1\u8d85\u65f6\u770b P99&#xff0c;\u5355\u72ec\u5206\u6790\u6162\u8bf7\u6c42\u94fe\u8def<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>6. \u63a5\u53e3 P99 \u5f88\u9ad8&#xff0c;\u4f46\u5e73\u5747 RT \u6b63\u5e38\u600e\u4e48\u5206\u6790&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u63a5\u53e3\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u6b63\u5e38&#xff0c;\u4f46\u662f P99 \u5f88\u9ad8&#xff0c;\u8bf4\u660e\u4ec0\u4e48&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>P99 \u9ad8\u8bf4\u660e\u5c11\u91cf\u8bf7\u6c42\u5f88\u6162&#xff0c;\u7528\u6237\u4f53\u9a8c\u53ef\u80fd\u5df2\u7ecf\u53d7\u5f71\u54cd\u3002 \u8fd9\u79cd\u95ee\u9898\u901a\u5e38\u662f\u957f\u5c3e\u8bf7\u6c42&#xff0c;\u8981\u6309\u8bf7\u6c42\u7279\u5f81\u62c6\u5206&#xff0c;\u6bd4\u5982\u53c2\u6570\u3001\u7528\u6237\u3001\u6570\u636e\u91cf\u3001\u8def\u7531\u5b9e\u4f8b\u3001\u4f9d\u8d56\u8c03\u7528\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u67d0\u4e9b\u5927\u5ba2\u6237\u6216\u5927\u6570\u636e\u91cf\u8bf7\u6c42\u7279\u522b\u6162<\/p>\n<\/li>\n<li>\n<p>\u67d0\u4e2a\u5b9e\u4f8b\u8d1f\u8f7d\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u90e8\u5206\u8bf7\u6c42\u547d\u4e2d\u6162 SQL<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u672a\u547d\u4e2d\u540e\u56de\u6e90\u5f88\u6162<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u957f\u5c3e\u5ef6\u8fdf<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u6392\u961f\u9020\u6210\u5c11\u91cf\u8bf7\u6c42\u7b49\u5f85\u5f88\u4e45<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u628a P99 \u6162\u8bf7\u6c42\u6837\u672c\u635e\u51fa\u6765&#xff0c;\u6309\u63a5\u53e3\u53c2\u6570\u3001\u7528\u6237\u7c7b\u578b\u3001\u6570\u636e\u91cf\u3001\u5b9e\u4f8b IP \u548c\u94fe\u8def\u8017\u65f6\u505a\u805a\u5408\u3002 \u5982\u679c\u53d1\u73b0\u6162\u8bf7\u6c42\u96c6\u4e2d\u5728\u67d0\u7c7b\u53c2\u6570&#xff0c;\u53ef\u80fd\u662f\u6570\u636e\u91cf\u95ee\u9898&#xff1b;\u5982\u679c\u96c6\u4e2d\u5728\u67d0\u53f0\u673a\u5668&#xff0c;\u53ef\u80fd\u662f\u5355\u673a\u8d1f\u8f7d\u6216 GC&#xff1b;\u5982\u679c\u96c6\u4e2d\u5728\u67d0\u4e2a\u4f9d\u8d56&#xff0c;\u5c31\u7ee7\u7eed\u67e5\u6570\u636e\u5e93\u3001Redis \u6216\u4e0b\u6e38\u670d\u52a1\u3002 \u4f18\u5316\u65f6\u8981\u91cd\u70b9\u6cbb\u7406\u957f\u5c3e&#xff0c;\u6bd4\u5982\u9650\u5236\u5206\u9875\u5927\u5c0f\u3001\u4f18\u5316\u5927\u5ba2\u6237\u67e5\u8be2\u3001\u9694\u79bb\u6162\u4f9d\u8d56\u3001\u8bbe\u7f6e\u8d85\u65f6\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5e73\u5747\u503c\u770b\u6574\u4f53&#xff0c;P99 \u770b\u957f\u5c3e<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>7. QPS \u4e0d\u9ad8&#xff0c;\u4f46\u63a5\u53e3\u8fd8\u662f\u5f88\u6162\u53ef\u80fd\u662f\u4ec0\u4e48\u539f\u56e0&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7cfb\u7edf\u6d41\u91cf\u4e0d\u9ad8&#xff0c;\u4f46\u63a5\u53e3\u5f88\u6162&#xff0c;\u4f60\u4f1a\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>QPS \u4e0d\u9ad8\u8fd8\u6162&#xff0c;\u901a\u5e38\u4e0d\u662f\u5bb9\u91cf\u4e0d\u591f&#xff0c;\u800c\u662f\u5355\u6b21\u8bf7\u6c42\u8017\u65f6\u957f\u6216\u8d44\u6e90\u88ab\u5360\u4f4f\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u6162 SQL \u6216\u9501\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>\u8fdc\u7a0b\u63a5\u53e3\u8d85\u65f6<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u6c60\u592a\u5c0f\u6216\u8fde\u63a5\u6cc4\u6f0f<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u961f\u5217\u79ef\u538b<\/p>\n<\/li>\n<li>\n<p>GC \u505c\u987f<\/p>\n<\/li>\n<li>\n<p>\u5355\u6b21\u8bf7\u6c42\u5904\u7406\u6570\u636e\u91cf\u592a\u5927<\/p>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u6253\u5370\u8fc7\u591a\u6216\u540c\u6b65 IO \u963b\u585e<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>QPS \u4e0d\u9ad8\u4f46\u63a5\u53e3\u6162&#xff0c;\u6211\u4f1a\u5148\u770b\u94fe\u8def\u8017\u65f6&#xff0c;\u786e\u8ba4\u6162\u5728\u5e94\u7528\u5185\u90e8\u8fd8\u662f\u5916\u90e8\u4f9d\u8d56\u3002 \u8fd9\u79cd\u60c5\u51b5\u4e00\u822c\u4e0d\u662f\u7b80\u5355\u6269\u5bb9\u80fd\u89e3\u51b3&#xff0c;\u800c\u662f\u67d0\u4e9b\u8d44\u6e90\u88ab\u957f\u671f\u5360\u7528&#xff0c;\u6bd4\u5982\u6570\u636e\u5e93\u8fde\u63a5\u3001\u4e1a\u52a1\u7ebf\u7a0b\u3001\u9501\u6216\u8005\u4e0b\u6e38\u8c03\u7528\u3002 \u6211\u4f1a\u91cd\u70b9\u67e5\u6162 SQL\u3001\u9501\u7b49\u5f85\u3001\u7ebf\u7a0b\u6808\u3001\u8fde\u63a5\u6c60\u7b49\u5f85\u548c GC \u65e5\u5fd7&#xff0c;\u627e\u5230\u8bf7\u6c42\u5230\u5e95\u5728\u7b49\u4ec0\u4e48\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>QPS \u4e0d\u9ad8\u8fd8\u6162&#xff0c;\u91cd\u70b9\u770b\u7b49\u5f85\u548c\u5355\u8bf7\u6c42\u8017\u65f6<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>8. \u63a5\u53e3\u5927\u91cf 504 \u600e\u4e48\u5224\u65ad\u662f\u7f51\u5173\u95ee\u9898\u8fd8\u662f\u670d\u52a1\u95ee\u9898&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u5927\u91cf 504&#xff0c;\u600e\u4e48\u5224\u65ad\u95ee\u9898\u5728\u7f51\u5173\u8fd8\u662f\u540e\u7aef\u670d\u52a1&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>504 \u901a\u5e38\u8868\u793a\u7f51\u5173\u7b49\u5f85\u540e\u7aef\u8d85\u65f6\u3002 \u8981\u5bf9\u6bd4\u7f51\u5173\u65e5\u5fd7\u3001\u540e\u7aef access log\u3001\u5e94\u7528\u65e5\u5fd7\u548c\u94fe\u8def\u8ffd\u8e2a\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u7f51\u5173\u662f\u5426\u6210\u529f\u8f6c\u53d1\u5230\u540e\u7aef<\/p>\n<\/li>\n<li>\n<p>\u770b\u540e\u7aef\u662f\u5426\u6536\u5230\u8bf7\u6c42<\/p>\n<\/li>\n<li>\n<p>\u770b\u540e\u7aef\u5904\u7406\u8017\u65f6\u662f\u5426\u8d85\u8fc7\u7f51\u5173\u8d85\u65f6\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u770b\u7f51\u5173\u5230\u670d\u52a1\u4e4b\u95f4\u662f\u5426\u6709\u7f51\u7edc\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u770b\u670d\u52a1\u5b9e\u4f8b\u662f\u5426\u5065\u5eb7\u3001\u7ebf\u7a0b\u662f\u5426\u6253\u6ee1<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u4ece\u7f51\u5173\u65e5\u5fd7\u91cc\u62ff\u5230\u8bf7\u6c42 ID&#xff0c;\u770b\u8bf7\u6c42\u6709\u6ca1\u6709\u8f6c\u53d1\u5230\u540e\u7aef\u3002 \u5982\u679c\u540e\u7aef\u6ca1\u6536\u5230&#xff0c;\u53ef\u80fd\u662f\u7f51\u5173\u8def\u7531\u3001\u6ce8\u518c\u4e2d\u5fc3\u6216\u7f51\u7edc\u95ee\u9898&#xff1b;\u5982\u679c\u540e\u7aef\u6536\u5230\u4e86\u4f46\u5904\u7406\u65f6\u95f4\u8d85\u8fc7\u7f51\u5173\u8d85\u65f6&#xff0c;\u5c31\u662f\u670d\u52a1\u6162\u3002 \u63a5\u7740\u4f1a\u770b\u540e\u7aef\u7ebf\u7a0b\u6c60\u3001\u6570\u636e\u5e93\u3001Redis\u3001\u4e0b\u6e38\u8c03\u7528\u548c GC&#xff0c;\u786e\u8ba4\u670d\u52a1\u4e3a\u4ec0\u4e48\u6ca1\u53ca\u65f6\u8fd4\u56de\u3002 \u77ed\u671f\u53ef\u4ee5\u6269\u5bb9\u3001\u9650\u6d41\u6216\u8c03\u5927\u8d85\u65f6&#xff0c;\u4f46\u957f\u671f\u8fd8\u662f\u8981\u4f18\u5316\u540e\u7aef\u8017\u65f6\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u540e\u7aef\u6ca1\u6536\u5230\u67e5\u7f51\u5173&#xff0c;\u540e\u7aef\u6536\u5230\u4e86\u67e5\u670d\u52a1\u8017\u65f6<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>9. \u670d\u52a1\u5065\u5eb7\u68c0\u67e5\u6b63\u5e38&#xff0c;\u4f46\u4e1a\u52a1\u63a5\u53e3\u4e0d\u53ef\u7528\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5065\u5eb7\u68c0\u67e5\u63a5\u53e3\u6b63\u5e38&#xff0c;\u4f46\u771f\u5b9e\u4e1a\u52a1\u63a5\u53e3\u5927\u91cf\u5931\u8d25&#xff0c;\u8bf4\u660e\u4ec0\u4e48&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5065\u5eb7\u68c0\u67e5\u6b63\u5e38\u53ea\u80fd\u8bf4\u660e\u8fdb\u7a0b\u8fd8\u6d3b\u7740&#xff0c;\u4e0d\u4ee3\u8868\u4e1a\u52a1\u4f9d\u8d56\u53ef\u7528\u3002 \u8981\u770b\u4e1a\u52a1\u63a5\u53e3\u4f9d\u8d56\u7684\u6570\u636e\u5e93\u3001\u7f13\u5b58\u3001MQ\u3001\u4e0b\u6e38\u670d\u52a1\u662f\u5426\u5f02\u5e38\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u5065\u5eb7\u68c0\u67e5\u592a\u7b80\u5355&#xff0c;\u53ea\u8fd4\u56de ok<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u8017\u5c3d<\/p>\n<\/li>\n<li>\n<p>Redis \u6216\u4e0b\u6e38\u670d\u52a1\u4e0d\u53ef\u7528<\/p>\n<\/li>\n<li>\n<p>\u67d0\u4e2a\u4e1a\u52a1\u7ebf\u7a0b\u6c60\u6253\u6ee1<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u9519\u8bef\u5bfc\u81f4\u4e1a\u52a1\u903b\u8f91\u5931\u8d25<\/p>\n<\/li>\n<li>\n<p>\u4f9d\u8d56\u6743\u9650\u6216 token \u8fc7\u671f<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4e0d\u4f1a\u53ea\u770b\u5065\u5eb7\u68c0\u67e5&#xff0c;\u56e0\u4e3a\u5f88\u591a\u5065\u5eb7\u68c0\u67e5\u53ea\u662f\u8bc1\u660e\u5e94\u7528\u8fdb\u7a0b\u5b58\u6d3b\u3002 \u6211\u4f1a\u770b\u4e1a\u52a1\u63a5\u53e3\u7684\u9519\u8bef\u65e5\u5fd7\u548c\u94fe\u8def\u8ffd\u8e2a&#xff0c;\u786e\u8ba4\u662f\u54ea\u4e2a\u4f9d\u8d56\u5931\u8d25\u3002 \u5982\u679c\u4e1a\u52a1\u4f9d\u8d56\u4e0d\u53ef\u7528&#xff0c;\u53ef\u4ee5\u628a\u5065\u5eb7\u68c0\u67e5\u5206\u6210\u5b58\u6d3b\u68c0\u67e5\u548c\u5c31\u7eea\u68c0\u67e5&#xff0c;\u5c31\u7eea\u68c0\u67e5\u8981\u8986\u76d6\u6838\u5fc3\u4f9d\u8d56\u72b6\u6001\u3002 \u8fd9\u6837\u670d\u52a1\u4e0d\u53ef\u7528\u65f6&#xff0c;\u6ce8\u518c\u4e2d\u5fc3\u6216\u7f51\u5173\u53ef\u4ee5\u53ca\u65f6\u6458\u6d41\u91cf\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u8fdb\u7a0b\u6d3b\u7740\u4e0d\u7b49\u4e8e\u4e1a\u52a1\u53ef\u7528<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>10. \u7ebf\u4e0a\u5927\u91cf Connection reset \u6216 Broken pipe \u600e\u4e48\u5206\u6790&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u65e5\u5fd7\u91cc\u5927\u91cf Connection reset\u3001Broken pipe&#xff0c;\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u8fd9\u7c7b\u5f02\u5e38\u901a\u5e38\u548c\u8fde\u63a5\u88ab\u5bf9\u7aef\u5173\u95ed\u6709\u5173&#xff0c;\u8981\u7ed3\u5408\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u7aef\u3001\u7f51\u5173\u548c\u8d85\u65f6\u914d\u7f6e\u5206\u6790\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u5ba2\u6237\u7aef\u8d85\u65f6\u4e3b\u52a8\u65ad\u5f00<\/p>\n<\/li>\n<li>\n<p>\u7f51\u5173\u8d85\u65f6\u5173\u95ed\u8fde\u63a5<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u7aef\u54cd\u5e94\u592a\u6162<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u6c60\u4e2d\u7684\u8fde\u63a5\u5df2\u7ecf\u5931\u6548<\/p>\n<\/li>\n<li>\n<p>\u7f51\u7edc\u6296\u52a8\u6216\u8d1f\u8f7d\u5747\u8861\u5207\u8fde\u63a5<\/p>\n<\/li>\n<li>\n<p>\u5927\u54cd\u5e94\u4f53\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u5ba2\u6237\u7aef\u53d6\u6d88<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u5f02\u5e38\u53d1\u751f\u5728\u8c03\u7528\u65b9\u8fd8\u662f\u88ab\u8c03\u7528\u65b9&#xff0c;\u518d\u7ed3\u5408\u8bf7\u6c42\u8017\u65f6\u548c\u8d85\u65f6\u914d\u7f6e\u5224\u65ad\u3002 \u5982\u679c\u670d\u52a1\u7aef\u8fd8\u6ca1\u5199\u5b8c\u54cd\u5e94&#xff0c;\u5ba2\u6237\u7aef\u6216\u7f51\u5173\u5df2\u7ecf\u8d85\u65f6\u5173\u95ed\u8fde\u63a5&#xff0c;\u5c31\u53ef\u80fd\u51fa\u73b0 Broken pipe\u3002 \u5982\u679c\u590d\u7528\u8fde\u63a5\u65f6\u5bf9\u7aef\u5df2\u7ecf\u5173\u95ed&#xff0c;\u53ef\u80fd\u51fa\u73b0 Connection reset\u3002 \u89e3\u51b3\u4e0a\u8981\u7edf\u4e00\u7f51\u5173\u3001\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u7aef\u8d85\u65f6\u65f6\u95f4&#xff0c;\u4f18\u5316\u6162\u63a5\u53e3&#xff0c;\u5e76\u68c0\u67e5\u8fde\u63a5\u6c60\u4fdd\u6d3b\u914d\u7f6e\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u8fde\u63a5\u88ab\u5bf9\u7aef\u5173\u4e86&#xff0c;\u91cd\u70b9\u67e5\u8d85\u65f6\u548c\u6162\u54cd\u5e94<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>11. Tomcat \u7ebf\u7a0b\u6570\u6253\u6ee1\u4f46 CPU \u4e0d\u9ad8\u8bf4\u660e\u4ec0\u4e48&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>Tomcat \u7ebf\u7a0b\u6253\u6ee1\u4e86&#xff0c;\u4f46\u662f CPU \u4e0d\u9ad8&#xff0c;\u53ef\u80fd\u662f\u4ec0\u4e48\u95ee\u9898&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>CPU \u4e0d\u9ad8\u8bf4\u660e\u7ebf\u7a0b\u5927\u6982\u7387\u4e0d\u662f\u5728\u8ba1\u7b97&#xff0c;\u800c\u662f\u5728\u7b49\u5f85\u3002 \u8981\u7528\u7ebf\u7a0b\u6808\u770b\u7ebf\u7a0b\u7b49\u5f85\u7684\u662f\u6570\u636e\u5e93\u3001Redis\u3001\u4e0b\u6e38\u63a5\u53e3\u3001\u9501\u8fd8\u662f\u8fde\u63a5\u6c60\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u54cd\u5e94\u6162<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u83b7\u53d6\u8fde\u63a5\u6162<\/p>\n<\/li>\n<li>\n<p>SQL \u9501\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>Redis \u8fde\u63a5\u6c60\u8017\u5c3d<\/p>\n<\/li>\n<li>\n<p>synchronized \u9501\u7ade\u4e89<\/p>\n<\/li>\n<li>\n<p>\u5916\u90e8 IO \u963b\u585e<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>Tomcat \u7ebf\u7a0b\u6253\u6ee1\u4f46 CPU \u4e0d\u9ad8&#xff0c;\u6211\u4f1a\u4f18\u5148\u6000\u7591\u7ebf\u7a0b\u90fd\u963b\u585e\u5728 IO \u6216\u9501\u7b49\u5f85\u4e0a\u3002 \u6211\u4f1a\u5bfc\u51fa jstack&#xff0c;\u770b\u5927\u91cf\u4e1a\u52a1\u7ebf\u7a0b\u662f\u4e0d\u662f\u5361\u5728\u6570\u636e\u5e93\u3001Redis\u3001HTTP \u8c03\u7528\u6216\u9501\u4e0a\u3002 \u5982\u679c\u662f\u4e0b\u6e38\u6162&#xff0c;\u8981\u8bbe\u7f6e\u8d85\u65f6\u3001\u7194\u65ad\u548c\u7ebf\u7a0b\u6c60\u9694\u79bb&#xff1b;\u5982\u679c\u662f\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u7b49\u5f85&#xff0c;\u8981\u7ee7\u7eed\u67e5\u6162 SQL\u3001\u5927\u4e8b\u52a1\u548c\u8fde\u63a5\u6c60\u914d\u7f6e\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>CPU \u4e0d\u9ad8\u7ebf\u7a0b\u6ee1&#xff0c;\u591a\u534a\u662f\u5728\u7b49\u8d44\u6e90<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>12. \u4e0b\u6e38\u670d\u52a1\u53d8\u6162\u5bfc\u81f4\u4e0a\u6e38\u7ebf\u7a0b\u6c60\u88ab\u62d6\u57ae\u600e\u4e48\u9694\u79bb&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u4e00\u4e2a\u975e\u6838\u5fc3\u4e0b\u6e38\u53d8\u6162&#xff0c;\u628a\u4f60\u7684\u6838\u5fc3\u63a5\u53e3\u4e5f\u62d6\u6162\u4e86&#xff0c;\u600e\u4e48\u8bbe\u8ba1&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6838\u5fc3\u662f\u9694\u79bb&#xff0c;\u4e0d\u540c\u4e1a\u52a1\u3001\u4e0d\u540c\u4f9d\u8d56\u4e0d\u8981\u5171\u7528\u540c\u4e00\u6279\u7ebf\u7a0b\u548c\u8fde\u63a5\u8d44\u6e90\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u6838\u5fc3\u548c\u975e\u6838\u5fc3\u4e1a\u52a1\u7ebf\u7a0b\u6c60\u9694\u79bb<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u540c\u4e0b\u6e38\u4f7f\u7528\u72ec\u7acb\u8fde\u63a5\u6c60<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u8d85\u65f6\u3001\u7194\u65ad\u548c\u964d\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u975e\u6838\u5fc3\u529f\u80fd\u5931\u8d25\u65f6\u5feb\u901f\u8fd4\u56de\u9ed8\u8ba4\u503c<\/p>\n<\/li>\n<li>\n<p>\u9650\u5236\u91cd\u8bd5\u6b21\u6570&#xff0c;\u907f\u514d\u91cd\u8bd5\u98ce\u66b4<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u7ebf\u7a0b\u6c60\u548c\u8fde\u63a5\u6c60\u662f\u4e0d\u662f\u88ab\u67d0\u4e2a\u4e0b\u6e38\u8c03\u7528\u5360\u6ee1\u3002 \u5982\u679c\u6838\u5fc3\u63a5\u53e3\u548c\u975e\u6838\u5fc3\u63a5\u53e3\u5171\u7528\u7ebf\u7a0b\u6c60&#xff0c;\u4e00\u4e2a\u4e0b\u6e38\u6162\u5c31\u4f1a\u62d6\u57ae\u6240\u6709\u4e1a\u52a1\u3002 \u89e3\u51b3\u4e0a\u4f1a\u6309\u4e1a\u52a1\u6216\u4f9d\u8d56\u62c6\u5206\u7ebf\u7a0b\u6c60\u548c\u8fde\u63a5\u6c60&#xff0c;\u5e76\u8bbe\u7f6e\u8d85\u65f6\u3001\u7194\u65ad\u3001\u964d\u7ea7\u3002 \u975e\u6838\u5fc3\u4f9d\u8d56\u5f02\u5e38\u65f6\u5feb\u901f\u5931\u8d25\u6216\u8fd4\u56de\u515c\u5e95\u7ed3\u679c&#xff0c;\u4fdd\u62a4\u6838\u5fc3\u94fe\u8def\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u9694\u79bb\u8d44\u6e90&#xff0c;\u975e\u6838\u5fc3\u5931\u8d25\u4e0d\u80fd\u62d6\u57ae\u6838\u5fc3<\/p>\n<hr \/>\n<hr \/>\n<h2>\u4e8c\u3001JVM\u3001\u5185\u5b58\u4e0e\u7ebf\u7a0b\u95ee\u9898\u7c7b<\/h2>\n<h3>13. Full GC \u9891\u7e41\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u670d\u52a1\u9891\u7e41 Full GC&#xff0c;\u63a5\u53e3\u5361\u987f&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>Full GC \u9891\u7e41\u8981\u5148\u770b GC \u65e5\u5fd7\u548c\u5185\u5b58\u66f2\u7ebf&#xff0c;\u5224\u65ad\u662f\u8001\u5e74\u4ee3\u7a7a\u95f4\u4e0d\u8db3\u3001\u5bf9\u8c61\u5b58\u6d3b\u592a\u4e45&#xff0c;\u8fd8\u662f\u5b58\u5728\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u76d1\u63a7<\/p>\n<ul>\n<li>\n<p>Full GC \u6b21\u6570<\/p>\n<\/li>\n<li>\n<p>Full GC \u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>\u5806\u5185\u5b58\u4f7f\u7528\u7387<\/p>\n<\/li>\n<li>\n<p>Full GC \u540e\u5185\u5b58\u662f\u5426\u660e\u663e\u4e0b\u964d<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u67e5\u770b GC \u65e5\u5fd7<\/p>\n<\/li>\n<p>jstat -gcutil &lt;pid&gt; 1000<\/p>\n<p>\u89c2\u5bdf\u5e74\u8f7b\u4ee3\u3001\u8001\u5e74\u4ee3\u3001\u5143\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<li>\n<p>\u5bfc\u51fa\u5806\u5feb\u7167<\/p>\n<\/li>\n<p>jmap -dump:format&#061;b,file&#061;heap.hprof &lt;pid&gt;<\/p>\n<li>\n<p>\u4f7f\u7528 MAT \u6216 VisualVM \u5206\u6790<\/p>\n<ul>\n<li>\n<p>\u54ea\u4e9b\u5bf9\u8c61\u5360\u7528\u5185\u5b58\u6700\u591a<\/p>\n<\/li>\n<li>\n<p>\u54ea\u4e9b\u5bf9\u8c61\u6570\u91cf\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u8c01\u6301\u6709\u8fd9\u4e9b\u5bf9\u8c61\u5f15\u7528<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6709\u96c6\u5408\u3001\u7f13\u5b58\u3001ThreadLocal \u6ca1\u91ca\u653e<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u672c\u5730\u7f13\u5b58\u6ca1\u6709\u8fc7\u671f\u7b56\u7565&#xff0c;\u6570\u636e\u6301\u7eed\u589e\u957f<\/p>\n<\/li>\n<li>\n<p>\u5927\u96c6\u5408\u4e00\u6b21\u6027\u52a0\u8f7d\u8fc7\u591a\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>ThreadLocal \u4f7f\u7528\u540e\u6ca1\u6709 remove<\/p>\n<\/li>\n<li>\n<p>\u67e5\u8be2\u7ed3\u679c\u8fc7\u5927&#xff0c;\u5bfc\u81f4\u5927\u5bf9\u8c61\u8fdb\u5165\u8001\u5e74\u4ee3<\/p>\n<\/li>\n<li>\n<p>JVM \u5806\u914d\u7f6e\u4e0d\u5408\u7406<\/p>\n<\/li>\n<li>\n<p>\u52a8\u6001\u4ee3\u7406\u6216\u53cd\u5c04\u751f\u6210\u7c7b\u8fc7\u591a\u5bfc\u81f4\u5143\u7a7a\u95f4\u538b\u529b<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u5982\u679c\u662f\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u5c31\u6839\u636e\u5f15\u7528\u94fe\u4fee\u590d\u4ee3\u7801\u3002 \u5982\u679c\u662f\u7f13\u5b58\u65e0\u4e0a\u9650&#xff0c;\u5c31\u8bbe\u7f6e\u6700\u5927\u5bb9\u91cf\u548c\u8fc7\u671f\u65f6\u95f4\u3002 \u5982\u679c\u662f\u5927\u67e5\u8be2&#xff0c;\u5c31\u6539\u6210\u5206\u9875\u3001\u6e38\u6807\u6216\u6d41\u5f0f\u5904\u7406\u3002 \u5982\u679c\u662f\u5806\u914d\u7f6e\u4e0d\u5408\u7406&#xff0c;\u5c31\u7ed3\u5408\u5b9e\u9645\u5bf9\u8c61\u5b58\u6d3b\u60c5\u51b5\u8c03\u6574 JVM \u53c2\u6570\u3002<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b Full GC \u7684\u9891\u7387\u548c\u8017\u65f6&#xff0c;\u518d\u770b Full GC \u4e4b\u540e\u5806\u5185\u5b58\u80fd\u4e0d\u80fd\u964d\u4e0b\u6765\u3002 \u5982\u679c\u964d\u4e0d\u4e0b\u6765&#xff0c;\u6211\u4f1a\u4f18\u5148\u6000\u7591\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u5bfc\u51fa heap dump \u7528 MAT \u5206\u6790\u5927\u5bf9\u8c61\u548c\u5f15\u7528\u94fe\u3002 \u5982\u679c\u80fd\u964d\u4e0b\u6765\u4f46\u5f88\u5feb\u53c8\u6da8\u4e0a\u53bb&#xff0c;\u5c31\u770b\u662f\u4e0d\u662f\u5927\u5bf9\u8c61\u592a\u591a\u3001\u7f13\u5b58\u8fc7\u5927\u3001\u6279\u91cf\u67e5\u8be2\u6570\u636e\u592a\u591a&#xff0c;\u6216\u8005\u5806\u8bbe\u7f6e\u504f\u5c0f\u3002 \u89e3\u51b3\u4e0a\u4f1a\u9488\u5bf9\u6839\u56e0\u5904\u7406&#xff0c;\u6bd4\u5982\u9650\u5236\u7f13\u5b58\u5927\u5c0f\u3001\u4fee\u590d ThreadLocal\u3001\u5206\u9875\u5904\u7406\u5927\u6570\u636e&#xff0c;\u5e76\u7ed3\u5408 GC \u65e5\u5fd7\u8c03\u6574 JVM \u53c2\u6570\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u770b GC \u540e\u5185\u5b58\u964d\u4e0d\u964d -&gt; \u4e0d\u964d\u67e5\u6cc4\u6f0f -&gt; \u80fd\u964d\u67e5\u5927\u5bf9\u8c61\u548c\u5806\u914d\u7f6e<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>14. \u5185\u5b58\u6ca1\u6709\u660e\u663e\u4e0a\u6da8&#xff0c;\u4f46\u9891\u7e41 GC \u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5806\u5185\u5b58\u770b\u8d77\u6765\u6ca1\u6709\u6301\u7eed\u4e0a\u6da8&#xff0c;\u4f46 GC \u5f88\u9891\u7e41&#xff0c;\u53ef\u80fd\u662f\u4ec0\u4e48\u539f\u56e0&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u9891\u7e41 GC \u4e0d\u4e00\u5b9a\u662f\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u4e5f\u53ef\u80fd\u662f\u5bf9\u8c61\u521b\u5efa\u592a\u5feb&#xff0c;\u5e74\u8f7b\u4ee3\u538b\u529b\u5927\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u77ac\u65f6\u5bf9\u8c61\u521b\u5efa\u8fc7\u591a<\/p>\n<\/li>\n<li>\n<p>\u5e74\u8f7b\u4ee3\u914d\u7f6e\u592a\u5c0f<\/p>\n<\/li>\n<li>\n<p>\u5927\u91cf\u4e34\u65f6\u96c6\u5408\u3001\u5b57\u7b26\u4e32\u62fc\u63a5\u3001JSON \u5bf9\u8c61<\/p>\n<\/li>\n<li>\n<p>\u63a5\u53e3 QPS \u7a81\u589e<\/p>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u6216\u5e8f\u5217\u5316\u4ea7\u751f\u5927\u91cf\u4e34\u65f6\u5bf9\u8c61<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b GC \u7c7b\u578b&#xff0c;\u5982\u679c\u662f Young GC \u9891\u7e41\u4f46 Full GC \u4e0d\u591a&#xff0c;\u901a\u5e38\u8bf4\u660e\u77ed\u751f\u547d\u5468\u671f\u5bf9\u8c61\u521b\u5efa\u592a\u5feb\u3002 \u8fd9\u65f6\u4f1a\u7ed3\u5408\u63a5\u53e3 QPS\u3001\u5bf9\u8c61\u5206\u914d\u901f\u7387\u548c\u4ee3\u7801\u70ed\u70b9&#xff0c;\u68c0\u67e5\u662f\u5426\u6709\u5927\u91cf\u4e34\u65f6\u96c6\u5408\u3001JSON \u8f6c\u6362\u6216\u5b57\u7b26\u4e32\u5904\u7406\u3002 \u4f18\u5316\u4e0a\u53ef\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u5bf9\u8c61\u521b\u5efa\u3001\u590d\u7528\u5bf9\u8c61\u3001\u4f18\u5316\u5e8f\u5217\u5316&#xff0c;\u5e76\u7ed3\u5408\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u5e74\u8f7b\u4ee3\u5927\u5c0f\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5185\u5b58\u4e0d\u6da8\u4f46 GC \u9891\u7e41&#xff0c;\u91cd\u70b9\u770b\u5bf9\u8c61\u5206\u914d\u901f\u7387<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>15. \u5806\u5916\u5185\u5b58\u6ea2\u51fa\u600e\u4e48\u5b9a\u4f4d&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>Java \u5806\u4e0d\u9ad8&#xff0c;\u4f46\u8fdb\u7a0b\u5185\u5b58\u4e00\u76f4\u6da8&#xff0c;\u6700\u540e\u88ab\u7cfb\u7edf kill&#xff0c;\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5806\u4e0d\u9ad8\u4f46\u8fdb\u7a0b\u5185\u5b58\u9ad8&#xff0c;\u8981\u770b\u5806\u5916\u5185\u5b58\u3001\u76f4\u63a5\u5185\u5b58\u3001\u7ebf\u7a0b\u6808\u3001Metaspace \u548c native \u5185\u5b58\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>Netty DirectByteBuffer \u6cc4\u6f0f<\/p>\n<\/li>\n<li>\n<p>NIO \u76f4\u63a5\u5185\u5b58\u4f7f\u7528\u8fc7\u591a<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6570\u592a\u591a\u5bfc\u81f4\u7ebf\u7a0b\u6808\u5360\u7528\u5927<\/p>\n<\/li>\n<li>\n<p>Metaspace \u589e\u957f<\/p>\n<\/li>\n<li>\n<p>JNI \u6216\u672c\u5730\u5e93\u5185\u5b58\u6cc4\u6f0f<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u533a\u5206 JVM \u5806\u5185\u5b58\u548c\u8fdb\u7a0b RSS&#xff0c;\u5982\u679c\u5806\u4e0d\u9ad8\u4f46 RSS \u5f88\u9ad8&#xff0c;\u5c31\u6000\u7591\u5806\u5916\u5185\u5b58\u3002 \u53ef\u4ee5\u5f00\u542f Native Memory Tracking&#xff0c;\u7528 jcmd VM.native_memory \u770b native \u5185\u5b58\u5206\u5e03\u3002 \u5982\u679c\u662f Netty \u6216 NIO \u573a\u666f&#xff0c;\u4f1a\u91cd\u70b9\u67e5 DirectByteBuffer \u548c\u5f15\u7528\u91ca\u653e\u3002 \u540c\u65f6\u770b\u7ebf\u7a0b\u6570\u91cf\u3001Metaspace \u548c\u672c\u5730\u5e93\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5806\u4e0d\u9ad8 RSS \u9ad8&#xff0c;\u91cd\u70b9\u67e5\u5806\u5916\u548c\u7ebf\u7a0b\u6808<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>16. \u7ebf\u7a0b\u6570\u6301\u7eed\u4e0a\u6da8&#xff0c;\u6700\u540e\u670d\u52a1\u4e0d\u53ef\u7528\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u670d\u52a1\u7ebf\u7a0b\u6570\u4e00\u76f4\u6da8&#xff0c;\u6700\u540e\u521b\u5efa\u7ebf\u7a0b\u5931\u8d25&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u7ebf\u7a0b\u6570\u6301\u7eed\u4e0a\u6da8\u901a\u5e38\u662f\u7ebf\u7a0b\u6c60\u4f7f\u7528\u4e0d\u89c4\u8303\u3001\u5b9a\u65f6\u4efb\u52a1\u91cd\u590d\u521b\u5efa\u7ebf\u7a0b&#xff0c;\u6216\u8005\u8fde\u63a5\u6ca1\u6709\u91ca\u653e\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u6bcf\u6b21\u8bf7\u6c42\u90fd new Thread<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u6ca1\u6709\u590d\u7528\u6216\u6ca1\u6709\u5173\u95ed<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u65f6\u4efb\u52a1\u91cd\u590d\u521b\u5efa\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u65b9 SDK \u521b\u5efa\u5927\u91cf\u7ebf\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u963b\u585e\u8c03\u7528\u5bfc\u81f4\u7ebf\u7a0b\u957f\u671f\u4e0d\u91ca\u653e<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u7ebf\u7a0b\u6570\u91cf\u66f2\u7ebf&#xff0c;\u518d\u7528 jstack \u770b\u7ebf\u7a0b\u540d\u79f0\u548c\u7ebf\u7a0b\u6808\u3002 \u5982\u679c\u7ebf\u7a0b\u540d\u79f0\u96c6\u4e2d\u5728\u67d0\u4e2a\u4e1a\u52a1\u524d\u7f00\u6216\u7b2c\u4e09\u65b9 SDK&#xff0c;\u5c31\u80fd\u5b9a\u4f4d\u6765\u6e90\u3002 \u4ee3\u7801\u5c42\u9762\u8981\u7981\u6b62\u8bf7\u6c42\u5185\u76f4\u63a5\u521b\u5efa\u7ebf\u7a0b&#xff0c;\u7edf\u4e00\u4f7f\u7528\u53d7\u63a7\u7ebf\u7a0b\u6c60&#xff0c;\u5e76\u8bbe\u7f6e\u7ebf\u7a0b\u6c60\u76d1\u63a7\u3002 \u5982\u679c\u7ebf\u7a0b\u957f\u671f\u963b\u585e&#xff0c;\u8fd8\u8981\u7ee7\u7eed\u67e5\u5b83\u5361\u5728\u6570\u636e\u5e93\u3001HTTP \u8c03\u7528\u8fd8\u662f\u9501\u7b49\u5f85\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u7ebf\u7a0b\u6570\u4e0a\u6da8&#xff0c;\u770b\u7ebf\u7a0b\u540d\u548c\u7ebf\u7a0b\u6808\u5b9a\u4f4d\u6765\u6e90<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>17. \u7ebf\u4e0a OOM \u540e dump \u6587\u4ef6\u592a\u5927\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a OOM \u4e86&#xff0c;dump \u6587\u4ef6\u5f88\u5927&#xff0c;\u76f4\u63a5\u62f7\u8d1d\u548c\u5206\u6790\u90fd\u5f88\u56f0\u96be&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5148\u4fdd\u7559\u73b0\u573a&#xff0c;\u4f46\u4e5f\u8981\u5c3d\u5feb\u6062\u590d\u670d\u52a1\u3002 \u5927 dump \u53ef\u4ee5\u5728\u670d\u52a1\u5668\u672c\u5730\u538b\u7f29\u3001\u62bd\u6837\u5206\u6790&#xff0c;\u6216\u8005\u7528\u66f4\u9ad8\u914d\u7f6e\u673a\u5668\u5206\u6790\u3002<\/p>\n<h4>\u5904\u7406\u65b9\u6848<\/h4>\n<li>\n<p>\u914d\u7f6e OOM \u81ea\u52a8 dump<\/p>\n<\/li>\n<li>\n<p>dump \u540e\u5148\u538b\u7f29\u4fdd\u5b58<\/p>\n<\/li>\n<li>\n<p>\u4e1a\u52a1\u5148\u91cd\u542f\u6216\u6458\u6d41\u91cf\u6062\u590d<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 MAT\u3001VisualVM \u6216 Eclipse Memory Analyzer \u5206\u6790<\/p>\n<\/li>\n<li>\n<p>\u5148\u770b histogram\u3001\u5927\u5bf9\u8c61\u548c\u5f15\u7528\u94fe<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c dump \u592a\u5927&#xff0c;\u5728\u9ad8\u5185\u5b58\u673a\u5668\u4e0a\u5206\u6790<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u7ebf\u4e0a OOM \u6211\u4f1a\u5148\u786e\u8ba4\u662f\u5426\u5df2\u7ecf\u751f\u6210 heap dump&#xff0c;\u5e76\u4fdd\u7559 GC \u65e5\u5fd7\u548c\u5e94\u7528\u65e5\u5fd7\u3002 \u5982\u679c dump \u5f88\u5927&#xff0c;\u4f1a\u5148\u538b\u7f29\u4fdd\u5b58&#xff0c;\u5fc5\u8981\u65f6\u653e\u5230\u66f4\u9ad8\u5185\u5b58\u7684\u673a\u5668\u4e0a\u7528 MAT \u5206\u6790\u3002 \u5206\u6790\u65f6\u5148\u770b\u5bf9\u8c61\u76f4\u65b9\u56fe\u548c dominator tree&#xff0c;\u627e\u5230\u5360\u7528\u6700\u5927\u7684\u5bf9\u8c61\u548c\u5f15\u7528\u94fe\u3002 \u540c\u65f6\u7ebf\u4e0a\u5148\u901a\u8fc7\u91cd\u542f\u3001\u6458\u6d41\u91cf\u6216\u6269\u5bb9\u6062\u590d\u670d\u52a1\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>OOM \u5148\u4fdd\u73b0\u573a&#xff0c;\u518d\u6062\u590d\u670d\u52a1&#xff0c;dump \u770b\u5927\u5bf9\u8c61\u548c\u5f15\u7528\u94fe<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>18. Metaspace OOM \u600e\u4e48\u5206\u6790&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u62a5 OutOfMemoryError: Metaspace&#xff0c;\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>Metaspace \u5b58\u7684\u662f\u7c7b\u5143\u6570\u636e&#xff0c;\u5e38\u89c1\u539f\u56e0\u662f\u52a8\u6001\u751f\u6210\u7c7b\u592a\u591a\u6216\u7c7b\u52a0\u8f7d\u5668\u6cc4\u6f0f\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>CGLIB \u52a8\u6001\u4ee3\u7406\u5927\u91cf\u751f\u6210\u7c7b<\/p>\n<\/li>\n<li>\n<p>\u53cd\u5c04\u6216\u8868\u8fbe\u5f0f\u5f15\u64ce\u52a8\u6001\u751f\u6210\u7c7b<\/p>\n<\/li>\n<li>\n<p>\u70ed\u90e8\u7f72\u5bfc\u81f4\u7c7b\u52a0\u8f7d\u5668\u65e0\u6cd5\u56de\u6536<\/p>\n<\/li>\n<li>\n<p>Groovy\u3001JSP\u3001\u811a\u672c\u5f15\u64ce\u751f\u6210\u7c7b\u8fc7\u591a<\/p>\n<\/li>\n<li>\n<p>Metaspace \u914d\u7f6e\u8fc7\u5c0f<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b Metaspace \u4f7f\u7528\u66f2\u7ebf\u548c\u7c7b\u52a0\u8f7d\u6570\u91cf\u662f\u5426\u6301\u7eed\u4e0a\u6da8\u3002 \u5982\u679c\u7c7b\u6570\u91cf\u4e00\u76f4\u589e\u52a0&#xff0c;\u5c31\u6000\u7591\u52a8\u6001\u751f\u6210\u7c7b\u8fc7\u591a\u6216\u7c7b\u52a0\u8f7d\u5668\u6cc4\u6f0f\u3002 \u53ef\u4ee5\u901a\u8fc7 dump \u548c\u7c7b\u52a0\u8f7d\u7edf\u8ba1\u770b\u54ea\u4e9b\u7c7b\u6570\u91cf\u5f02\u5e38\u3002 \u89e3\u51b3\u4e0a\u8981\u4fee\u590d\u52a8\u6001\u751f\u6210\u7c7b\u903b\u8f91&#xff0c;\u907f\u514d\u91cd\u590d\u751f\u6210&#xff0c;\u5fc5\u8981\u65f6\u8c03\u6574 MaxMetaspaceSize&#xff0c;\u4f46\u53c2\u6570\u8c03\u6574\u4e0d\u662f\u6839\u672c\u65b9\u6848\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>Metaspace OOM \u770b\u7c7b\u6570\u91cf\u548c\u7c7b\u52a0\u8f7d\u5668<\/p>\n<hr \/>\n<hr \/>\n<h2>\u4e09\u3001MySQL \u4e0e\u6570\u636e\u5e93\u95ee\u9898\u7c7b<\/h2>\n<h3>19. \u6162 SQL \u600e\u4e48\u6392\u67e5\u548c\u4f18\u5316&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u63a5\u53e3\u6162&#xff0c;\u6700\u540e\u53d1\u73b0\u662f SQL \u6162&#xff0c;\u4f60\u600e\u4e48\u5b9a\u4f4d\u548c\u4f18\u5316&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6162 SQL \u4e0d\u80fd\u53ea\u8bf4\u52a0\u7d22\u5f15&#xff0c;\u8981\u5148\u901a\u8fc7\u6162\u67e5\u8be2\u65e5\u5fd7\u5b9a\u4f4d SQL&#xff0c;\u518d\u7528 EXPLAIN \u770b\u6267\u884c\u8ba1\u5212\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u5f00\u542f\u6216\u67e5\u770b\u6162\u67e5\u8be2\u65e5\u5fd7<\/p>\n<ul>\n<li>\n<p>SQL \u6267\u884c\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u626b\u63cf\u884c\u6570<\/p>\n<\/li>\n<li>\n<p>\u8fd4\u56de\u884c\u6570<\/p>\n<\/li>\n<li>\n<p>\u6267\u884c\u9891\u7387<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4f7f\u7528 EXPLAIN<\/p>\n<\/li>\n<p>EXPLAIN SELECT &#8230;<\/p>\n<p>\u91cd\u70b9\u770b&#xff1a;<\/p>\n<li>\n<p>type \u662f\u5426\u662f ALL<\/p>\n<\/li>\n<li>\n<p>key \u662f\u5426\u4f7f\u7528\u7d22\u5f15<\/p>\n<\/li>\n<li>\n<p>rows \u626b\u63cf\u884c\u6570\u662f\u5426\u8fc7\u5927<\/p>\n<\/li>\n<li>\n<p>Extra \u662f\u5426\u51fa\u73b0 Using filesort\u3001Using temporary<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u51fa\u73b0\u56de\u8868\u3001\u7d22\u5f15\u5931\u6548\u3001\u9690\u5f0f\u8f6c\u6362<\/p>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u67e5\u8be2\u6761\u4ef6\u6ca1\u6709\u7d22\u5f15<\/p>\n<\/li>\n<li>\n<p>\u8054\u5408\u7d22\u5f15\u987a\u5e8f\u4e0d\u5408\u7406<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u7d22\u5f15\u5b57\u6bb5\u4f7f\u7528\u51fd\u6570\u5bfc\u81f4\u7d22\u5f15\u5931\u6548<\/p>\n<\/li>\n<li>\n<p>\u5b57\u6bb5\u7c7b\u578b\u4e0d\u4e00\u81f4\u5bfc\u81f4\u9690\u5f0f\u8f6c\u6362<\/p>\n<\/li>\n<li>\n<p>like &#039;%xxx&#039; \u65e0\u6cd5\u4f7f\u7528\u666e\u901a\u7d22\u5f15<\/p>\n<\/li>\n<li>\n<p>\u6df1\u5206\u9875\u5bfc\u81f4\u626b\u63cf\u5927\u91cf\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>select * \u5bfc\u81f4\u56de\u8868\u548c\u7f51\u7edc\u4f20\u8f93\u53d8\u591a<\/p>\n<\/li>\n<li>\n<p>\u5927\u4e8b\u52a1\u6216\u9501\u7b49\u5f85\u5bfc\u81f4 SQL \u53d8\u6162<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4e3a\u9ad8\u9891\u67e5\u8be2\u8bbe\u8ba1\u5408\u9002\u7d22\u5f15<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u8986\u76d6\u7d22\u5f15\u51cf\u5c11\u56de\u8868<\/p>\n<\/li>\n<li>\n<p>\u8c03\u6574\u8054\u5408\u7d22\u5f15\u987a\u5e8f&#xff0c;\u9075\u5b88\u6700\u5de6\u524d\u7f00\u539f\u5219<\/p>\n<\/li>\n<li>\n<p>\u907f\u514d\u5728\u7d22\u5f15\u5b57\u6bb5\u4e0a\u4f7f\u7528\u51fd\u6570\u6216\u9690\u5f0f\u8f6c\u6362<\/p>\n<\/li>\n<li>\n<p>\u6df1\u5206\u9875\u6539\u6210\u57fa\u4e8e ID \u7684\u5ef6\u8fdf\u5173\u8054\u6216\u6e38\u6807\u5206\u9875<\/p>\n<\/li>\n<li>\n<p>\u51cf\u5c11 select *&#xff0c;\u53ea\u67e5\u8be2\u5fc5\u8981\u5b57\u6bb5<\/p>\n<\/li>\n<li>\n<p>\u62c6\u5206\u5927\u4e8b\u52a1&#xff0c;\u51cf\u5c11\u9501\u6301\u6709\u65f6\u95f4<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u4ece\u6162\u67e5\u8be2\u65e5\u5fd7\u91cc\u5b9a\u4f4d\u5177\u4f53 SQL&#xff0c;\u7136\u540e\u7528 EXPLAIN \u770b\u6267\u884c\u8ba1\u5212\u3002 \u91cd\u70b9\u770b\u6709\u6ca1\u6709\u8d70\u7d22\u5f15\u3001\u626b\u63cf\u884c\u6570\u5927\u4e0d\u5927\u3001\u6709\u6ca1\u6709\u6587\u4ef6\u6392\u5e8f\u548c\u4e34\u65f6\u8868&#xff0c;\u4ee5\u53ca\u662f\u5426\u5b58\u5728\u9501\u7b49\u5f85\u3002 \u5982\u679c\u662f\u7d22\u5f15\u95ee\u9898&#xff0c;\u5c31\u6839\u636e\u67e5\u8be2\u6761\u4ef6\u548c\u6392\u5e8f\u5b57\u6bb5\u8bbe\u8ba1\u8054\u5408\u7d22\u5f15&#xff1b;\u5982\u679c\u662f\u6df1\u5206\u9875&#xff0c;\u5c31\u6539\u6210\u57fa\u4e8e\u4e3b\u952e\u7684\u5206\u9875&#xff1b;\u5982\u679c\u662f\u9501\u7b49\u5f85&#xff0c;\u5c31\u7ee7\u7eed\u6392\u67e5\u4e8b\u52a1\u8303\u56f4\u548c\u66f4\u65b0\u987a\u5e8f\u3002 \u4f18\u5316\u540e\u8fd8\u8981\u5bf9\u6bd4\u6267\u884c\u8ba1\u5212\u548c\u63a5\u53e3 RT&#xff0c;\u786e\u8ba4\u4f18\u5316\u786e\u5b9e\u751f\u6548\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6162\u65e5\u5fd7\u5b9a\u4f4d SQL -&gt; EXPLAIN \u770b\u8ba1\u5212 -&gt; \u7d22\u5f15\u3001\u6392\u5e8f\u3001\u9501\u7b49\u5f85\u9010\u4e2a\u6392<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>20. \u6570\u636e\u5e93\u8fde\u63a5\u6c60\u6253\u6ee1\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u62a5\u83b7\u53d6\u6570\u636e\u5e93\u8fde\u63a5\u8d85\u65f6&#xff0c;\u8fde\u63a5\u6c60\u6ee1\u4e86&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u8fde\u63a5\u6c60\u6ee1\u4e0d\u4e00\u5b9a\u662f\u8fde\u63a5\u6570\u592a\u5c0f&#xff0c;\u66f4\u591a\u65f6\u5019\u662f\u8fde\u63a5\u88ab\u5360\u7528\u592a\u4e45\u3002 \u8981\u770b\u6162 SQL\u3001\u5927\u4e8b\u52a1\u3001\u8fde\u63a5\u6cc4\u6f0f\u548c\u6570\u636e\u5e93\u54cd\u5e94\u65f6\u95f4\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u8fde\u63a5\u6c60\u6307\u6807<\/p>\n<ul>\n<li>\n<p>\u6d3b\u8dc3\u8fde\u63a5\u6570<\/p>\n<\/li>\n<li>\n<p>\u7a7a\u95f2\u8fde\u63a5\u6570<\/p>\n<\/li>\n<li>\n<p>\u7b49\u5f85\u8fde\u63a5\u6570<\/p>\n<\/li>\n<li>\n<p>\u83b7\u53d6\u8fde\u63a5\u8d85\u65f6\u6b21\u6570<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u6570\u636e\u5e93\u72b6\u6001<\/p>\n<ul>\n<li>\n<p>\u5f53\u524d\u8fde\u63a5\u6570<\/p>\n<\/li>\n<li>\n<p>\u6162 SQL<\/p>\n<\/li>\n<li>\n<p>\u9501\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>CPU\u3001IO\u3001\u78c1\u76d8<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u5e94\u7528\u65e5\u5fd7<\/p>\n<ul>\n<li>\n<p>\u662f\u5426\u6709\u8fde\u63a5\u6cc4\u6f0f\u63d0\u793a<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u5927\u91cf\u8bf7\u6c42\u5361\u5728\u83b7\u53d6\u8fde\u63a5<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u67d0\u4e2a\u63a5\u53e3\u7a81\u7136\u8c03\u7528\u91cf\u5347\u9ad8<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u4e8b\u52a1\u4ee3\u7801<\/p>\n<ul>\n<li>\n<p>\u4e8b\u52a1\u4e2d\u662f\u5426\u8c03\u7528\u8fdc\u7a0b\u63a5\u53e3<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u662f\u5426\u5305\u542b\u5927\u91cf\u5faa\u73af\u64cd\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u5b58\u5728\u5927\u6279\u91cf\u66f4\u65b0<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u6162 SQL \u5360\u7528\u8fde\u63a5\u65f6\u95f4\u8fc7\u957f<\/p>\n<\/li>\n<li>\n<p>\u5927\u4e8b\u52a1\u957f\u65f6\u95f4\u4e0d\u63d0\u4ea4<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u4e2d\u8c03\u7528\u5916\u90e8\u63a5\u53e3<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u9501\u7b49\u5f85<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u6cc4\u6f0f<\/p>\n<\/li>\n<li>\n<p>\u6d41\u91cf\u7a81\u589e&#xff0c;\u8fde\u63a5\u6c60\u5bb9\u91cf\u4e0d\u8db3<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u77ed\u671f\u53ef\u4ee5\u6269\u5bb9\u8fde\u63a5\u6c60\u6216\u5e94\u7528\u5b9e\u4f8b&#xff0c;\u4f46\u4e0d\u80fd\u53ea\u9760\u8c03\u5927\u8fde\u63a5\u6570\u3002 \u957f\u671f\u8981\u4f18\u5316\u6162 SQL\u3001\u7f29\u77ed\u4e8b\u52a1\u8303\u56f4\u3001\u907f\u514d\u4e8b\u52a1\u5185\u8fdc\u7a0b\u8c03\u7528\u3001\u4fee\u590d\u8fde\u63a5\u6cc4\u6f0f&#xff0c;\u5e76\u505a\u597d\u8fde\u63a5\u6c60\u76d1\u63a7\u3002<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u8fde\u63a5\u6c60\u7684\u6d3b\u8dc3\u8fde\u63a5\u3001\u7b49\u5f85\u7ebf\u7a0b\u548c\u8d85\u65f6\u6b21\u6570&#xff0c;\u786e\u8ba4\u662f\u4e0d\u662f\u8fde\u63a5\u90fd\u88ab\u5360\u6ee1\u4e86\u3002 \u7136\u540e\u770b\u6570\u636e\u5e93\u6162 SQL \u548c\u9501\u7b49\u5f85&#xff0c;\u5224\u65ad\u8fde\u63a5\u662f\u88ab\u6162\u67e5\u8be2\u5360\u4f4f&#xff0c;\u8fd8\u662f\u88ab\u5927\u4e8b\u52a1\u5360\u4f4f\u3002 \u5982\u679c\u4ee3\u7801\u91cc\u4e8b\u52a1\u8303\u56f4\u592a\u5927&#xff0c;\u6bd4\u5982\u4e8b\u52a1\u4e2d\u8c03\u7528\u8fdc\u7a0b\u63a5\u53e3&#xff0c;\u5c31\u8981\u628a\u8fdc\u7a0b\u8c03\u7528\u79fb\u51fa\u4e8b\u52a1\u3002 \u77ed\u671f\u53ef\u4ee5\u6269\u5bb9\u548c\u9650\u6d41\u6b62\u635f&#xff0c;\u957f\u671f\u8981\u4f18\u5316 SQL\u3001\u7f29\u77ed\u4e8b\u52a1\u3001\u4fee\u590d\u8fde\u63a5\u6cc4\u6f0f\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u8fde\u63a5\u6c60\u6ee1 &#061; \u8fde\u63a5\u88ab\u5360\u592a\u4e45&#xff0c;\u91cd\u70b9\u67e5\u6162 SQL\u3001\u5927\u4e8b\u52a1\u3001\u9501\u7b49\u5f85<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>21. MySQL \u5927\u91cf\u9501\u7b49\u5f85\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a MySQL \u51fa\u73b0\u5927\u91cf\u9501\u7b49\u5f85&#xff0c;\u63a5\u53e3\u90fd\u5361\u4f4f\u4e86&#xff0c;\u4f60\u600e\u4e48\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u9501\u7b49\u5f85\u8981\u5148\u627e\u8c01\u5728\u7b49\u9501\u3001\u8c01\u6301\u6709\u9501&#xff0c;\u518d\u770b\u5bf9\u5e94 SQL \u548c\u4e8b\u52a1\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<p>SHOW PROCESSLIST;<br \/>\nSHOW ENGINE INNODB STATUS;<\/p>\n<p>\u91cd\u70b9\u770b&#xff1a;<\/p>\n<li>\n<p>\u5f53\u524d\u963b\u585e SQL<\/p>\n<\/li>\n<li>\n<p>\u6301\u9501\u4e8b\u52a1\u6267\u884c\u4e86\u591a\u4e45<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6709\u5927\u4e8b\u52a1\u672a\u63d0\u4ea4<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u66f4\u65b0\u987a\u5e8f\u4e0d\u4e00\u81f4<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u7d22\u5f15\u7f3a\u5931\u5bfc\u81f4\u9501\u8303\u56f4\u6269\u5927<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u7528 SHOW PROCESSLIST \u548c InnoDB \u72b6\u6001\u770b\u5f53\u524d\u9501\u7b49\u5f85&#xff0c;\u627e\u5230\u88ab\u963b\u585e\u7684 SQL \u548c\u6301\u9501\u4e8b\u52a1\u3002 \u7136\u540e\u770b\u6301\u9501\u4e8b\u52a1\u662f\u4e0d\u662f\u6267\u884c\u65f6\u95f4\u8fc7\u957f&#xff0c;\u6216\u8005 SQL \u6ca1\u8d70\u7d22\u5f15\u5bfc\u81f4\u9501\u4f4f\u4e86\u5927\u91cf\u8bb0\u5f55\u3002 \u77ed\u671f\u53ef\u4ee5\u8bc4\u4f30\u662f\u5426 kill \u6389\u5f02\u5e38\u957f\u4e8b\u52a1&#xff0c;\u6062\u590d\u4e1a\u52a1\u3002 \u957f\u671f\u8981\u4f18\u5316\u7d22\u5f15\u3001\u7f29\u77ed\u4e8b\u52a1\u8303\u56f4&#xff0c;\u907f\u514d\u4e8b\u52a1\u91cc\u505a\u8fdc\u7a0b\u8c03\u7528&#xff0c;\u5e76\u7edf\u4e00\u66f4\u65b0\u987a\u5e8f\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5148\u627e\u8c01\u7b49\u9501&#xff0c;\u518d\u627e\u8c01\u6301\u9501<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>22. MySQL \u6b7b\u9501\u600e\u4e48\u5b9a\u4f4d\u548c\u907f\u514d&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u51fa\u73b0\u6b7b\u9501\u5f02\u5e38&#xff0c;\u4f60\u600e\u4e48\u5b9a\u4f4d&#xff1f;\u600e\u4e48\u907f\u514d&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6b7b\u9501\u4e0d\u662f\u5355\u7eaf\u6570\u636e\u5e93\u95ee\u9898&#xff0c;\u672c\u8d28\u662f\u591a\u4e2a\u4e8b\u52a1\u4e92\u76f8\u7b49\u5f85\u5bf9\u65b9\u6301\u6709\u7684\u9501\u3002 \u8981\u770b\u6b7b\u9501\u65e5\u5fd7\u4e2d\u7684\u4e24\u4e2a\u4e8b\u52a1\u548c\u5bf9\u5e94 SQL\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<p>SHOW ENGINE INNODB STATUS;<\/p>\n<p>\u91cd\u70b9\u770b\u6700\u8fd1\u4e00\u6b21\u6b7b\u9501\u4fe1\u606f&#xff1a;<\/p>\n<li>\n<p>\u54ea\u4e24\u4e2a\u4e8b\u52a1\u53d1\u751f\u6b7b\u9501<\/p>\n<\/li>\n<li>\n<p>\u5404\u81ea\u6267\u884c\u4e86\u4ec0\u4e48 SQL<\/p>\n<\/li>\n<li>\n<p>\u6301\u6709\u4ec0\u4e48\u9501&#xff0c;\u7b49\u5f85\u4ec0\u4e48\u9501<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u66f4\u65b0\u987a\u5e8f\u4e0d\u4e00\u81f4<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u7d22\u5f15\u7f3a\u5931\u5bfc\u81f4\u9501\u8303\u56f4\u8fc7\u5927<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u901a\u8fc7 InnoDB status \u67e5\u770b\u6700\u8fd1\u4e00\u6b21\u6b7b\u9501\u8be6\u60c5&#xff0c;\u627e\u5230\u4e24\u4e2a\u4e8b\u52a1\u5206\u522b\u6267\u884c\u7684 SQL\u3002 \u7136\u540e\u5206\u6790\u5b83\u4eec\u7684\u52a0\u9501\u987a\u5e8f&#xff0c;\u5982\u679c\u4e24\u4e2a\u4e8b\u52a1\u4ee5\u4e0d\u540c\u987a\u5e8f\u66f4\u65b0\u76f8\u540c\u8d44\u6e90&#xff0c;\u5c31\u5bb9\u6613\u4e92\u76f8\u7b49\u5f85\u3002 \u89e3\u51b3\u4e0a\u4f1a\u7edf\u4e00\u8d44\u6e90\u66f4\u65b0\u987a\u5e8f\u3001\u7f29\u77ed\u4e8b\u52a1\u8303\u56f4\u3001\u8865\u5145\u5408\u9002\u7d22\u5f15&#xff0c;\u5e76\u8ba9\u4e1a\u52a1\u5bf9\u6b7b\u9501\u5f02\u5e38\u505a\u6709\u9650\u91cd\u8bd5\u3002 \u56e0\u4e3a InnoDB \u68c0\u6d4b\u5230\u6b7b\u9501\u540e\u4f1a\u56de\u6eda\u5176\u4e2d\u4e00\u4e2a\u4e8b\u52a1&#xff0c;\u6240\u4ee5\u4e1a\u52a1\u4fa7\u8981\u80fd\u63a5\u53d7\u5e76\u91cd\u8bd5\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6b7b\u9501\u770b\u4e8b\u52a1\u52a0\u9501\u987a\u5e8f&#xff0c;\u4e1a\u52a1\u8981\u80fd\u91cd\u8bd5<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>23. \u4e3b\u4ece\u5ef6\u8fdf\u5bfc\u81f4\u8bfb\u4e0d\u5230\u521a\u5199\u5165\u7684\u6570\u636e\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u6570\u636e\u521a\u5199\u5165\u4e3b\u5e93&#xff0c;\u9a6c\u4e0a\u67e5\u4ece\u5e93\u67e5\u4e0d\u5230&#xff0c;\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u8fd9\u662f\u5178\u578b\u4e3b\u4ece\u5ef6\u8fdf\u95ee\u9898\u3002 \u6838\u5fc3\u662f\u5173\u952e\u8bfb\u8d70\u4e3b\u5e93&#xff0c;\u666e\u901a\u8bfb\u8d70\u4ece\u5e93\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u5199\u540e\u77ed\u65f6\u95f4\u5185\u8bfb\u4e3b\u5e93<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e00\u81f4\u6027\u8981\u6c42\u9ad8\u7684\u63a5\u53e3\u5f3a\u5236\u8bfb\u4e3b\u5e93<\/p>\n<\/li>\n<li>\n<p>\u6839\u636e\u4e1a\u52a1\u6d41\u6c34\u53f7\u6216\u4e0a\u4e0b\u6587\u505a\u8bfb\u5199\u8def\u7531<\/p>\n<\/li>\n<li>\n<p>\u76d1\u63a7\u4e3b\u4ece\u5ef6\u8fdf&#xff0c;\u5ef6\u8fdf\u8fc7\u9ad8\u65f6\u964d\u7ea7\u4e3a\u8bfb\u4e3b<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5316\u5927\u4e8b\u52a1&#xff0c;\u51cf\u5c11\u4e3b\u4ece\u590d\u5236\u538b\u529b<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u786e\u8ba4\u662f\u4e0d\u662f\u8bfb\u5199\u5206\u79bb\u5bfc\u81f4\u8bfb\u5230\u4e86\u4ece\u5e93\u3002 \u5982\u679c\u4e1a\u52a1\u8981\u6c42\u5199\u540e\u7acb\u5373\u53ef\u89c1&#xff0c;\u6bd4\u5982\u4e0b\u5355\u540e\u67e5\u8ba2\u5355\u8be6\u60c5&#xff0c;\u5c31\u5e94\u8be5\u8bfb\u4e3b\u5e93&#xff0c;\u6216\u8005\u5728\u5199\u540e\u4e00\u6bb5\u65f6\u95f4\u5185\u5f3a\u5236\u8bfb\u4e3b\u3002 \u5982\u679c\u662f\u666e\u901a\u5217\u8868\u67e5\u8be2&#xff0c;\u53ef\u4ee5\u63a5\u53d7\u77ed\u6682\u5ef6\u8fdf\u5c31\u8bfb\u4ece\u5e93\u3002 \u540c\u65f6\u8981\u76d1\u63a7\u4e3b\u4ece\u5ef6\u8fdf&#xff0c;\u5ef6\u8fdf\u8fc7\u9ad8\u65f6\u81ea\u52a8\u5207\u5230\u4e3b\u5e93\u6216\u505a\u964d\u7ea7\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5199\u540e\u7acb\u5373\u8bfb&#xff0c;\u4f18\u5148\u8bfb\u4e3b\u5e93<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>24. \u5206\u5e93\u5206\u8868\u540e\u8de8\u5e93\u67e5\u8be2\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5206\u5e93\u5206\u8868\u540e&#xff0c;\u7528\u6237\u8981\u6309\u975e\u5206\u7247\u5b57\u6bb5\u67e5\u8be2\u6570\u636e&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5206\u5e93\u5206\u8868\u540e\u6700\u6015\u8de8\u5e93\u805a\u5408\u548c\u975e\u5206\u7247\u952e\u67e5\u8be2\u3002 \u8bbe\u8ba1\u65f6\u8981\u5c3d\u91cf\u8ba9\u6838\u5fc3\u67e5\u8be2\u90fd\u5e26\u5206\u7247\u952e\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u67e5\u8be2\u6761\u4ef6\u5c3d\u91cf\u5e26\u5206\u7247\u952e<\/p>\n<\/li>\n<li>\n<p>\u5efa\u7acb\u5197\u4f59\u7d22\u5f15\u8868\u6216\u6620\u5c04\u8868<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u641c\u7d22\u5f15\u64ce\u627f\u63a5\u590d\u6742\u67e5\u8be2<\/p>\n<\/li>\n<li>\n<p>\u5bbd\u8868\u6216\u6570\u636e\u540c\u6b65\u5230\u67e5\u8be2\u5e93<\/p>\n<\/li>\n<li>\n<p>\u540e\u53f0\u62a5\u8868\u8d70\u79bb\u7ebf\u6570\u4ed3<\/p>\n<\/li>\n<li>\n<p>\u8de8\u5e93\u67e5\u8be2\u505a\u5206\u9875\u548c\u7ed3\u679c\u5408\u5e76&#xff0c;\u4f46\u63a7\u5236\u4f7f\u7528\u573a\u666f<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5206\u5e93\u5206\u8868\u540e&#xff0c;\u6211\u4f1a\u5c3d\u91cf\u907f\u514d\u5728\u7ebf\u63a5\u53e3\u505a\u5168\u5e93\u626b\u63cf\u3002 \u5982\u679c\u5fc5\u987b\u6309\u975e\u5206\u7247\u5b57\u6bb5\u67e5\u8be2&#xff0c;\u53ef\u4ee5\u5efa\u7acb\u6620\u5c04\u8868&#xff0c;\u6bd4\u5982\u624b\u673a\u53f7\u5230\u7528\u6237 ID&#xff0c;\u518d\u6839\u636e\u7528\u6237 ID \u8def\u7531\u5230\u5177\u4f53\u5206\u7247\u3002 \u590d\u6742\u6761\u4ef6\u67e5\u8be2\u53ef\u4ee5\u540c\u6b65\u5230 ES \u6216\u67e5\u8be2\u5e93&#xff0c;\u62a5\u8868\u7c7b\u9700\u6c42\u8d70\u79bb\u7ebf\u6570\u4ed3\u3002 \u8de8\u5e93\u805a\u5408\u53ef\u4ee5\u505a&#xff0c;\u4f46\u8981\u9650\u5236\u573a\u666f\u548c\u6570\u636e\u91cf&#xff0c;\u4e0d\u80fd\u6210\u4e3a\u6838\u5fc3\u9ad8\u9891\u94fe\u8def\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6838\u5fc3\u94fe\u8def\u5e26\u5206\u7247\u952e&#xff0c;\u975e\u5206\u7247\u67e5\u8be2\u9760\u6620\u5c04\u8868\u6216\u67e5\u8be2\u5e93<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>25. \u8868\u6570\u636e\u91cf\u8fc7\u5927&#xff0c;\u67e5\u8be2\u548c\u5199\u5165\u90fd\u53d8\u6162\u600e\u4e48\u6cbb\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5355\u8868\u51e0\u5343\u4e07\u751a\u81f3\u4e0a\u4ebf\u6570\u636e&#xff0c;\u67e5\u8be2\u548c\u5199\u5165\u53d8\u6162&#xff0c;\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5148\u533a\u5206\u662f\u7d22\u5f15\u95ee\u9898\u3001\u51b7\u70ed\u6570\u636e\u95ee\u9898&#xff0c;\u8fd8\u662f\u5355\u8868\u5bb9\u91cf\u5df2\u7ecf\u5230\u74f6\u9888\u3002 \u4e0d\u8981\u4e00\u4e0a\u6765\u5c31\u5206\u5e93\u5206\u8868&#xff0c;\u5148\u505a\u4f4e\u6210\u672c\u6cbb\u7406\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4f18\u5316\u7d22\u5f15\u548c SQL<\/p>\n<\/li>\n<li>\n<p>\u6e05\u7406\u65e0\u7528\u7d22\u5f15&#xff0c;\u964d\u4f4e\u5199\u5165\u6210\u672c<\/p>\n<\/li>\n<li>\n<p>\u51b7\u70ed\u6570\u636e\u5206\u79bb&#xff0c;\u5386\u53f2\u6570\u636e\u5f52\u6863<\/p>\n<\/li>\n<li>\n<p>\u6309\u65f6\u95f4\u6216\u4e1a\u52a1\u7ef4\u5ea6\u5206\u8868<\/p>\n<\/li>\n<li>\n<p>\u9ad8\u9891\u67e5\u8be2\u5efa\u7acb\u67e5\u8be2\u5bbd\u8868<\/p>\n<\/li>\n<li>\n<p>\u6700\u540e\u518d\u8003\u8651\u5206\u5e93\u5206\u8868<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u6162 SQL \u548c\u6267\u884c\u8ba1\u5212&#xff0c;\u786e\u8ba4\u662f\u4e0d\u662f\u7d22\u5f15\u4e0d\u5408\u7406\u3002 \u5982\u679c\u8868\u91cc\u5927\u91cf\u5386\u53f2\u6570\u636e\u5f88\u5c11\u8bbf\u95ee&#xff0c;\u53ef\u4ee5\u5148\u505a\u51b7\u70ed\u5206\u79bb\u548c\u5f52\u6863&#xff0c;\u51cf\u5c0f\u5728\u7ebf\u8868\u89c4\u6a21\u3002 \u5982\u679c\u5199\u5165\u6162&#xff0c;\u8fd8\u8981\u68c0\u67e5\u662f\u5426\u6709\u592a\u591a\u4e8c\u7ea7\u7d22\u5f15\u5f71\u54cd\u5199\u5165\u3002 \u5f53\u5355\u8868\u786e\u5b9e\u6210\u4e3a\u74f6\u9888\u65f6&#xff0c;\u518d\u6309\u4e1a\u52a1\u7ef4\u5ea6\u505a\u5206\u8868\u6216\u5206\u5e93\u5206\u8868&#xff0c;\u5e76\u63d0\u524d\u8bbe\u8ba1\u5206\u7247\u952e\u548c\u8fc1\u79fb\u65b9\u6848\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5148\u4f18\u5316\u548c\u5f52\u6863&#xff0c;\u6700\u540e\u624d\u5206\u5e93\u5206\u8868<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>26. \u5927\u4e8b\u52a1\u5bfc\u81f4\u6570\u636e\u5e93\u6296\u52a8\u600e\u4e48\u6392\u67e5\u548c\u4f18\u5316&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u67d0\u4e2a\u63a5\u53e3\u4e8b\u52a1\u6267\u884c\u5f88\u4e45&#xff0c;\u5bfc\u81f4\u6570\u636e\u5e93\u6296\u52a8&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5927\u4e8b\u52a1\u4f1a\u957f\u65f6\u95f4\u6301\u9501\u3001\u5360\u7528\u8fde\u63a5&#xff0c;\u8fd8\u4f1a\u5f71\u54cd\u4e3b\u4ece\u590d\u5236\u548c\u56de\u6eda\u6210\u672c\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u4e8b\u52a1\u4e2d\u6279\u91cf\u66f4\u65b0\u5927\u91cf\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u4e2d\u8c03\u7528\u8fdc\u7a0b\u63a5\u53e3<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u4e2d\u505a\u590d\u6742\u8ba1\u7b97<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u8303\u56f4\u8fc7\u5927<\/p>\n<\/li>\n<li>\n<p>\u672a\u547d\u4e2d\u7d22\u5f15\u5bfc\u81f4\u9501\u8303\u56f4\u6269\u5927<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u4e8b\u52a1\u6267\u884c\u65f6\u95f4\u3001\u9501\u7b49\u5f85\u548c\u8fde\u63a5\u5360\u7528\u60c5\u51b5\u3002 \u5982\u679c\u4e8b\u52a1\u91cc\u6709\u8fdc\u7a0b\u8c03\u7528\u6216\u5927\u91cf\u5faa\u73af\u5904\u7406&#xff0c;\u4f1a\u628a\u8fd9\u4e9b\u903b\u8f91\u79fb\u5230\u4e8b\u52a1\u5916\u3002 \u6279\u91cf\u6570\u636e\u5904\u7406\u4f1a\u62c6\u6210\u5c0f\u6279\u6b21\u63d0\u4ea4&#xff0c;\u964d\u4f4e\u9501\u6301\u6709\u65f6\u95f4\u548c\u56de\u6eda\u6210\u672c\u3002 \u540c\u65f6\u68c0\u67e5\u66f4\u65b0\u6761\u4ef6\u662f\u5426\u547d\u4e2d\u7d22\u5f15&#xff0c;\u907f\u514d\u9501\u8303\u56f4\u88ab\u653e\u5927\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u4e8b\u52a1\u53ea\u5305\u6570\u636e\u5e93\u6838\u5fc3\u64cd\u4f5c&#xff0c;\u8d8a\u77ed\u8d8a\u597d<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>27. \u6570\u636e\u5e93 CPU \u98d9\u9ad8\u4f46\u6162 SQL \u4e0d\u660e\u663e\u600e\u4e48\u5206\u6790&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>MySQL CPU \u5f88\u9ad8&#xff0c;\u4f46\u6162\u67e5\u8be2\u65e5\u5fd7\u91cc\u6ca1\u6709\u660e\u663e\u6162 SQL&#xff0c;\u600e\u4e48\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6ca1\u6709\u6162 SQL \u4e0d\u4ee3\u8868\u6ca1\u6709\u95ee\u9898&#xff0c;\u53ef\u80fd\u662f\u5927\u91cf\u77ed SQL \u9ad8\u9891\u6267\u884c&#xff0c;\u628a CPU \u6253\u6ee1\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u9ad8\u9891\u7b80\u5355\u67e5\u8be2\u6ca1\u6709\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>SQL \u6267\u884c\u5f88\u5feb\u4f46\u8c03\u7528\u6b21\u6570\u8fc7\u591a<\/p>\n<\/li>\n<li>\n<p>\u5927\u91cf\u6392\u5e8f\u3001\u51fd\u6570\u8ba1\u7b97\u6216\u9690\u5f0f\u8f6c\u6362<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u98ce\u66b4<\/p>\n<\/li>\n<li>\n<p>\u6267\u884c\u8ba1\u5212\u7a81\u53d8<\/p>\n<\/li>\n<li>\n<p>\u6162\u67e5\u8be2\u9608\u503c\u8bbe\u7f6e\u8fc7\u9ad8<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u6570\u636e\u5e93 QPS\u3001TPS\u3001\u6d3b\u8dc3\u8fde\u63a5\u548c CPU \u4f7f\u7528\u60c5\u51b5\u3002 \u5982\u679c\u6162 SQL \u4e0d\u660e\u663e&#xff0c;\u53ef\u80fd\u662f\u5927\u91cf\u77ed SQL \u9ad8\u9891\u6267\u884c\u5bfc\u81f4 CPU \u9ad8&#xff0c;\u8fd9\u65f6\u8981\u770b SQL \u7edf\u8ba1\u548c TOP SQL\u3002 \u4e5f\u4f1a\u68c0\u67e5\u6162\u67e5\u8be2\u9608\u503c\u662f\u4e0d\u662f\u8fc7\u9ad8&#xff0c;\u4ee5\u53ca\u6267\u884c\u8ba1\u5212\u662f\u5426\u53d1\u751f\u53d8\u5316\u3002 \u89e3\u51b3\u4e0a\u53ef\u4ee5\u589e\u52a0\u7f13\u5b58\u3001\u5408\u5e76\u67e5\u8be2\u3001\u51cf\u5c11\u8f6e\u8be2\u3001\u4f18\u5316\u7d22\u5f15&#xff0c;\u5e76\u9650\u5236\u5f02\u5e38\u6d41\u91cf\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6ca1\u6709\u6162 SQL&#xff0c;\u4e5f\u53ef\u80fd\u662f\u77ed SQL \u592a\u591a<\/p>\n<hr \/>\n<hr \/>\n<h2>\u56db\u3001Redis \u4e0e\u7f13\u5b58\u95ee\u9898\u7c7b<\/h2>\n<h3>28. Redis \u53d8\u6162\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>Redis \u5e73\u65f6\u5f88\u5feb&#xff0c;\u7a81\u7136\u8bbf\u95ee\u53d8\u6162&#xff0c;\u4f60\u4f1a\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>Redis \u6162\u8981\u4ece\u6162\u547d\u4ee4\u3001\u5927 key\u3001\u70ed\u70b9 key\u3001\u7f51\u7edc\u3001\u5185\u5b58\u3001\u6301\u4e45\u5316\u51e0\u4e2a\u65b9\u5411\u770b\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b Redis \u76d1\u63a7<\/p>\n<ul>\n<li>\n<p>QPS<\/p>\n<\/li>\n<li>\n<p>CPU<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u6570<\/p>\n<\/li>\n<li>\n<p>\u547d\u4e2d\u7387<\/p>\n<\/li>\n<li>\n<p>\u7f51\u7edc\u6d41\u91cf<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u67e5\u770b\u6162\u547d\u4ee4<\/p>\n<\/li>\n<p>slowlog get<\/p>\n<li>\n<p>\u6392\u67e5\u5927 key<\/p>\n<\/li>\n<p>redis-cli &#8211;bigkeys<\/p>\n<li>\n<p>\u6392\u67e5\u70ed\u70b9 key<\/p>\n<ul>\n<li>\n<p>\u770b\u4e1a\u52a1\u8bbf\u95ee\u65e5\u5fd7<\/p>\n<\/li>\n<li>\n<p>\u770b Redis \u4ee3\u7406\u5c42\u7edf\u8ba1<\/p>\n<\/li>\n<li>\n<p>\u770b key \u7684\u8bbf\u95ee\u5206\u5e03<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u4f7f\u7528\u4e86 keys\u3001\u5927\u8303\u56f4 hgetall\u3001smembers \u7b49\u6162\u547d\u4ee4<\/p>\n<\/li>\n<li>\n<p>\u5927 key \u8bfb\u5199\u5bfc\u81f4\u7f51\u7edc\u548c CPU \u538b\u529b\u53d8\u5927<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9 key \u88ab\u5927\u91cf\u8bf7\u6c42\u96c6\u4e2d\u8bbf\u95ee<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58\u6253\u6ee1\u89e6\u53d1\u6dd8\u6c70<\/p>\n<\/li>\n<li>\n<p>RDB \u6216 AOF rewrite \u5e26\u6765\u963b\u585e<\/p>\n<\/li>\n<li>\n<p>\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u8fc7\u591a<\/p>\n<\/li>\n<li>\n<p>\u7f51\u7edc\u6296\u52a8<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u7981\u6b62\u7ebf\u4e0a\u4f7f\u7528 keys&#xff0c;\u6539\u7528 scan<\/p>\n<\/li>\n<li>\n<p>\u5927 key \u62c6\u5206&#xff0c;\u907f\u514d\u4e00\u6b21\u8fd4\u56de\u5927\u91cf\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9 key \u52a0\u672c\u5730\u7f13\u5b58\u6216\u591a\u526f\u672c<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u5408\u7406\u8fc7\u671f\u65f6\u95f4\u548c\u5185\u5b58\u6dd8\u6c70\u7b56\u7565<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5316\u6301\u4e45\u5316\u7b56\u7565<\/p>\n<\/li>\n<li>\n<p>\u52a0\u8fde\u63a5\u6c60\u76d1\u63a7<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b Redis \u7684 CPU\u3001\u5185\u5b58\u3001\u8fde\u63a5\u6570\u3001\u7f51\u7edc\u548c\u6162\u547d\u4ee4\u3002 \u5982\u679c\u6162\u547d\u4ee4\u91cc\u6709 keys\u3001hgetall\u3001smembers \u8fd9\u7c7b\u547d\u4ee4&#xff0c;\u5c31\u5148\u6539\u547d\u4ee4\u4f7f\u7528\u65b9\u5f0f\u3002 \u5982\u679c\u662f\u5927 key&#xff0c;\u5c31\u62c6 key \u6216\u5206\u9875\u8bfb\u53d6&#xff1b;\u5982\u679c\u662f\u70ed\u70b9 key&#xff0c;\u5c31\u7528\u672c\u5730\u7f13\u5b58\u3001\u591a\u526f\u672c\u6216\u70ed\u70b9\u9694\u79bb\u3002 \u540c\u65f6\u8fd8\u8981\u770b\u662f\u5426\u5185\u5b58\u6253\u6ee1\u3001\u6301\u4e45\u5316\u963b\u585e\u6216\u8005\u7f51\u7edc\u6296\u52a8\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6162\u547d\u4ee4 -&gt; \u5927 key -&gt; \u70ed\u70b9 key -&gt; \u5185\u5b58\u548c\u7f51\u7edc<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>29. \u7f13\u5b58\u7a7f\u900f\u3001\u51fb\u7a7f\u3001\u96ea\u5d29\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5982\u679c\u5927\u91cf\u8bf7\u6c42\u6253\u5230\u6570\u636e\u5e93&#xff0c;Redis \u6ca1\u6709\u6321\u4f4f&#xff0c;\u4f60\u600e\u4e48\u5206\u6790&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5148\u5224\u65ad\u662f\u54ea\u4e00\u79cd\u7f13\u5b58\u95ee\u9898&#xff1a;<\/p>\n<li>\n<p>\u7a7f\u900f&#xff1a;\u67e5\u4e0d\u5b58\u5728\u7684\u6570\u636e&#xff0c;\u6bcf\u6b21\u90fd\u6253\u5230\u6570\u636e\u5e93<\/p>\n<\/li>\n<li>\n<p>\u51fb\u7a7f&#xff1a;\u70ed\u70b9 key \u5931\u6548&#xff0c;\u5927\u91cf\u8bf7\u6c42\u540c\u65f6\u67e5\u6570\u636e\u5e93<\/p>\n<\/li>\n<li>\n<p>\u96ea\u5d29&#xff1a;\u5927\u91cf key \u540c\u65f6\u5931\u6548&#xff0c;\u6570\u636e\u5e93\u538b\u529b\u66b4\u589e<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<h5>\u7f13\u5b58\u7a7f\u900f<\/h5>\n<p>\u5e38\u89c1\u539f\u56e0&#xff1a;\u8bf7\u6c42\u4e0d\u5b58\u5728\u7684 ID&#xff0c;\u7f13\u5b58\u548c\u6570\u636e\u5e93\u90fd\u6ca1\u6709\u3002 \u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\n<p>\u7f13\u5b58\u7a7a\u503c&#xff0c;\u8bbe\u7f6e\u8f83\u77ed\u8fc7\u671f\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u5e03\u9686\u8fc7\u6ee4\u5668\u63d0\u524d\u8fc7\u6ee4\u4e0d\u5b58\u5728\u7684\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u505a\u53c2\u6570\u6821\u9a8c&#xff0c;\u62e6\u622a\u975e\u6cd5 ID<\/p>\n<\/li>\n<h5>\u7f13\u5b58\u51fb\u7a7f<\/h5>\n<p>\u5e38\u89c1\u539f\u56e0&#xff1a;\u70ed\u70b9 key \u8fc7\u671f\u77ac\u95f4&#xff0c;\u5927\u91cf\u8bf7\u6c42\u540c\u65f6\u56de\u6e90\u3002 \u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\n<p>\u70ed\u70b9 key \u8bbe\u7f6e\u903b\u8f91\u8fc7\u671f<\/p>\n<\/li>\n<li>\n<p>\u52a0\u4e92\u65a5\u9501&#xff0c;\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u56de\u6e90\u91cd\u5efa\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9\u6570\u636e\u63d0\u524d\u9884\u70ed<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u70ed\u70b9 key \u4e0d\u8bbe\u7f6e\u7269\u7406\u8fc7\u671f&#xff0c;\u7531\u540e\u53f0\u5237\u65b0<\/p>\n<\/li>\n<h5>\u7f13\u5b58\u96ea\u5d29<\/h5>\n<p>\u5e38\u89c1\u539f\u56e0&#xff1a;\u5927\u91cf key \u540c\u4e00\u65f6\u95f4\u8fc7\u671f&#xff0c;\u6216\u8005 Redis \u6574\u4f53\u4e0d\u53ef\u7528\u3002 \u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\n<p>\u8fc7\u671f\u65f6\u95f4\u52a0\u968f\u673a\u503c<\/p>\n<\/li>\n<li>\n<p>\u591a\u7ea7\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>Redis \u9ad8\u53ef\u7528<\/p>\n<\/li>\n<li>\n<p>\u9650\u6d41\u3001\u964d\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u9884\u70ed<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u5224\u65ad\u662f\u7a7f\u900f\u3001\u51fb\u7a7f\u8fd8\u662f\u96ea\u5d29\u3002 \u5982\u679c\u662f\u67e5\u8be2\u4e0d\u5b58\u5728\u7684\u6570\u636e\u5bfc\u81f4\u7f13\u5b58\u7a7f\u900f&#xff0c;\u5c31\u7f13\u5b58\u7a7a\u503c\u6216\u8005\u7528\u5e03\u9686\u8fc7\u6ee4\u5668\u3002 \u5982\u679c\u662f\u70ed\u70b9 key \u5931\u6548\u5bfc\u81f4\u51fb\u7a7f&#xff0c;\u5c31\u7528\u4e92\u65a5\u9501\u6216\u903b\u8f91\u8fc7\u671f&#xff0c;\u4fdd\u8bc1\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u56de\u6e90\u3002 \u5982\u679c\u662f\u5927\u91cf key \u540c\u65f6\u8fc7\u671f\u5bfc\u81f4\u96ea\u5d29&#xff0c;\u5c31\u7ed9\u8fc7\u671f\u65f6\u95f4\u52a0\u968f\u673a\u503c&#xff0c;\u540c\u65f6\u505a\u597d\u9650\u6d41\u3001\u964d\u7ea7\u548c\u7f13\u5b58\u9884\u70ed\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u7a7f\u900f\u67e5\u4e0d\u5230 -&gt; \u51fb\u7a7f\u70ed\u70b9\u8fc7\u671f -&gt; \u96ea\u5d29\u5927\u91cf\u8fc7\u671f<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>30. Redis \u5185\u5b58\u7a81\u7136\u6253\u6ee1\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>Redis \u5185\u5b58\u7a81\u7136\u6da8\u6ee1&#xff0c;\u4e1a\u52a1\u5f00\u59cb\u62a5\u9519&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5148\u770b\u662f key \u6570\u91cf\u66b4\u589e&#xff0c;\u8fd8\u662f\u67d0\u4e9b\u5927 key \u66b4\u589e\u3002 \u518d\u770b\u662f\u5426\u6709\u8fc7\u671f\u7b56\u7565\u5931\u6548\u6216\u7f13\u5b58\u5199\u5165\u5f02\u5e38\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b Redis \u5185\u5b58\u3001key \u6570\u91cf\u548c\u6dd8\u6c70\u6b21\u6570<\/p>\n<\/li>\n<li>\n<p>\u7528 bigkeys \u67e5\u5927 key<\/p>\n<\/li>\n<li>\n<p>\u62bd\u6837\u5206\u6790 key \u524d\u7f00\u5206\u5e03<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u662f\u5426\u6709 key \u6ca1\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u662f\u5426\u6709\u5f02\u5e38\u7f13\u5b58\u5199\u5165<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b Redis \u7684 used_memory\u3001key \u6570\u91cf\u3001\u6dd8\u6c70\u6b21\u6570\u548c\u5185\u5b58\u788e\u7247\u7387\u3002 \u7136\u540e\u6309 key \u524d\u7f00\u7edf\u8ba1&#xff0c;\u770b\u662f\u54ea\u7c7b\u4e1a\u52a1 key \u66b4\u589e&#xff0c;\u518d\u7528 bigkeys \u627e\u5927 key\u3002 \u5982\u679c\u53d1\u73b0 key \u6ca1\u6709\u8fc7\u671f\u65f6\u95f4&#xff0c;\u5c31\u8865 TTL&#xff1b;\u5982\u679c\u662f\u5927 key&#xff0c;\u5c31\u62c6\u5206\u6216\u9650\u5236\u5199\u5165\u5927\u5c0f\u3002 \u77ed\u671f\u53ef\u4ee5\u6269\u5bb9\u6216\u6e05\u7406\u5f02\u5e38 key&#xff0c;\u957f\u671f\u8981\u52a0 key \u89c4\u8303\u3001TTL \u68c0\u67e5\u548c\u5bb9\u91cf\u544a\u8b66\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5185\u5b58\u6253\u6ee1\u770b key \u6570\u91cf\u3001\u5927 key\u3001TTL<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>31. Redis \u70ed\u70b9 key \u5bfc\u81f4\u5355\u8282\u70b9\u538b\u529b\u8fc7\u9ad8\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u67d0\u4e2a\u70ed\u70b9 key \u88ab\u5927\u91cf\u8bbf\u95ee&#xff0c;Redis \u5355\u8282\u70b9 CPU \u5f88\u9ad8&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u70ed\u70b9 key \u7684\u95ee\u9898\u662f\u8bf7\u6c42\u96c6\u4e2d\u5230\u4e00\u4e2a key\u3001\u4e00\u4e2a\u5206\u7247&#xff0c;\u666e\u901a\u96c6\u7fa4\u5206\u7247\u4e5f\u5206\u6563\u4e0d\u4e86\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u672c\u5730\u7f13\u5b58\u70ed\u70b9\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9 key \u62c6\u6210\u591a\u4e2a\u526f\u672c key<\/p>\n<\/li>\n<li>\n<p>\u8bf7\u6c42\u968f\u673a\u8bfb\u4e0d\u540c\u526f\u672c<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u70ed\u70b9\u63a5\u53e3\u9650\u6d41<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9\u6570\u636e\u63d0\u524d\u9884\u70ed<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u70ed\u70b9\u6570\u636e\u53ef\u4ee5\u653e CDN \u6216\u8fb9\u7f18\u7f13\u5b58<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u786e\u8ba4\u662f\u4e0d\u662f\u67d0\u4e2a key \u7684\u8bbf\u95ee\u91cf\u8fdc\u9ad8\u4e8e\u5176\u4ed6 key\u3002 \u5982\u679c\u662f\u70ed\u70b9 key&#xff0c;\u5355\u7eaf Redis \u96c6\u7fa4\u4e0d\u4e00\u5b9a\u80fd\u89e3\u51b3&#xff0c;\u56e0\u4e3a\u540c\u4e00\u4e2a key \u8fd8\u662f\u843d\u5728\u4e00\u4e2a\u5206\u7247\u3002 \u53ef\u4ee5\u7528\u672c\u5730\u7f13\u5b58\u51cf\u5c11 Redis \u8bbf\u95ee&#xff0c;\u6216\u8005\u628a\u70ed\u70b9 key \u505a\u591a\u526f\u672c&#xff0c;\u8bfb\u53d6\u65f6\u968f\u673a\u6253\u6563\u3002 \u540c\u65f6\u8981\u5bf9\u70ed\u70b9\u63a5\u53e3\u505a\u9650\u6d41\u548c\u9884\u70ed&#xff0c;\u907f\u514d\u77ac\u65f6\u6d41\u91cf\u628a Redis \u6253\u6ee1\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u70ed\u70b9 key \u8981\u6253\u6563\u8bfb\u6d41\u91cf<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>32. Redis \u7f13\u5b58\u548c\u6570\u636e\u5e93\u6570\u636e\u4e0d\u4e00\u81f4\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u66f4\u65b0\u6570\u636e\u5e93\u540e\u7f13\u5b58\u6ca1\u66f4\u65b0&#xff0c;\u5bfc\u81f4\u7528\u6237\u8bfb\u5230\u65e7\u6570\u636e&#xff0c;\u600e\u4e48\u8bbe\u8ba1&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5e38\u7528\u7b56\u7565\u662f\u5148\u66f4\u65b0\u6570\u636e\u5e93&#xff0c;\u518d\u5220\u9664\u7f13\u5b58\u3002 \u590d\u6742\u573a\u666f\u8981\u7ed3\u5408\u5ef6\u8fdf\u53cc\u5220\u3001\u6d88\u606f\u8865\u507f\u548c\u8fc7\u671f\u65f6\u95f4\u515c\u5e95\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u5148\u66f4\u65b0\u6570\u636e\u5e93&#xff0c;\u518d\u5220\u9664\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u5931\u8d25\u5199\u5165\u91cd\u8bd5\u961f\u5217<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u8bbe\u7f6e\u5408\u7406 TTL<\/p>\n<\/li>\n<li>\n<p>\u9ad8\u5e76\u53d1\u4e0b\u4f7f\u7528\u5ef6\u8fdf\u53cc\u5220\u964d\u4f4e\u810f\u6570\u636e\u6982\u7387<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7 Canal \u6216 MQ \u8ba2\u9605\u53d8\u66f4\u5220\u9664\u7f13\u5b58<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4e00\u822c\u4e0d\u4f1a\u540c\u65f6\u66f4\u65b0\u6570\u636e\u5e93\u548c\u7f13\u5b58&#xff0c;\u800c\u662f\u66f4\u65b0\u6570\u636e\u5e93\u6210\u529f\u540e\u5220\u9664\u7f13\u5b58&#xff0c;\u8ba9\u540e\u7eed\u8bf7\u6c42\u91cd\u65b0\u52a0\u8f7d\u3002 \u5982\u679c\u5220\u9664\u7f13\u5b58\u5931\u8d25&#xff0c;\u8981\u6709\u91cd\u8bd5\u6216\u6d88\u606f\u8865\u507f&#xff0c;\u7f13\u5b58\u672c\u8eab\u4e5f\u8981\u8bbe\u7f6e TTL \u515c\u5e95\u3002 \u5bf9\u4e8e\u5e76\u53d1\u8bfb\u5199\u5bfc\u81f4\u7684\u77ed\u6682\u4e0d\u4e00\u81f4&#xff0c;\u53ef\u4ee5\u6839\u636e\u4e1a\u52a1\u63a5\u53d7\u7a0b\u5ea6\u4f7f\u7528\u5ef6\u8fdf\u53cc\u5220\u3002 \u5982\u679c\u4e00\u81f4\u6027\u8981\u6c42\u66f4\u9ad8&#xff0c;\u53ef\u4ee5\u901a\u8fc7 binlog \u8ba2\u9605\u6765\u5f02\u6b65\u5220\u9664\u7f13\u5b58\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u66f4\u65b0\u6570\u636e\u5e93\u540e\u5220\u7f13\u5b58&#xff0c;\u5931\u8d25\u8981\u8865\u507f&#xff0c;TTL \u515c\u5e95<\/p>\n<hr \/>\n<hr \/>\n<h2>\u4e94\u3001MQ \u6d88\u606f\u961f\u5217\u95ee\u9898\u7c7b<\/h2>\n<h3>33. MQ \u6d88\u606f\u79ef\u538b\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a MQ \u6d88\u606f\u7a81\u7136\u79ef\u538b\u51e0\u5341\u4e07&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>MQ \u79ef\u538b\u672c\u8d28\u662f\u751f\u4ea7\u901f\u5ea6\u5927\u4e8e\u6d88\u8d39\u901f\u5ea6\u3002 \u5148\u770b\u662f\u751f\u4ea7\u7a81\u589e&#xff0c;\u8fd8\u662f\u6d88\u8d39\u53d8\u6162&#xff0c;\u518d\u770b\u6d88\u8d39\u8005\u5361\u5728\u54ea\u91cc\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b MQ \u6307\u6807<\/p>\n<ul>\n<li>\n<p>\u751f\u4ea7 TPS<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39 TPS<\/p>\n<\/li>\n<li>\n<p>\u6d88\u606f\u5806\u79ef\u91cf<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u5ef6\u8fdf<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u8005\u5b9e\u4f8b\u6570<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u6d88\u8d39\u8005\u65e5\u5fd7<\/p>\n<ul>\n<li>\n<p>\u662f\u5426\u6709\u5927\u91cf\u5f02\u5e38\u91cd\u8bd5<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6d88\u8d39\u5931\u8d25<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u5361\u5728\u6570\u636e\u5e93\u6216\u4e0b\u6e38\u63a5\u53e3<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u770b\u6d88\u8d39\u903b\u8f91<\/p>\n<ul>\n<li>\n<p>\u662f\u5426\u5355\u7ebf\u7a0b\u6d88\u8d39<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6279\u91cf\u6d88\u8d39\u592a\u5c0f<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6bcf\u6761\u6d88\u606f\u90fd\u505a\u8fdc\u7a0b\u8c03\u7528<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u6709\u5e42\u7b49\u63a7\u5236<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u7a81\u53d1\u6d41\u91cf\u5bfc\u81f4\u751f\u4ea7\u901f\u5ea6\u66b4\u6da8<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u8005\u5b9e\u4f8b\u6570\u4e0d\u8db3<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u903b\u8f91\u53d8\u6162<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u63a5\u53e3\u6216\u6570\u636e\u5e93\u53d8\u6162<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u5931\u8d25\u540e\u4e0d\u65ad\u91cd\u8bd5<\/p>\n<\/li>\n<li>\n<p>\u5206\u533a\u6216\u961f\u5217\u6570\u91cf\u9650\u5236\u4e86\u5e76\u884c\u5ea6<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4e34\u65f6\u6269\u5bb9\u6d88\u8d39\u8005\u5b9e\u4f8b<\/p>\n<\/li>\n<li>\n<p>\u63d0\u9ad8\u6d88\u8d39\u7ebf\u7a0b\u6570\u6216\u6279\u91cf\u6d88\u8d39\u6570\u91cf<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u975e\u6838\u5fc3\u903b\u8f91\u964d\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5316\u6570\u636e\u5e93\u548c\u4e0b\u6e38\u8c03\u7528<\/p>\n<\/li>\n<li>\n<p>\u505a\u597d\u6d88\u8d39\u5e42\u7b49&#xff0c;\u907f\u514d\u91cd\u590d\u6d88\u8d39\u9020\u6210\u6570\u636e\u95ee\u9898<\/p>\n<\/li>\n<li>\n<p>\u5fc5\u8981\u65f6\u589e\u52a0 topic \u5206\u533a\u6216\u961f\u5217\u6570\u91cf<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u751f\u4ea7 TPS \u548c\u6d88\u8d39 TPS&#xff0c;\u786e\u8ba4\u662f\u751f\u4ea7\u7a81\u589e\u8fd8\u662f\u6d88\u8d39\u53d8\u6162\u3002 \u5982\u679c\u6d88\u8d39\u53d8\u6162&#xff0c;\u5c31\u770b\u6d88\u8d39\u8005\u65e5\u5fd7\u548c\u7ebf\u7a0b\u6808&#xff0c;\u5224\u65ad\u662f\u5361\u5728\u6570\u636e\u5e93\u3001\u4e0b\u6e38\u63a5\u53e3&#xff0c;\u8fd8\u662f\u6d88\u8d39\u903b\u8f91\u672c\u8eab\u592a\u91cd\u3002 \u77ed\u671f\u53ef\u4ee5\u6269\u5bb9\u6d88\u8d39\u8005\u3001\u63d0\u9ad8\u5e76\u53d1\u3001\u4e34\u65f6\u964d\u7ea7\u975e\u6838\u5fc3\u903b\u8f91&#xff0c;\u5148\u628a\u79ef\u538b\u964d\u4e0b\u6765\u3002 \u957f\u671f\u8981\u4f18\u5316\u6d88\u8d39\u903b\u8f91\u3001\u589e\u52a0\u5e42\u7b49\u63a7\u5236\u3001\u8c03\u6574\u5206\u533a\u6570\u91cf&#xff0c;\u5e76\u8865\u5145\u6d88\u8d39\u5ef6\u8fdf\u544a\u8b66\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u751f\u4ea7\u5feb\u8fd8\u662f\u6d88\u8d39\u6162 -&gt; \u6d88\u8d39\u8005\u5361\u54ea -&gt; \u6269\u5bb9\u5e76\u53d1\u5148\u6d88\u5cf0<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>34. \u6d88\u606f\u91cd\u590d\u6d88\u8d39\u600e\u4e48\u4fdd\u8bc1\u5e42\u7b49&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>MQ \u6d88\u606f\u53ef\u80fd\u91cd\u590d\u6295\u9012&#xff0c;\u6d88\u8d39\u8005\u600e\u4e48\u4fdd\u8bc1\u4e0d\u91cd\u590d\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>MQ \u901a\u5e38\u53ea\u80fd\u4fdd\u8bc1\u81f3\u5c11\u4e00\u6b21\u6295\u9012&#xff0c;\u6240\u4ee5\u6d88\u8d39\u8005\u5fc5\u987b\u5e42\u7b49\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u4f7f\u7528\u4e1a\u52a1\u552f\u4e00 ID \u53bb\u91cd<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u552f\u4e00\u7d22\u5f15\u9632\u91cd\u590d\u63d2\u5165<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u8bb0\u5f55\u8868\u8bb0\u5f55\u5904\u7406\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>Redis SET NX \u505a\u77ed\u671f\u53bb\u91cd<\/p>\n<\/li>\n<li>\n<p>\u72b6\u6001\u673a\u63a7\u5236\u91cd\u590d\u72b6\u6001\u6d41\u8f6c<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u9ed8\u8ba4 MQ \u53ef\u80fd\u91cd\u590d\u6295\u9012&#xff0c;\u6240\u4ee5\u6d88\u8d39\u8005\u4e00\u5b9a\u8981\u505a\u5e42\u7b49\u3002 \u5e38\u89c1\u505a\u6cd5\u662f\u7528\u6d88\u606f\u91cc\u7684\u4e1a\u52a1\u552f\u4e00 ID \u5efa\u6d88\u8d39\u8bb0\u5f55&#xff0c;\u5904\u7406\u524d\u5148\u5224\u65ad\u662f\u5426\u5df2\u7ecf\u5904\u7406\u8fc7\u3002 \u6d89\u53ca\u6570\u636e\u5e93\u5199\u5165\u65f6&#xff0c;\u7528\u552f\u4e00\u7d22\u5f15\u515c\u5e95&#xff1b;\u6d89\u53ca\u72b6\u6001\u53d8\u66f4\u65f6&#xff0c;\u7528\u72b6\u6001\u673a\u9650\u5236\u53ea\u80fd\u4ece\u5408\u6cd5\u72b6\u6001\u53d8\u66f4\u3002 \u8fd9\u6837\u5373\u4f7f\u6d88\u606f\u91cd\u590d\u6d88\u8d39&#xff0c;\u4e5f\u4e0d\u4f1a\u9020\u6210\u91cd\u590d\u6263\u6b3e\u3001\u91cd\u590d\u53d1\u8d27\u6216\u91cd\u590d\u901a\u77e5\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>MQ \u9632\u4e0d\u4f4f\u91cd\u590d&#xff0c;\u6d88\u8d39\u8005\u5fc5\u987b\u5e42\u7b49<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>35. \u6d88\u606f\u4e22\u5931\u600e\u4e48\u6392\u67e5&#xff1f;\u600e\u4e48\u4fdd\u8bc1\u53ef\u9760\u6295\u9012&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u4e1a\u52a1\u65b9\u8bf4\u6d88\u606f\u4e22\u4e86&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;\u600e\u4e48\u9632\u6b62&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u6d88\u606f\u4e22\u5931\u8981\u5206\u4e09\u6bb5\u770b&#xff1a;\u751f\u4ea7\u7aef\u3001Broker\u3001\u6d88\u8d39\u7aef\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u751f\u4ea7\u7aef\u662f\u5426\u53d1\u9001\u6210\u529f<\/p>\n<\/li>\n<li>\n<p>Broker \u662f\u5426\u6301\u4e45\u5316\u6210\u529f<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u7aef\u662f\u5426\u62c9\u53d6\u5230\u6d88\u606f<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u6210\u529f\u524d\u662f\u5426\u63d0\u524d ack<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u8fdb\u5165\u6b7b\u4fe1\u961f\u5217<\/p>\n<\/li>\n<li>\n<p>\u662f\u5426\u88ab\u8fc7\u6ee4\u6761\u4ef6\u8fc7\u6ee4<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u6309\u751f\u4ea7\u7aef\u3001Broker\u3001\u6d88\u8d39\u7aef\u4e09\u6bb5\u6392\u67e5\u3002 \u751f\u4ea7\u7aef\u8981\u786e\u8ba4\u53d1\u9001\u7ed3\u679c&#xff0c;\u5931\u8d25\u8981\u91cd\u8bd5\u6216\u843d\u672c\u5730\u6d88\u606f\u8868&#xff1b;Broker \u4fa7\u8981\u770b\u6d88\u606f\u662f\u5426\u6301\u4e45\u5316\u3001\u662f\u5426\u8fdb\u5165\u6b7b\u4fe1\u961f\u5217&#xff1b;\u6d88\u8d39\u7aef\u8981\u770b\u662f\u5426\u63d0\u524d ack \u6216\u6d88\u8d39\u5f02\u5e38\u3002 \u4e3a\u4e86\u53ef\u9760\u6295\u9012&#xff0c;\u6838\u5fc3\u6d88\u606f\u4f1a\u4f7f\u7528\u672c\u5730\u6d88\u606f\u8868\u6216\u4e8b\u52a1\u6d88\u606f&#xff0c;\u6d88\u8d39\u8005\u5904\u7406\u6210\u529f\u540e\u518d\u786e\u8ba4&#xff0c;\u5e76\u901a\u8fc7\u8865\u507f\u4efb\u52a1\u626b\u63cf\u672a\u5b8c\u6210\u6d88\u606f\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6d88\u606f\u53ef\u9760\u6027\u5206\u751f\u4ea7\u3001Broker\u3001\u6d88\u8d39\u4e09\u6bb5<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>36. \u6d88\u606f\u987a\u5e8f\u6d88\u8d39\u600e\u4e48\u4fdd\u8bc1&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u8ba2\u5355\u72b6\u6001\u6d88\u606f\u5fc5\u987b\u6309\u987a\u5e8f\u6d88\u8d39&#xff0c;\u600e\u4e48\u4fdd\u8bc1&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u987a\u5e8f\u6d88\u8d39\u7684\u6838\u5fc3\u662f\u540c\u4e00\u4e1a\u52a1 ID \u7684\u6d88\u606f\u8fdb\u5165\u540c\u4e00\u4e2a\u961f\u5217&#xff0c;\u5e76\u7531\u540c\u4e00\u4e2a\u6d88\u8d39\u8005\u4e32\u884c\u5904\u7406\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u751f\u4ea7\u7aef\u6309\u8ba2\u5355 ID \u9009\u62e9\u540c\u4e00\u4e2a\u961f\u5217\u6216\u5206\u533a<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u7aef\u5355\u961f\u5217\u4e32\u884c\u6d88\u8d39<\/p>\n<\/li>\n<li>\n<p>\u4e1a\u52a1\u72b6\u6001\u673a\u9632\u6b62\u4e71\u5e8f\u66f4\u65b0<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u5931\u8d25\u65f6\u4e0d\u80fd\u8df3\u8fc7\u5173\u952e\u6d88\u606f<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e71\u5e8f\u6d88\u606f\u53ef\u4ee5\u6682\u5b58\u6216\u91cd\u8bd5<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5982\u679c\u8981\u4fdd\u8bc1\u8ba2\u5355\u72b6\u6001\u987a\u5e8f&#xff0c;\u6211\u4f1a\u8ba9\u540c\u4e00\u4e2a\u8ba2\u5355 ID \u7684\u6d88\u606f\u8def\u7531\u5230\u540c\u4e00\u4e2a\u961f\u5217\u6216\u5206\u533a\u3002 \u6d88\u8d39\u7aef\u5bf9\u540c\u4e00\u4e2a\u961f\u5217\u4e32\u884c\u6d88\u8d39&#xff0c;\u8fd9\u6837\u5929\u7136\u6709\u5e8f\u3002 \u4f46\u53ea\u9760 MQ \u987a\u5e8f\u8fd8\u4e0d\u591f&#xff0c;\u4e1a\u52a1\u5c42\u8fd8\u8981\u7528\u72b6\u6001\u673a\u6821\u9a8c&#xff0c;\u6bd4\u5982\u8ba2\u5355\u4e0d\u80fd\u4ece\u5df2\u53d6\u6d88\u53d8\u6210\u5df2\u652f\u4ed8\u3002 \u5982\u679c\u51fa\u73b0\u4e71\u5e8f\u6d88\u606f&#xff0c;\u5c31\u6682\u5b58\u3001\u91cd\u8bd5\u6216\u4e22\u5230\u5f02\u5e38\u961f\u5217\u4eba\u5de5\u5904\u7406\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u540c\u4e00\u4e1a\u52a1 ID \u8fdb\u540c\u4e00\u961f\u5217&#xff0c;\u4e1a\u52a1\u72b6\u6001\u673a\u515c\u5e95<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>37. \u6d88\u606f\u6d88\u8d39\u5931\u8d25\u4e00\u76f4\u91cd\u8bd5&#xff0c;\u963b\u585e\u540e\u7eed\u6d88\u606f\u600e\u4e48\u529e&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u67d0\u6761\u6d88\u606f\u4e00\u76f4\u6d88\u8d39\u5931\u8d25&#xff0c;\u5bfc\u81f4\u540e\u9762\u7684\u6d88\u606f\u90fd\u6d88\u8d39\u4e0d\u4e86&#xff0c;\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u4e0d\u80fd\u8ba9\u6bd2\u6d88\u606f\u4e00\u76f4\u963b\u585e\u4e3b\u94fe\u8def&#xff0c;\u8981\u8bbe\u7f6e\u91cd\u8bd5\u4e0a\u9650\u548c\u6b7b\u4fe1\u961f\u5217\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u8bbe\u7f6e\u6700\u5927\u91cd\u8bd5\u6b21\u6570<\/p>\n<\/li>\n<li>\n<p>\u8d85\u8fc7\u6b21\u6570\u8fdb\u5165\u6b7b\u4fe1\u961f\u5217<\/p>\n<\/li>\n<li>\n<p>\u8bb0\u5f55\u5931\u8d25\u539f\u56e0\u548c\u4e0a\u4e0b\u6587<\/p>\n<\/li>\n<li>\n<p>\u540e\u53f0\u652f\u6301\u4eba\u5de5\u8865\u507f\u6216\u91cd\u65b0\u6295\u9012<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u903b\u8f91\u533a\u5206\u53ef\u91cd\u8bd5\u5f02\u5e38\u548c\u4e0d\u53ef\u91cd\u8bd5\u5f02\u5e38<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u5931\u8d25\u6d88\u606f\u662f\u5426\u662f\u6570\u636e\u95ee\u9898\u3001\u4ee3\u7801\u5f02\u5e38\u8fd8\u662f\u4e0b\u6e38\u4e34\u65f6\u4e0d\u53ef\u7528\u3002 \u5982\u679c\u662f\u4e0b\u6e38\u4e34\u65f6\u5f02\u5e38&#xff0c;\u53ef\u4ee5\u6709\u9650\u6b21\u6570\u91cd\u8bd5&#xff1b;\u5982\u679c\u662f\u53c2\u6570\u9519\u8bef\u8fd9\u7c7b\u4e0d\u53ef\u6062\u590d\u5f02\u5e38&#xff0c;\u5c31\u4e0d\u5e94\u8be5\u65e0\u9650\u91cd\u8bd5\u3002 \u8d85\u8fc7\u91cd\u8bd5\u6b21\u6570\u540e\u8fdb\u5165\u6b7b\u4fe1\u961f\u5217&#xff0c;\u8bb0\u5f55\u5931\u8d25\u539f\u56e0&#xff0c;\u540e\u7eed\u901a\u8fc7\u8865\u507f\u4efb\u52a1\u6216\u4eba\u5de5\u5904\u7406\u3002 \u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u4e00\u6761\u5f02\u5e38\u6d88\u606f\u963b\u585e\u6574\u4e2a\u6d88\u8d39\u94fe\u8def\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5931\u8d25\u8981\u6709\u9650\u91cd\u8bd5&#xff0c;\u6bd2\u6d88\u606f\u8fdb\u6b7b\u4fe1\u961f\u5217<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>38. Kafka \u6216 RocketMQ \u67d0\u4e2a\u5206\u533a\u79ef\u538b\u4e25\u91cd\u600e\u4e48\u5206\u6790&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>MQ \u53ea\u6709\u67d0\u4e2a\u5206\u533a\u6216\u961f\u5217\u79ef\u538b\u5f88\u4e25\u91cd&#xff0c;\u5176\u4ed6\u5206\u533a\u6b63\u5e38&#xff0c;\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5355\u5206\u533a\u79ef\u538b\u901a\u5e38\u662f\u6d88\u606f\u5206\u5e03\u4e0d\u5747\u3001\u70ed\u70b9 key \u6216\u8be5\u5206\u533a\u6d88\u8d39\u8005\u5f02\u5e38\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u5206\u533a\u952e\u4e0d\u5747\u5300&#xff0c;\u70ed\u70b9\u4e1a\u52a1 ID \u96c6\u4e2d\u5230\u4e00\u4e2a\u5206\u533a<\/p>\n<\/li>\n<li>\n<p>\u67d0\u4e2a\u6d88\u8d39\u8005\u5b9e\u4f8b\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u5355\u6761\u6d88\u606f\u5904\u7406\u7279\u522b\u6162<\/p>\n<\/li>\n<li>\n<p>\u987a\u5e8f\u6d88\u8d39\u5bfc\u81f4\u5e76\u884c\u5ea6\u53d7\u9650<\/p>\n<\/li>\n<li>\n<p>\u8be5\u5206\u533a\u6570\u636e\u91cf\u8fdc\u9ad8\u4e8e\u5176\u4ed6\u5206\u533a<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u5bf9\u6bd4\u5404\u5206\u533a\u7684\u751f\u4ea7\u91cf\u3001\u6d88\u8d39\u91cf\u548c lag\u3002 \u5982\u679c\u53ea\u6709\u4e00\u4e2a\u5206\u533a\u79ef\u538b&#xff0c;\u91cd\u70b9\u770b\u5206\u533a\u952e\u662f\u5426\u5bfc\u81f4\u70ed\u70b9\u6570\u636e\u90fd\u6253\u5230\u540c\u4e00\u4e2a\u5206\u533a\u3002 \u4e5f\u4f1a\u770b\u8d1f\u8d23\u8be5\u5206\u533a\u7684\u6d88\u8d39\u8005\u662f\u5426\u5f02\u5e38&#xff0c;\u7ebf\u7a0b\u662f\u5426\u5361\u4f4f\u3002 \u89e3\u51b3\u4e0a\u53ef\u4ee5\u4f18\u5316\u5206\u533a\u952e\u3001\u589e\u52a0\u5206\u533a\u3001\u62c6\u5206\u70ed\u70b9\u4e1a\u52a1&#xff0c;\u6216\u8005\u4f18\u5316\u8be5\u5206\u533a\u7684\u6d88\u8d39\u903b\u8f91\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5355\u5206\u533a\u79ef\u538b&#xff0c;\u591a\u534a\u662f\u5206\u5e03\u4e0d\u5747\u6216\u6d88\u8d39\u8005\u5361\u4f4f<\/p>\n<hr \/>\n<hr \/>\n<h2>\u516d\u3001\u5e76\u53d1\u3001\u5e42\u7b49\u4e0e\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u7c7b<\/h2>\n<h3>39. \u5206\u5e03\u5f0f\u9501\u5931\u6548\u5bfc\u81f4\u91cd\u590d\u5904\u7406\u600e\u4e48\u6392\u67e5&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u5b9a\u65f6\u4efb\u52a1\u6216\u6d88\u606f\u6d88\u8d39\u4e2d&#xff0c;\u540c\u4e00\u6761\u6570\u636e\u88ab\u591a\u4e2a\u5b9e\u4f8b\u91cd\u590d\u5904\u7406&#xff0c;\u4f60\u600e\u4e48\u89e3\u51b3&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u91cd\u590d\u5904\u7406\u8981\u5148\u5224\u65ad\u662f\u9501\u6ca1\u751f\u6548\u3001\u9501\u8fc7\u671f\u592a\u65e9\u3001\u4efb\u52a1\u91cd\u5165&#xff0c;\u8fd8\u662f\u4e1a\u52a1\u6ca1\u6709\u505a\u5e42\u7b49\u3002<\/p>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u9501 key \u8bbe\u8ba1\u4e0d\u5408\u7406&#xff0c;\u4e0d\u540c\u4e1a\u52a1\u7528\u4e86\u540c\u4e00\u4e2a key<\/p>\n<\/li>\n<li>\n<p>\u9501\u8fc7\u671f\u65f6\u95f4\u592a\u77ed&#xff0c;\u4e1a\u52a1\u6ca1\u6267\u884c\u5b8c\u9501\u5c31\u91ca\u653e\u4e86<\/p>\n<\/li>\n<li>\n<p>\u6ca1\u6709\u6821\u9a8c\u9501 value&#xff0c;\u8bef\u5220\u4e86\u522b\u4eba\u7684\u9501<\/p>\n<\/li>\n<li>\n<p>Redis \u4e3b\u4ece\u5207\u6362\u5bfc\u81f4\u9501\u72b6\u6001\u4e0d\u4e00\u81f4<\/p>\n<\/li>\n<li>\n<p>\u4e1a\u52a1\u6ca1\u6709\u5e42\u7b49&#xff0c;\u91cd\u590d\u8bf7\u6c42\u76f4\u63a5\u9020\u6210\u91cd\u590d\u6570\u636e<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u9501 key \u52a0\u4e1a\u52a1\u552f\u4e00\u6807\u8bc6<\/p>\n<\/li>\n<li>\n<p>\u9501 value \u4f7f\u7528\u552f\u4e00 requestId<\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u9501\u65f6\u7528 Lua \u811a\u672c\u4fdd\u8bc1\u539f\u5b50\u6027<\/p>\n<\/li>\n<li>\n<p>\u5408\u7406\u8bbe\u7f6e\u9501\u8fc7\u671f\u65f6\u95f4&#xff0c;\u5fc5\u8981\u65f6\u4f7f\u7528\u770b\u95e8\u72d7\u7eed\u671f<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u4e1a\u52a1\u5fc5\u987b\u505a\u5e42\u7b49&#xff0c;\u6bd4\u5982\u552f\u4e00\u7d22\u5f15\u3001\u72b6\u6001\u673a\u3001\u53bb\u91cd\u8868<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u770b\u91cd\u590d\u5904\u7406\u7684\u6570\u636e\u662f\u5426\u6709\u76f8\u540c\u4e1a\u52a1 ID&#xff0c;\u7136\u540e\u6392\u67e5\u5206\u5e03\u5f0f\u9501\u7684 key\u3001\u8fc7\u671f\u65f6\u95f4\u548c\u91ca\u653e\u903b\u8f91\u3002 \u5982\u679c\u9501\u8fc7\u671f\u65f6\u95f4\u592a\u77ed&#xff0c;\u4e1a\u52a1\u6ca1\u6267\u884c\u5b8c\u5176\u4ed6\u5b9e\u4f8b\u5c31\u4f1a\u62ff\u5230\u9501&#xff1b;\u5982\u679c\u91ca\u653e\u9501\u65f6\u6ca1\u6709\u6821\u9a8c value&#xff0c;\u53ef\u80fd\u8bef\u5220\u522b\u4eba\u7684\u9501\u3002 \u89e3\u51b3\u4e0a\u4f1a\u7528\u552f\u4e00 requestId \u4f5c\u4e3a\u9501 value&#xff0c;\u7528 Lua \u811a\u672c\u91ca\u653e\u9501&#xff0c;\u5e76\u7ed3\u5408\u4e1a\u52a1\u5e42\u7b49\u515c\u5e95&#xff0c;\u6bd4\u5982\u552f\u4e00\u7d22\u5f15\u6216\u72b6\u6001\u673a\u63a7\u5236\u3002 \u56e0\u4e3a\u5206\u5e03\u5f0f\u9501\u53ea\u80fd\u51cf\u5c11\u5e76\u53d1\u51b2\u7a81&#xff0c;\u4e0d\u80fd\u66ff\u4ee3\u4e1a\u52a1\u5e42\u7b49\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u9501\u9632\u5e76\u53d1&#xff0c;\u5e42\u7b49\u9632\u91cd\u590d<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>40. \u63a5\u53e3\u91cd\u590d\u63d0\u4ea4\u5bfc\u81f4\u91cd\u590d\u4e0b\u5355\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7528\u6237\u5feb\u901f\u70b9\u51fb\u4e24\u6b21\u63d0\u4ea4\u6309\u94ae&#xff0c;\u4ea7\u751f\u4e86\u4e24\u7b14\u8ba2\u5355&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u91cd\u590d\u63d0\u4ea4\u4e0d\u80fd\u53ea\u9760\u524d\u7aef\u6309\u94ae\u7f6e\u7070&#xff0c;\u540e\u7aef\u5fc5\u987b\u505a\u5e42\u7b49\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u524d\u7aef\u6309\u94ae\u9632\u91cd\u590d\u70b9\u51fb<\/p>\n<\/li>\n<li>\n<p>\u8bf7\u6c42\u5e26\u5e42\u7b49 token<\/p>\n<\/li>\n<li>\n<p>\u540e\u7aef\u4f7f\u7528 Redis \u4fdd\u5b58 token&#xff0c;\u5904\u7406\u6210\u529f\u540e\u5220\u9664\u6216\u6807\u8bb0\u5df2\u4f7f\u7528<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u52a0\u552f\u4e00\u7d22\u5f15\u515c\u5e95<\/p>\n<\/li>\n<li>\n<p>\u8ba2\u5355\u72b6\u6001\u673a\u63a7\u5236\u72b6\u6001\u6d41\u8f6c<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848\u793a\u4f8b<\/h4>\n<li>\n<p>\u7528\u6237\u8fdb\u5165\u4e0b\u5355\u9875\u65f6&#xff0c;\u540e\u7aef\u751f\u6210\u552f\u4e00 token \u8fd4\u56de\u524d\u7aef<\/p>\n<\/li>\n<li>\n<p>\u7528\u6237\u63d0\u4ea4\u8ba2\u5355\u65f6\u5e26\u4e0a token<\/p>\n<\/li>\n<li>\n<p>\u540e\u7aef\u7528 Redis SET NX \u6216 Lua \u811a\u672c\u6821\u9a8c token<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e00\u6b21\u8bf7\u6c42\u53ef\u4ee5\u7ee7\u7eed\u5904\u7406<\/p>\n<\/li>\n<li>\n<p>\u540e\u7eed\u91cd\u590d\u8bf7\u6c42\u76f4\u63a5\u8fd4\u56de\u201c\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4\u201d\u6216\u8fd4\u56de\u7b2c\u4e00\u6b21\u5904\u7406\u7ed3\u679c<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u5c42\u7528\u552f\u4e00\u7d22\u5f15\u4fdd\u8bc1\u540c\u4e00\u4e1a\u52a1\u5355\u53f7\u53ea\u80fd\u63d2\u5165\u4e00\u6b21<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4e0d\u4f1a\u53ea\u4f9d\u8d56\u524d\u7aef\u9632\u91cd\u590d\u70b9\u51fb&#xff0c;\u56e0\u4e3a\u8bf7\u6c42\u53ef\u80fd\u91cd\u8bd5&#xff0c;\u4e5f\u53ef\u80fd\u7ed5\u8fc7\u524d\u7aef\u3002 \u540e\u7aef\u4f1a\u57fa\u4e8e\u4e1a\u52a1\u552f\u4e00\u53f7\u6216\u5e42\u7b49 token \u505a\u63a7\u5236&#xff0c;\u6bd4\u5982 Redis SET NX \u4fdd\u8bc1\u540c\u4e00\u4e2a token \u53ea\u5904\u7406\u4e00\u6b21\u3002 \u540c\u65f6\u6570\u636e\u5e93\u52a0\u552f\u4e00\u7d22\u5f15\u515c\u5e95&#xff0c;\u907f\u514d\u5e76\u53d1\u60c5\u51b5\u4e0b\u63d2\u5165\u91cd\u590d\u8ba2\u5355\u3002 \u5982\u679c\u8ba2\u5355\u6709\u72b6\u6001\u6d41\u8f6c&#xff0c;\u8fd8\u4f1a\u7528\u72b6\u6001\u673a\u9650\u5236\u975e\u6cd5\u72b6\u6001\u53d8\u66f4\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u524d\u7aef\u9632\u6296\u53ea\u662f\u4f53\u9a8c&#xff0c;\u540e\u7aef\u5e42\u7b49\u624d\u662f\u6838\u5fc3&#xff0c;\u6570\u636e\u5e93\u552f\u4e00\u7d22\u5f15\u515c\u5e95<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>41. \u5206\u5e03\u5f0f\u4e8b\u52a1\u4e0d\u4e00\u81f4\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u8ba2\u5355\u521b\u5efa\u6210\u529f\u4e86&#xff0c;\u4f46\u662f\u5e93\u5b58\u6263\u51cf\u5931\u8d25&#xff0c;\u6570\u636e\u4e0d\u4e00\u81f4\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5148\u770b\u4e1a\u52a1\u662f\u5426\u5fc5\u987b\u5f3a\u4e00\u81f4\u3002 \u5927\u591a\u6570\u4e92\u8054\u7f51\u4e1a\u52a1\u53ef\u4ee5\u63a5\u53d7\u6700\u7ec8\u4e00\u81f4&#xff0c;\u901a\u5e38\u7528\u672c\u5730\u6d88\u606f\u8868\u3001\u53ef\u9760\u6d88\u606f\u3001\u4e8b\u52a1\u6d88\u606f\u6216 TCC\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u672c\u5730\u4e8b\u52a1 &#043; \u672c\u5730\u6d88\u606f\u8868<\/p>\n<\/li>\n<li>\n<p>MQ \u4e8b\u52a1\u6d88\u606f<\/p>\n<\/li>\n<li>\n<p>TCC<\/p>\n<\/li>\n<li>\n<p>Saga<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u8d26\u8865\u507f<\/p>\n<\/li>\n<h4>\u672c\u5730\u6d88\u606f\u8868\u65b9\u6848<\/h4>\n<li>\n<p>\u521b\u5efa\u8ba2\u5355\u548c\u63d2\u5165\u6d88\u606f\u8868\u653e\u5728\u540c\u4e00\u4e2a\u672c\u5730\u4e8b\u52a1\u91cc<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u63d0\u4ea4\u540e&#xff0c;\u540e\u53f0\u4efb\u52a1\u626b\u63cf\u6d88\u606f\u8868\u53d1\u9001 MQ<\/p>\n<\/li>\n<li>\n<p>\u5e93\u5b58\u670d\u52a1\u6d88\u8d39\u6d88\u606f\u6263\u51cf\u5e93\u5b58<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u6210\u529f\u540e\u66f4\u65b0\u6d88\u606f\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>\u5931\u8d25\u5219\u91cd\u8bd5<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u65f6\u4efb\u52a1\u505a\u8865\u507f\u548c\u5bf9\u8d26<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u5224\u65ad\u4e1a\u52a1\u662f\u5426\u8981\u6c42\u5f3a\u4e00\u81f4\u3002 \u5982\u679c\u53ef\u4ee5\u63a5\u53d7\u6700\u7ec8\u4e00\u81f4&#xff0c;\u6211\u66f4\u503e\u5411\u7528\u672c\u5730\u6d88\u606f\u8868\u6216\u4e8b\u52a1\u6d88\u606f\u3002 \u6bd4\u5982\u521b\u5efa\u8ba2\u5355\u65f6&#xff0c;\u628a\u8ba2\u5355\u8bb0\u5f55\u548c\u5f85\u53d1\u9001\u6d88\u606f\u653e\u5728\u540c\u4e00\u4e2a\u672c\u5730\u4e8b\u52a1\u91cc&#xff0c;\u4fdd\u8bc1\u8ba2\u5355\u6210\u529f\u4e00\u5b9a\u6709\u6d88\u606f\u3002 \u5e93\u5b58\u670d\u52a1\u6d88\u8d39\u6d88\u606f\u65f6\u8981\u505a\u5e42\u7b49&#xff0c;\u5931\u8d25\u53ef\u4ee5\u91cd\u8bd5&#xff0c;\u6700\u540e\u901a\u8fc7\u8865\u507f\u4efb\u52a1\u548c\u5bf9\u8d26\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u672c\u5730\u4e8b\u52a1\u4fdd\u8bc1\u6d88\u606f\u4e0d\u4e22&#xff0c;\u6d88\u8d39\u5e42\u7b49\u4fdd\u8bc1\u91cd\u590d\u4e0d\u6015&#xff0c;\u5bf9\u8d26\u8865\u507f\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>42. \u63a5\u53e3\u8d85\u65f6\u4f46\u6570\u636e\u6210\u529f\u4e86&#xff0c;\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u8c03\u7528\u7b2c\u4e09\u65b9\u63a5\u53e3\u8d85\u65f6\u4e86&#xff0c;\u4f46\u540e\u6765\u53d1\u73b0\u7b2c\u4e09\u65b9\u5176\u5b9e\u5904\u7406\u6210\u529f\u4e86&#xff0c;\u4f60\u600e\u4e48\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u63a5\u53e3\u8d85\u65f6\u4e0d\u4ee3\u8868\u5931\u8d25&#xff0c;\u53ef\u80fd\u662f\u6210\u529f\u3001\u5931\u8d25\u6216\u5904\u7406\u4e2d\u3002 \u8fd9\u79cd\u573a\u666f\u4e0d\u80fd\u7b80\u5355\u91cd\u8bd5&#xff0c;\u5fc5\u987b\u6709\u67e5\u8be2\u548c\u8865\u507f\u673a\u5236\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u8bf7\u6c42\u4f7f\u7528\u5168\u5c40\u552f\u4e00\u4e1a\u52a1\u6d41\u6c34\u53f7<\/p>\n<\/li>\n<li>\n<p>\u8d85\u65f6\u540e\u4e0d\u8981\u7acb\u5373\u5224\u5b9a\u5931\u8d25<\/p>\n<\/li>\n<li>\n<p>\u8c03\u7528\u67e5\u8be2\u63a5\u53e3\u786e\u8ba4\u6700\u7ec8\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>\u91cd\u8bd5\u65f6\u4fdd\u8bc1\u5e42\u7b49<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u65f6\u4efb\u52a1\u626b\u63cf\u5904\u7406\u4e2d\u8bb0\u5f55\u5e76\u8865\u507f<\/p>\n<\/li>\n<li>\n<p>\u4e0e\u7b2c\u4e09\u65b9\u505a\u5bf9\u8d26<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u628a\u8d85\u65f6\u72b6\u6001\u5355\u72ec\u6807\u8bb0\u4e3a\u5904\u7406\u4e2d&#xff0c;\u800c\u4e0d\u662f\u76f4\u63a5\u5f53\u5931\u8d25\u3002 \u6bcf\u6b21\u8bf7\u6c42\u90fd\u5e26\u552f\u4e00\u4e1a\u52a1\u6d41\u6c34\u53f7&#xff0c;\u7b2c\u4e09\u65b9\u4e5f\u57fa\u4e8e\u8fd9\u4e2a\u6d41\u6c34\u53f7\u505a\u5e42\u7b49\u3002 \u5982\u679c\u8c03\u7528\u8d85\u65f6&#xff0c;\u5c31\u901a\u8fc7\u67e5\u8be2\u63a5\u53e3\u786e\u8ba4\u6700\u7ec8\u72b6\u6001&#xff1b;\u67e5\u8be2\u4e0d\u5230\u518d\u8fdb\u884c\u6709\u9650\u6b21\u6570\u91cd\u8bd5\u3002 \u540c\u65f6\u7528\u5b9a\u65f6\u4efb\u52a1\u626b\u63cf\u5904\u7406\u4e2d\u6570\u636e&#xff0c;\u505a\u8865\u507f\u548c\u5bf9\u8d26&#xff0c;\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u8d85\u65f6\u4e0d\u7b49\u4e8e\u5931\u8d25&#xff0c;\u5148\u67e5\u72b6\u6001&#xff0c;\u518d\u5e42\u7b49\u91cd\u8bd5&#xff0c;\u6700\u540e\u8865\u507f\u5bf9\u8d26<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>43. \u5e93\u5b58\u8d85\u5356\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u9ad8\u5e76\u53d1\u4e0b\u591a\u4e2a\u7528\u6237\u540c\u65f6\u4e0b\u5355&#xff0c;\u5e93\u5b58\u88ab\u6263\u6210\u8d1f\u6570\u4e86&#xff0c;\u600e\u4e48\u89e3\u51b3&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5e93\u5b58\u95ee\u9898\u6838\u5fc3\u662f\u5e76\u53d1\u6263\u51cf\u548c\u5e42\u7b49\u3002 \u6570\u636e\u5e93\u5c42\u8981\u4fdd\u8bc1\u6263\u51cf\u539f\u5b50\u6027&#xff0c;\u4e1a\u52a1\u5c42\u8981\u9632\u91cd\u590d\u6263\u51cf\u3002<\/p>\n<h4>\u5e38\u89c1\u65b9\u6848<\/h4>\n<li>\n<p>\u6570\u636e\u5e93\u6761\u4ef6\u66f4\u65b0<\/p>\n<\/li>\n<p>UPDATE product<br \/>\nSET stock &#061; stock &#8211; 1<br \/>\nWHERE id &#061; ? AND stock &gt; 0;<\/p>\n<p>\u6839\u636e\u5f71\u54cd\u884c\u6570\u5224\u65ad\u662f\u5426\u6263\u51cf\u6210\u529f\u3002<\/p>\n<li>\n<p>Redis \u9884\u6263\u5e93\u5b58<\/p>\n<\/li>\n<li>\n<p>MQ \u5f02\u6b65\u524a\u5cf0<\/p>\n<\/li>\n<li>\n<p>\u5206\u5e03\u5f0f\u9501\u63a7\u5236\u5e76\u53d1<\/p>\n<\/li>\n<li>\n<p>\u8ba2\u5355\u5e42\u7b49\u548c\u9632\u91cd\u590d\u6d88\u8d39<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u4f18\u5148\u7528\u6570\u636e\u5e93\u6761\u4ef6\u66f4\u65b0\u4fdd\u8bc1\u539f\u5b50\u6263\u51cf&#xff0c;\u6bd4\u5982 stock &gt; 0 \u624d\u5141\u8bb8\u6263\u51cf&#xff0c;\u5e76\u6839\u636e\u5f71\u54cd\u884c\u6570\u5224\u65ad\u662f\u5426\u6210\u529f\u3002 \u5728\u9ad8\u5e76\u53d1\u79d2\u6740\u573a\u666f&#xff0c;\u53ef\u4ee5\u5148\u7528 Redis \u9884\u6263\u5e93\u5b58&#xff0c;\u518d\u901a\u8fc7 MQ \u5f02\u6b65\u843d\u5e93\u524a\u5cf0\u3002 \u540c\u65f6\u8ba2\u5355\u521b\u5efa\u548c\u6d88\u606f\u6d88\u8d39\u90fd\u8981\u505a\u5e42\u7b49&#xff0c;\u907f\u514d\u91cd\u590d\u8bf7\u6c42\u6216\u91cd\u590d\u6d88\u8d39\u5bfc\u81f4\u91cd\u590d\u6263\u5e93\u5b58\u3002 \u5206\u5e03\u5f0f\u9501\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u79cd\u65b9\u6848&#xff0c;\u4f46\u9ad8\u5e76\u53d1\u4e0b\u8981\u6ce8\u610f\u6027\u80fd\u548c\u9501\u7c92\u5ea6\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6761\u4ef6\u66f4\u65b0\u9632\u8d85\u5356&#xff0c;Redis \u9884\u6263\u6297\u9ad8\u5e76\u53d1&#xff0c;MQ \u524a\u5cf0&#xff0c;\u5e42\u7b49\u515c\u5e95<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>44. \u4e50\u89c2\u9501\u66f4\u65b0\u5931\u8d25\u5f88\u591a\u600e\u4e48\u4f18\u5316&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u9ad8\u5e76\u53d1\u4e0b\u4f7f\u7528\u7248\u672c\u53f7\u4e50\u89c2\u9501&#xff0c;\u4f46\u5927\u91cf\u66f4\u65b0\u5931\u8d25&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u4e50\u89c2\u9501\u9002\u5408\u51b2\u7a81\u5c11\u7684\u573a\u666f\u3002 \u5982\u679c\u51b2\u7a81\u7279\u522b\u9ad8&#xff0c;\u5c31\u8981\u51cf\u5c11\u70ed\u70b9\u7ade\u4e89\u6216\u6362\u65b9\u6848\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u589e\u52a0\u6709\u9650\u91cd\u8bd5\u548c\u968f\u673a\u9000\u907f<\/p>\n<\/li>\n<li>\n<p>\u964d\u4f4e\u540c\u4e00\u8bb0\u5f55\u5e76\u53d1\u66f4\u65b0\u9891\u7387<\/p>\n<\/li>\n<li>\n<p>\u70ed\u70b9\u6570\u636e\u62c6\u5206&#xff0c;\u6bd4\u5982\u5e93\u5b58\u5206\u6bb5<\/p>\n<\/li>\n<li>\n<p>\u6539\u6210\u6570\u636e\u5e93\u539f\u5b50\u6761\u4ef6\u66f4\u65b0<\/p>\n<\/li>\n<li>\n<p>\u9ad8\u51b2\u7a81\u573a\u666f\u8003\u8651\u60b2\u89c2\u9501\u6216\u961f\u5217\u4e32\u884c\u5316<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u4e50\u89c2\u9501\u5931\u8d25\u591a\u8bf4\u660e\u540c\u4e00\u6761\u6570\u636e\u7ade\u4e89\u5f88\u6fc0\u70c8\u3002 \u6211\u4f1a\u5148\u52a0\u6709\u9650\u91cd\u8bd5\u548c\u968f\u673a\u9000\u907f&#xff0c;\u4f46\u4e0d\u80fd\u65e0\u9650\u91cd\u8bd5&#xff0c;\u5426\u5219\u4f1a\u653e\u5927\u6570\u636e\u5e93\u538b\u529b\u3002 \u5982\u679c\u662f\u5e93\u5b58\u8fd9\u7c7b\u70ed\u70b9&#xff0c;\u53ef\u4ee5\u505a\u5e93\u5b58\u5206\u6bb5\u6216\u7528\u539f\u5b50\u6761\u4ef6\u66f4\u65b0\u3002 \u5982\u679c\u4e1a\u52a1\u5fc5\u987b\u4e25\u683c\u4e32\u884c&#xff0c;\u4e5f\u53ef\u4ee5\u901a\u8fc7\u961f\u5217\u628a\u540c\u4e00\u4e1a\u52a1 ID \u7684\u8bf7\u6c42\u4e32\u884c\u5316\u5904\u7406\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u4e50\u89c2\u9501\u9002\u5408\u4f4e\u51b2\u7a81&#xff0c;\u9ad8\u51b2\u7a81\u8981\u62c6\u70ed\u70b9\u6216\u4e32\u884c\u5316<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>45. \u72b6\u6001\u673a\u5e76\u53d1\u6d41\u8f6c\u9519\u4e71\u600e\u4e48\u8bbe\u8ba1&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u8ba2\u5355\u72b6\u6001\u88ab\u5e76\u53d1\u66f4\u65b0&#xff0c;\u51fa\u73b0\u72b6\u6001\u9519\u4e71&#xff0c;\u600e\u4e48\u907f\u514d&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u72b6\u6001\u6d41\u8f6c\u5fc5\u987b\u6709\u660e\u786e\u7684\u524d\u7f6e\u72b6\u6001\u7ea6\u675f&#xff0c;\u4e0d\u80fd\u53ea\u6309 ID \u66f4\u65b0\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u5b9a\u4e49\u72b6\u6001\u673a\u548c\u5408\u6cd5\u6d41\u8f6c\u8def\u5f84<\/p>\n<\/li>\n<li>\n<p>SQL \u66f4\u65b0\u65f6\u5e26\u4e0a\u5f53\u524d\u72b6\u6001\u6761\u4ef6<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u7248\u672c\u53f7\u9632\u5e76\u53d1\u8986\u76d6<\/p>\n<\/li>\n<li>\n<p>\u91cd\u590d\u8bf7\u6c42\u8fd4\u56de\u5f53\u524d\u6700\u7ec8\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>\u5f02\u5e38\u72b6\u6001\u8fdb\u5165\u8865\u507f\u6d41\u7a0b<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u5b9a\u4e49\u8ba2\u5355\u72b6\u6001\u673a&#xff0c;\u660e\u786e\u54ea\u4e9b\u72b6\u6001\u53ef\u4ee5\u6d41\u8f6c\u5230\u54ea\u4e9b\u72b6\u6001\u3002 \u66f4\u65b0\u65f6 SQL \u4e0d\u53ea\u5e26\u8ba2\u5355 ID&#xff0c;\u8fd8\u8981\u5e26\u5f53\u524d\u72b6\u6001&#xff0c;\u6bd4\u5982\u53ea\u6709\u5f85\u652f\u4ed8\u624d\u80fd\u66f4\u65b0\u4e3a\u5df2\u652f\u4ed8\u3002 \u5982\u679c\u5f71\u54cd\u884c\u6570\u4e3a 0&#xff0c;\u8bf4\u660e\u72b6\u6001\u5df2\u7ecf\u53d8\u5316&#xff0c;\u9700\u8981\u67e5\u8be2\u5f53\u524d\u72b6\u6001\u518d\u51b3\u5b9a\u8fd4\u56de\u6210\u529f\u3001\u5931\u8d25\u8fd8\u662f\u8865\u507f\u3002 \u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5e76\u53d1\u8bf7\u6c42\u628a\u5df2\u53d6\u6d88\u8ba2\u5355\u53c8\u6539\u6210\u5df2\u652f\u4ed8\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u72b6\u6001\u66f4\u65b0\u5fc5\u987b\u5e26\u524d\u7f6e\u72b6\u6001<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>46. \u7528\u6237\u4f59\u989d\u6263\u51cf\u6210\u529f&#xff0c;\u4f46\u8ba2\u5355\u72b6\u6001\u66f4\u65b0\u5931\u8d25\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u6263\u6b3e\u6210\u529f\u4e86&#xff0c;\u4f46\u8ba2\u5355\u72b6\u6001\u6ca1\u66f4\u65b0\u6210\u529f&#xff0c;\u6570\u636e\u4e0d\u4e00\u81f4\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5982\u679c\u5728\u540c\u4e00\u4e2a\u6570\u636e\u5e93&#xff0c;\u4f18\u5148\u653e\u540c\u4e00\u4e2a\u672c\u5730\u4e8b\u52a1\u3002 \u5982\u679c\u8de8\u670d\u52a1&#xff0c;\u5c31\u8981\u7528\u6700\u7ec8\u4e00\u81f4\u65b9\u6848\u548c\u8865\u507f\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u540c\u5e93\u64cd\u4f5c\u653e\u5728\u4e00\u4e2a\u672c\u5730\u4e8b\u52a1<\/p>\n<\/li>\n<li>\n<p>\u8de8\u670d\u52a1\u4f7f\u7528\u4e8b\u52a1\u6d88\u606f\u6216\u672c\u5730\u6d88\u606f\u8868<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u4e00\u6b65\u64cd\u4f5c\u90fd\u8981\u5e42\u7b49<\/p>\n<\/li>\n<li>\n<p>\u5931\u8d25\u72b6\u6001\u8bb0\u5f55\u6e05\u695a<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u65f6\u4efb\u52a1\u8865\u507f\u548c\u5bf9\u8d26<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5982\u679c\u4f59\u989d\u548c\u8ba2\u5355\u5728\u540c\u4e00\u4e2a\u5e93&#xff0c;\u6211\u4f1a\u653e\u5728\u540c\u4e00\u4e2a\u672c\u5730\u4e8b\u52a1\u91cc\u4fdd\u8bc1\u4e00\u81f4\u3002 \u5982\u679c\u662f\u4e24\u4e2a\u670d\u52a1&#xff0c;\u5c31\u4e0d\u80fd\u9760\u672c\u5730\u4e8b\u52a1\u89e3\u51b3&#xff0c;\u9700\u8981\u7528\u4e8b\u52a1\u6d88\u606f\u3001\u672c\u5730\u6d88\u606f\u8868\u6216 TCC\u3002 \u6263\u6b3e\u6210\u529f\u540e\u8ba2\u5355\u66f4\u65b0\u5931\u8d25&#xff0c;\u8981\u8bb0\u5f55\u4e2d\u95f4\u72b6\u6001&#xff0c;\u901a\u8fc7\u8865\u507f\u4efb\u52a1\u7ee7\u7eed\u66f4\u65b0\u8ba2\u5355\u6216\u53d1\u8d77\u9000\u6b3e\u3002 \u540c\u65f6\u6240\u6709\u8865\u507f\u52a8\u4f5c\u90fd\u8981\u5e42\u7b49&#xff0c;\u907f\u514d\u91cd\u590d\u6263\u6b3e\u6216\u91cd\u590d\u9000\u6b3e\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u8de8\u670d\u52a1\u4e00\u81f4\u6027\u9760\u72b6\u6001\u3001\u6d88\u606f\u3001\u8865\u507f\u3001\u5bf9\u8d26<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>47. \u8d85\u7ea7 SIM \u5fc5\u8fbe\u6d88\u606f\u91cd\u590d\u8ba1\u8d39\u600e\u4e48\u6392\u67e5\u548c\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u4f60\u5728\u8d85\u7ea7 SIM \u9879\u76ee\u91cc\u9047\u5230\u8fc7\u4ec0\u4e48\u771f\u5b9e\u7ebf\u4e0a\u95ee\u9898&#xff1f;\u5982\u679c\u5fc5\u8fbe\u6d88\u606f\u5957\u5305\u989d\u5ea6\u6d88\u8017\u4e0d\u51c6&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;<\/p>\n<h4>\u9879\u76ee\u80cc\u666f<\/h4>\n<p>\u8d85\u7ea7 SIM \u7edf\u4e00\u5e73\u53f0\u91cc\u6709\u4e00\u4e2a\u5fc5\u8fbe\u6d88\u606f\u7ec4\u5408\u5957\u5305\u8ba1\u8d39\u80fd\u529b\u3002 \u4e1a\u52a1\u89c4\u5219\u662f\u540c\u4e00\u4e2a\u5ba2\u6237\u3001\u540c\u4e00\u4e2a\u5957\u5305\u3001\u540c\u4e00\u4e2a\u8ba1\u8d39\u5468\u671f\u5185&#xff0c;\u540c\u4e00\u4e2a\u624b\u673a\u53f7\u53ea\u80fd\u8ba1\u8d39\u4e00\u6b21\u3002 \u5e73\u53f0\u9700\u8981\u5728\u9ad8\u5e76\u53d1\u6279\u91cf\u53d1\u9001\u5fc5\u8fbe\u6d88\u606f\u65f6&#xff0c;\u5b9e\u65f6\u5224\u65ad\u624b\u673a\u53f7\u662f\u5426\u5df2\u7ecf\u8ba1\u8d39&#xff0c;\u5e76\u5237\u65b0\u5ba2\u6237\u7684\u53ef\u7528\u989d\u5ea6\u3002<\/p>\n<h4>\u95ee\u9898\u73b0\u8c61<\/h4>\n<p>\u8fd0\u8425\u4fa7\u53cd\u9988\u67d0\u4e9b\u5ba2\u6237\u7684\u5957\u5305\u989d\u5ea6\u6d88\u8017\u504f\u5feb\u3002 \u6392\u67e5\u8d26\u5355\u660e\u7ec6\u540e\u53d1\u73b0&#xff0c;\u5c11\u91cf\u624b\u673a\u53f7\u5728\u540c\u4e00\u4e2a\u8ba1\u8d39\u5468\u671f\u5185\u51fa\u73b0\u4e86\u91cd\u590d\u8ba1\u8d39\u8bb0\u5f55\u3002 \u8fd9\u4e2a\u95ee\u9898\u4e0d\u662f\u6bcf\u6b21\u90fd\u51fa\u73b0&#xff0c;\u4e3b\u8981\u96c6\u4e2d\u5728\u6279\u91cf\u53d1\u9001\u3001MQ \u91cd\u8bd5\u6216\u8005\u591a\u4e2a\u6279\u6b21\u540c\u65f6\u89e6\u8fbe\u540c\u4e00\u6279\u624b\u673a\u53f7\u7684\u65f6\u5019\u3002<\/p>\n<h4>\u6392\u67e5\u8fc7\u7a0b<\/h4>\n<li>\n<p>\u5148\u67e5\u8ba1\u8d39\u660e\u7ec6\u8868<\/p>\n<ul>\n<li>\n<p>\u6309 tenantId &#043; packageId &#043; billingCycle &#043; phone \u5206\u7ec4\u7edf\u8ba1<\/p>\n<\/li>\n<li>\n<p>\u53d1\u73b0\u90e8\u5206\u624b\u673a\u53f7\u786e\u5b9e\u5b58\u5728\u591a\u6761\u8ba1\u8d39\u660e\u7ec6<\/p>\n<\/li>\n<li>\n<p>\u8bf4\u660e\u4e0d\u662f\u524d\u7aef\u5c55\u793a\u95ee\u9898&#xff0c;\u800c\u662f\u540e\u7aef\u91cd\u590d\u5165\u8d26<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u518d\u67e5\u63a5\u53e3\u65e5\u5fd7\u548c MQ \u6d88\u8d39\u65e5\u5fd7<\/p>\n<ul>\n<li>\n<p>\u53d1\u73b0\u540c\u4e00\u4e2a\u624b\u673a\u53f7\u53ef\u80fd\u5728\u77ed\u65f6\u95f4\u5185\u88ab\u591a\u4e2a\u6279\u6b21\u540c\u65f6\u53d1\u9001<\/p>\n<\/li>\n<li>\n<p>MQ \u6d88\u8d39\u5931\u8d25\u540e\u4f1a\u89e6\u53d1\u91cd\u8bd5<\/p>\n<\/li>\n<li>\n<p>\u540c\u4e00\u624b\u673a\u53f7\u53ef\u80fd\u88ab\u591a\u4e2a\u7ebf\u7a0b\u6216\u591a\u4e2a\u6d88\u8d39\u8005\u540c\u65f6\u8fdb\u5165\u8ba1\u8d39\u903b\u8f91<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u518d\u770b\u539f\u6765\u7684\u53bb\u91cd\u903b\u8f91<\/p>\n<\/li>\n<p>\u539f\u903b\u8f91\u5927\u6982\u662f&#xff1a;<\/p>\n<p>\u67e5 Redis \u662f\u5426\u5df2\u8ba1\u8d39 -&gt; \u5199 MySQL \u660e\u7ec6 -&gt; \u6263\u51cf\u5957\u5305\u989d\u5ea6 -&gt; \u66f4\u65b0 Redis \u53bb\u91cd\u6807\u8bb0<\/p>\n<p>\u8fd9\u4e2a\u6d41\u7a0b\u7684\u95ee\u9898\u662f Redis \u5224\u65ad\u548c\u6570\u636e\u5e93\u5199\u5165\u4e0d\u662f\u539f\u5b50\u7684\u3002 \u9ad8\u5e76\u53d1\u4e0b&#xff0c;\u4e24\u4e2a\u7ebf\u7a0b\u53ef\u80fd\u540c\u65f6\u5224\u65ad Redis \u4e2d\u4e0d\u5b58\u5728\u8be5\u624b\u673a\u53f7&#xff0c;\u7136\u540e\u90fd\u7ee7\u7eed\u5199\u660e\u7ec6\u548c\u6263\u989d\u5ea6\u3002<\/p>\n<li>\n<p>\u6700\u540e\u68c0\u67e5\u6570\u636e\u5e93\u7ea6\u675f<\/p>\n<ul>\n<li>\n<p>\u660e\u7ec6\u8868\u867d\u7136\u8bb0\u5f55\u4e86\u624b\u673a\u53f7\u548c\u8ba1\u8d39\u5468\u671f<\/p>\n<\/li>\n<li>\n<p>\u4f46\u6ca1\u6709\u4e25\u683c\u7684\u552f\u4e00\u7d22\u5f15\u515c\u5e95<\/p>\n<\/li>\n<li>\n<p>\u5e76\u53d1\u7a7f\u900f Redis \u540e&#xff0c;\u6570\u636e\u5e93\u4e5f\u6ca1\u6709\u6321\u4f4f\u91cd\u590d\u6570\u636e<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u6839\u56e0\u5206\u6790<\/h4>\n<li>\n<p>Redis \u53bb\u91cd\u5224\u65ad\u548c\u5199\u5165\u4e0d\u662f\u539f\u5b50\u64cd\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u9ad8\u5e76\u53d1\u6216 MQ \u91cd\u8bd5\u65f6&#xff0c;\u540c\u4e00\u624b\u673a\u53f7\u53ef\u80fd\u91cd\u590d\u8fdb\u5165\u8ba1\u8d39\u903b\u8f91<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u7f3a\u5c11\u552f\u4e00\u7d22\u5f15\u515c\u5e95<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u7aef\u5e42\u7b49\u4e0d\u8db3&#xff0c;\u91cd\u590d\u6d88\u606f\u53ef\u80fd\u5bfc\u81f4\u91cd\u590d\u6263\u51cf\u989d\u5ea6<\/p>\n<\/li>\n<li>\n<p>\u628a\u7f13\u5b58\u5f53\u6210\u4e86\u6700\u7ec8\u5e42\u7b49\u4f9d\u636e&#xff0c;\u800c\u7f13\u5b58\u4e0d\u9002\u5408\u505a\u6700\u7ec8\u4e00\u81f4\u6027\u4fdd\u969c<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>Redis \u4f4d\u56fe\u6216\u5e03\u9686\u8fc7\u6ee4\u5668\u53ea\u505a\u524d\u7f6e\u8fc7\u6ee4<\/p>\n<ul>\n<li>\n<p>\u7528\u4e8e\u5feb\u901f\u5224\u65ad\u624b\u673a\u53f7\u662f\u5426\u53ef\u80fd\u5df2\u7ecf\u8ba1\u8d39<\/p>\n<\/li>\n<li>\n<p>\u4e3b\u8981\u4f5c\u7528\u662f\u51cf\u5c11\u6570\u636e\u5e93\u538b\u529b<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u4f5c\u4e3a\u6700\u7ec8\u662f\u5426\u8ba1\u8d39\u7684\u552f\u4e00\u4f9d\u636e<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u660e\u7ec6\u8868\u589e\u52a0\u552f\u4e00\u7ea6\u675f<\/p>\n<\/li>\n<p>\u552f\u4e00\u952e\u53ef\u4ee5\u8bbe\u8ba1\u4e3a&#xff1a;<\/p>\n<p>tenant_id &#043; package_id &#043; billing_cycle &#043; phone_hash<\/p>\n<p>\u8fd9\u6837\u5373\u4f7f\u591a\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u8fdb\u5165\u6570\u636e\u5e93&#xff0c;\u540c\u4e00\u4e2a\u624b\u673a\u53f7\u5728\u540c\u4e00\u4e2a\u8ba1\u8d39\u5468\u671f\u5185\u4e5f\u53ea\u80fd\u63d2\u5165\u4e00\u6761\u660e\u7ec6\u3002<\/p>\n<li>\n<p>\u8c03\u6574\u8ba1\u8d39\u987a\u5e8f<\/p>\n<\/li>\n<p>\u6539\u6210&#xff1a;<\/p>\n<p>\u5148\u63d2\u5165\u8ba1\u8d39\u660e\u7ec6 -&gt; \u63d2\u5165\u6210\u529f\u540e\u6263\u51cf\u989d\u5ea6 -&gt; \u66f4\u65b0 Redis \u4f4d\u56fe\/\u5e03\u9686\u8fc7\u6ee4\u5668<\/p>\n<p>\u5982\u679c\u63d2\u5165\u660e\u7ec6\u6210\u529f&#xff0c;\u8bf4\u660e\u8fd9\u662f\u7b2c\u4e00\u6b21\u8ba1\u8d39&#xff0c;\u518d\u6263\u51cf\u5957\u5305\u989d\u5ea6\u3002 \u5982\u679c\u51fa\u73b0\u552f\u4e00\u952e\u51b2\u7a81&#xff0c;\u8bf4\u660e\u8be5\u624b\u673a\u53f7\u5df2\u7ecf\u8ba1\u8d39\u8fc7&#xff0c;\u76f4\u63a5\u8df3\u8fc7\u6263\u51cf\u3002<\/p>\n<li>\n<p>MQ \u6d88\u8d39\u7aef\u589e\u52a0\u4e1a\u52a1\u5e42\u7b49<\/p>\n<ul>\n<li>\n<p>\u6bcf\u6761\u6d88\u606f\u5e26 messageId \u6216 requestNo<\/p>\n<\/li>\n<li>\n<p>\u6d88\u8d39\u524d\u5224\u65ad\u8be5\u6d88\u606f\u662f\u5426\u5904\u7406\u8fc7<\/p>\n<\/li>\n<li>\n<p>\u907f\u514d MQ \u91cd\u8bd5\u5bfc\u81f4\u540c\u4e00\u6279\u6570\u636e\u91cd\u590d\u5904\u7406<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u589e\u52a0\u5bf9\u8d26\u548c\u8865\u507f<\/p>\n<ul>\n<li>\n<p>\u5b9a\u65f6\u6309\u6570\u636e\u5e93\u8ba1\u8d39\u660e\u7ec6\u6c47\u603b\u5b9e\u9645\u53bb\u91cd\u624b\u673a\u53f7\u6570\u91cf<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u6bd4\u5957\u5305\u989d\u5ea6\u6d88\u8017<\/p>\n<\/li>\n<li>\n<p>\u53d1\u73b0\u4e0d\u4e00\u81f4\u65f6\u751f\u6210\u5dee\u5f02\u8bb0\u5f55<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7\u8865\u507f\u4efb\u52a1\u4fee\u6b63\u989d\u5ea6\u6216\u8d26\u5355<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>\u6838\u5fc3\u4f2a\u4ee3\u7801<\/h4>\n<p>try {<br \/>\n    insertBillingDetail(tenantId, packageId, cycle, phoneHash);<br \/>\n    decreasePackageQuota(packageId, 1);<br \/>\n    updateRedisDedupMark(cycle, phoneHash);<br \/>\n} catch (DuplicateKeyException e) {<br \/>\n    \/\/ \u5df2\u7ecf\u8ba1\u8d39\u8fc7&#xff0c;\u4e0d\u518d\u6263\u51cf\u989d\u5ea6<br \/>\n    return;<br \/>\n}<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u5728\u8d85\u7ea7 SIM \u7edf\u4e00\u5e73\u53f0\u91cc\u5904\u7406\u8fc7\u4e00\u4e2a\u5fc5\u8fbe\u6d88\u606f\u5957\u5305\u91cd\u590d\u8ba1\u8d39\u7684\u95ee\u9898\u3002 \u4e1a\u52a1\u89c4\u5219\u662f\u540c\u4e00\u4e2a\u5ba2\u6237\u3001\u540c\u4e00\u4e2a\u5957\u5305\u3001\u540c\u4e00\u4e2a\u8ba1\u8d39\u5468\u671f\u5185&#xff0c;\u540c\u4e00\u4e2a\u624b\u673a\u53f7\u53ea\u80fd\u8ba1\u8d39\u4e00\u6b21\u3002\u7ebf\u4e0a\u73b0\u8c61\u662f\u90e8\u5206\u5ba2\u6237\u989d\u5ea6\u6d88\u8017\u504f\u5feb&#xff0c;\u67e5\u8d26\u5355\u660e\u7ec6\u540e\u53d1\u73b0\u5c11\u91cf\u624b\u673a\u53f7\u5b58\u5728\u91cd\u590d\u8ba1\u8d39\u3002<\/p>\n<p>\u6211\u5148\u6309\u79df\u6237\u3001\u5957\u5305\u3001\u8ba1\u8d39\u5468\u671f\u3001\u624b\u673a\u53f7\u7ef4\u5ea6\u67e5\u660e\u7ec6&#xff0c;\u786e\u8ba4\u662f\u540e\u7aef\u91cd\u590d\u5165\u8d26\u3002\u7136\u540e\u770b MQ \u6d88\u8d39\u65e5\u5fd7&#xff0c;\u53d1\u73b0\u9ad8\u5e76\u53d1\u6279\u91cf\u53d1\u9001\u548c MQ \u91cd\u8bd5\u65f6&#xff0c;\u540c\u4e00\u4e2a\u624b\u673a\u53f7\u53ef\u80fd\u88ab\u591a\u4e2a\u6d88\u8d39\u8005\u540c\u65f6\u5904\u7406\u3002\u7ee7\u7eed\u770b\u4ee3\u7801\u53d1\u73b0&#xff0c;\u539f\u6765\u7684\u903b\u8f91\u662f\u5148\u67e5 Redis \u662f\u5426\u5b58\u5728&#xff0c;\u518d\u5199\u6570\u636e\u5e93\u548c\u6263\u989d\u5ea6&#xff0c;\u8fd9\u4e2a\u5224\u65ad\u548c\u5199\u5165\u4e0d\u662f\u539f\u5b50\u7684\u3002\u5e76\u53d1\u60c5\u51b5\u4e0b\u4e24\u4e2a\u7ebf\u7a0b\u53ef\u80fd\u90fd\u5224\u65ad Redis \u4e0d\u5b58\u5728&#xff0c;\u7136\u540e\u90fd\u8fdb\u5165\u6263\u51cf\u903b\u8f91\u3002<\/p>\n<p>\u540e\u9762\u6211\u4eec\u628a\u65b9\u6848\u8c03\u6574\u4e3a&#xff1a;Redis \u4f4d\u56fe\u6216\u5e03\u9686\u8fc7\u6ee4\u5668\u53ea\u505a\u524d\u7f6e\u8fc7\u6ee4&#xff0c;\u771f\u6b63\u7684\u5e42\u7b49\u7531\u6570\u636e\u5e93\u552f\u4e00\u7d22\u5f15\u515c\u5e95\u3002\u660e\u7ec6\u8868\u589e\u52a0 tenantId &#043; packageId &#043; billingCycle &#043; phoneHash \u552f\u4e00\u7ea6\u675f&#xff0c;\u53ea\u6709\u63d2\u5165\u660e\u7ec6\u6210\u529f\u624d\u6263\u51cf\u989d\u5ea6\u3002\u5982\u679c\u63d2\u5165\u65f6\u51fa\u73b0\u552f\u4e00\u952e\u51b2\u7a81&#xff0c;\u5c31\u8bf4\u660e\u8fd9\u4e2a\u624b\u673a\u53f7\u5df2\u7ecf\u8ba1\u8d39\u8fc7&#xff0c;\u76f4\u63a5\u8df3\u8fc7\u3002<\/p>\n<p>\u540c\u65f6 MQ \u6d88\u8d39\u7aef\u589e\u52a0\u4e1a\u52a1\u5e42\u7b49&#xff0c;\u907f\u514d\u6d88\u606f\u91cd\u590d\u6295\u9012\u5bfc\u81f4\u91cd\u590d\u5904\u7406\u3002\u6700\u540e\u518d\u901a\u8fc7\u5b9a\u65f6\u4efb\u52a1\u505a\u660e\u7ec6\u548c\u989d\u5ea6\u5bf9\u8d26&#xff0c;\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u7f13\u5b58\u53ea\u505a\u524d\u7f6e\u8fc7\u6ee4&#xff0c;\u6570\u636e\u5e93\u552f\u4e00\u7d22\u5f15\u515c\u5e95&#xff0c;MQ \u6d88\u8d39\u5e42\u7b49&#xff0c;\u5bf9\u8d26\u8865\u507f\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4<\/p>\n<hr \/>\n<h2>\u4e03\u3001\u53d1\u5e03\u3001\u914d\u7f6e\u4e0e\u5fae\u670d\u52a1\u67b6\u6784\u7c7b<\/h2>\n<h3>48. \u7ebf\u4e0a\u53d1\u5e03\u540e\u5927\u91cf\u62a5\u9519\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u521a\u53d1\u5e03\u5b8c\u65b0\u7248\u672c&#xff0c;\u63a5\u53e3\u5927\u91cf 500&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u53d1\u5e03\u540e\u5927\u91cf\u5f02\u5e38&#xff0c;\u4f18\u5148\u8003\u8651\u65b0\u7248\u672c\u5f15\u5165\u95ee\u9898\u3002 \u5148\u6b62\u635f&#xff0c;\u518d\u5b9a\u4f4d\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u770b\u9519\u8bef\u7387\u3001RT\u3001QPS \u662f\u5426\u5728\u53d1\u5e03\u540e\u53d8\u5316<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u6bd4\u65b0\u65e7\u7248\u672c\u5b9e\u4f8b\u9519\u8bef\u60c5\u51b5<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u5f02\u5e38\u65e5\u5fd7\u548c\u8c03\u7528\u94fe<\/p>\n<\/li>\n<li>\n<p>\u5224\u65ad\u662f\u5426\u662f\u914d\u7f6e\u3001SQL\u3001\u517c\u5bb9\u6027\u6216\u7a7a\u6307\u9488\u95ee\u9898<\/p>\n<\/li>\n<li>\n<p>\u8bc4\u4f30\u662f\u5426\u9700\u8981\u56de\u6eda<\/p>\n<\/li>\n<h4>\u5e38\u89c1\u6839\u56e0<\/h4>\n<li>\n<p>\u914d\u7f6e\u6f0f\u53d1\u6216\u914d\u7f6e\u9519\u8bef<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u5b57\u6bb5\u6216\u8868\u7ed3\u6784\u4e0d\u517c\u5bb9<\/p>\n<\/li>\n<li>\n<p>\u4ee3\u7801\u7a7a\u6307\u9488<\/p>\n<\/li>\n<li>\n<p>\u4f9d\u8d56\u7248\u672c\u51b2\u7a81<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58 key \u683c\u5f0f\u53d8\u5316\u4e0d\u517c\u5bb9<\/p>\n<\/li>\n<li>\n<p>\u7070\u5ea6\u9a8c\u8bc1\u4e0d\u5145\u5206<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u7acb\u5373\u56de\u6eda\u6216\u6458\u9664\u65b0\u7248\u672c\u5b9e\u4f8b<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u662f\u914d\u7f6e\u95ee\u9898&#xff0c;\u5feb\u901f\u4fee\u590d\u914d\u7f6e<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u662f\u6570\u636e\u517c\u5bb9\u95ee\u9898&#xff0c;\u8865\u517c\u5bb9\u903b\u8f91<\/p>\n<\/li>\n<li>\n<p>\u540e\u7eed\u5b8c\u5584\u7070\u5ea6\u53d1\u5e03\u3001\u81ea\u52a8\u5316\u56de\u5f52\u548c\u53d1\u5e03\u68c0\u67e5\u6e05\u5355<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u53d1\u5e03\u540e\u5927\u91cf\u62a5\u9519&#xff0c;\u6211\u4f1a\u5148\u5224\u65ad\u95ee\u9898\u662f\u5426\u548c\u65b0\u7248\u672c\u5f3a\u76f8\u5173\u3002 \u5982\u679c\u65b0\u7248\u672c\u5b9e\u4f8b\u9519\u8bef\u7387\u660e\u663e\u66f4\u9ad8&#xff0c;\u4f1a\u4f18\u5148\u56de\u6eda\u6216\u6458\u9664\u65b0\u7248\u672c\u6d41\u91cf&#xff0c;\u5148\u6062\u590d\u670d\u52a1\u3002 \u7136\u540e\u518d\u770b\u5f02\u5e38\u65e5\u5fd7\u548c\u94fe\u8def\u8ffd\u8e2a&#xff0c;\u5b9a\u4f4d\u662f\u914d\u7f6e\u3001\u4ee3\u7801\u3001\u6570\u636e\u5e93\u517c\u5bb9&#xff0c;\u8fd8\u662f\u7f13\u5b58\u517c\u5bb9\u95ee\u9898\u3002 \u590d\u76d8\u65f6\u4f1a\u8865\u5145\u7070\u5ea6\u9a8c\u8bc1\u3001\u53d1\u5e03\u68c0\u67e5\u6e05\u5355\u548c\u56de\u6eda\u9884\u6848\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u53d1\u5e03\u540e\u5f02\u5e38&#xff0c;\u5148\u56de\u6eda\u6b62\u635f&#xff0c;\u518d\u5b9a\u4f4d\u6839\u56e0<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>49. \u7070\u5ea6\u53d1\u5e03\u65f6\u65b0\u8001\u7248\u672c\u6570\u636e\u4e0d\u517c\u5bb9\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7070\u5ea6\u53d1\u5e03\u65f6&#xff0c;\u65b0\u7248\u672c\u5199\u7684\u6570\u636e\u8001\u7248\u672c\u8bfb\u4e0d\u4e86&#xff0c;\u600e\u4e48\u907f\u514d&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u7070\u5ea6\u53d1\u5e03\u8981\u6c42\u63a5\u53e3\u3001\u6570\u636e\u5e93\u3001\u7f13\u5b58\u548c\u6d88\u606f\u90fd\u8981\u5411\u524d\u517c\u5bb9\u3001\u5411\u540e\u517c\u5bb9\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u6570\u636e\u5e93\u53d8\u66f4\u5148\u52a0\u5b57\u6bb5&#xff0c;\u540e\u5207\u4ee3\u7801&#xff0c;\u6700\u540e\u5220\u65e7\u5b57\u6bb5<\/p>\n<\/li>\n<li>\n<p>\u65b0\u5b57\u6bb5\u5141\u8bb8\u4e3a\u7a7a\u5e76\u8bbe\u7f6e\u9ed8\u8ba4\u503c<\/p>\n<\/li>\n<li>\n<p>\u6d88\u606f\u4f53\u65b0\u589e\u5b57\u6bb5\u4e0d\u80fd\u5f71\u54cd\u8001\u6d88\u8d39\u8005<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58 key \u53d8\u66f4\u8981\u517c\u5bb9\u65e7\u683c\u5f0f<\/p>\n<\/li>\n<li>\n<p>\u53d1\u5e03\u91c7\u7528\u5148\u517c\u5bb9\u3001\u518d\u5207\u6362\u3001\u6700\u540e\u6e05\u7406\u7684\u8282\u594f<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u7070\u5ea6\u53d1\u5e03\u65f6\u4e0d\u80fd\u5047\u8bbe\u6240\u6709\u5b9e\u4f8b\u540c\u65f6\u5347\u7ea7\u6210\u529f\u3002 \u6211\u4f1a\u4fdd\u8bc1\u65b0\u8001\u7248\u672c\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c&#xff0c;\u6bd4\u5982\u6570\u636e\u5e93\u5148\u52a0\u5b57\u6bb5\u4f46\u4e0d\u5220\u9664\u65e7\u5b57\u6bb5&#xff0c;\u63a5\u53e3\u65b0\u589e\u5b57\u6bb5\u4e0d\u5f71\u54cd\u8001\u7248\u672c\u89e3\u6790\u3002 \u7f13\u5b58\u548c MQ \u6d88\u606f\u4e5f\u8981\u505a\u517c\u5bb9&#xff0c;\u907f\u514d\u65b0\u7248\u672c\u5199\u5165\u540e\u8001\u7248\u672c\u8bfb\u5931\u8d25\u3002 \u7b49\u6240\u6709\u5b9e\u4f8b\u5347\u7ea7\u5e76\u7a33\u5b9a\u540e&#xff0c;\u518d\u6e05\u7406\u65e7\u903b\u8f91\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u7070\u5ea6\u53d1\u5e03\u6838\u5fc3\u662f\u53cc\u7248\u672c\u517c\u5bb9<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>50. \u914d\u7f6e\u4e2d\u5fc3\u63a8\u9519\u914d\u7f6e\u5bfc\u81f4\u7ebf\u4e0a\u6545\u969c\u600e\u4e48\u9632\u6b62&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u914d\u7f6e\u4e2d\u5fc3\u4e00\u63a8\u9519\u914d\u7f6e&#xff0c;\u7ebf\u4e0a\u5168\u6302\u4e86&#xff0c;\u600e\u4e48\u6cbb\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u914d\u7f6e\u53d8\u66f4\u548c\u4ee3\u7801\u53d1\u5e03\u4e00\u6837\u6709\u98ce\u9669&#xff0c;\u4e5f\u9700\u8981\u7070\u5ea6\u3001\u6821\u9a8c\u3001\u56de\u6eda\u548c\u5ba1\u8ba1\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u914d\u7f6e\u53d8\u66f4\u5ba1\u6279<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u683c\u5f0f\u548c\u53d6\u503c\u8303\u56f4\u6821\u9a8c<\/p>\n<\/li>\n<li>\n<p>\u7070\u5ea6\u63a8\u9001&#xff0c;\u5148\u5c0f\u6d41\u91cf\u9a8c\u8bc1<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u7248\u672c\u7ba1\u7406\u548c\u4e00\u952e\u56de\u6eda<\/p>\n<\/li>\n<li>\n<p>\u5173\u952e\u914d\u7f6e\u52a0\u4fdd\u62a4\u9608\u503c<\/p>\n<\/li>\n<li>\n<p>\u63a8\u9001\u540e\u81ea\u52a8\u89c2\u5bdf\u9519\u8bef\u7387\u548c RT<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u628a\u914d\u7f6e\u53d1\u5e03\u5f53\u6210\u4e00\u6b21\u7ebf\u4e0a\u53d8\u66f4\u6765\u7ba1\u7406\u3002 \u914d\u7f6e\u4e2d\u5fc3\u8981\u652f\u6301\u683c\u5f0f\u6821\u9a8c\u3001\u5ba1\u6279\u3001\u7070\u5ea6\u53d1\u5e03\u548c\u7248\u672c\u56de\u6eda&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u5168\u91cf\u63a8\u9001\u3002 \u5bf9\u7ebf\u7a0b\u6c60\u5927\u5c0f\u3001\u9650\u6d41\u9608\u503c\u3001\u5f00\u5173\u7c7b\u914d\u7f6e\u8981\u8bbe\u7f6e\u5408\u7406\u8fb9\u754c&#xff0c;\u907f\u514d\u586b\u9519\u5bfc\u81f4\u670d\u52a1\u4e0d\u53ef\u7528\u3002 \u53d1\u5e03\u540e\u8fd8\u8981\u89c2\u5bdf\u6838\u5fc3\u6307\u6807&#xff0c;\u5f02\u5e38\u65f6\u5feb\u901f\u56de\u6eda\u914d\u7f6e\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u914d\u7f6e\u4e5f\u662f\u53d1\u5e03&#xff0c;\u8981\u7070\u5ea6\u3001\u6821\u9a8c\u3001\u56de\u6eda<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>51. \u670d\u52a1\u6ce8\u518c\u4e2d\u5fc3\u5f02\u5e38&#xff0c;\u670d\u52a1\u8fd8\u80fd\u4e0d\u80fd\u6b63\u5e38\u8c03\u7528&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u6ce8\u518c\u4e2d\u5fc3\u6302\u4e86&#xff0c;\u5fae\u670d\u52a1\u4e4b\u95f4\u8fd8\u80fd\u8c03\u7528\u5417&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u8981\u770b\u5ba2\u6237\u7aef\u662f\u5426\u6709\u672c\u5730\u670d\u52a1\u5217\u8868\u7f13\u5b58\u3002 \u901a\u5e38\u5df2\u53d1\u73b0\u7684\u670d\u52a1\u8fd8\u80fd\u8c03\u7528&#xff0c;\u4f46\u65b0\u5b9e\u4f8b\u6ce8\u518c\u548c\u6545\u969c\u5b9e\u4f8b\u6458\u9664\u4f1a\u53d7\u5f71\u54cd\u3002<\/p>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5982\u679c\u6ce8\u518c\u4e2d\u5fc3\u5f02\u5e38&#xff0c;\u5df2\u7ecf\u62c9\u53d6\u8fc7\u7684\u670d\u52a1\u5217\u8868\u901a\u5e38\u4f1a\u7f13\u5b58\u5728\u5ba2\u6237\u7aef&#xff0c;\u6240\u4ee5\u77ed\u65f6\u95f4\u5185\u670d\u52a1\u4e4b\u95f4\u8fd8\u80fd\u8c03\u7528\u3002 \u4f46\u65b0\u670d\u52a1\u6ce8\u518c\u3001\u4e0b\u7ebf\u5b9e\u4f8b\u6458\u9664\u3001\u670d\u52a1\u5217\u8868\u66f4\u65b0\u4f1a\u53d7\u5f71\u54cd\u3002 \u8fd9\u65f6\u8981\u907f\u514d\u9891\u7e41\u91cd\u542f\u670d\u52a1&#xff0c;\u56e0\u4e3a\u91cd\u542f\u540e\u53ef\u80fd\u62ff\u4e0d\u5230\u670d\u52a1\u5217\u8868\u3002 \u957f\u671f\u8981\u4fdd\u8bc1\u6ce8\u518c\u4e2d\u5fc3\u9ad8\u53ef\u7528&#xff0c;\u5e76\u5728\u5ba2\u6237\u7aef\u4fdd\u7559\u672c\u5730\u7f13\u5b58\u548c\u5bb9\u9519\u7b56\u7565\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6ce8\u518c\u4e2d\u5fc3\u6302\u4e86&#xff0c;\u5b58\u91cf\u8c03\u7528\u53ef\u80fd\u8fd8\u80fd\u8dd1&#xff0c;\u670d\u52a1\u53d8\u66f4\u4f1a\u53d7\u5f71\u54cd<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>52. \u591a\u673a\u623f\u90e8\u7f72\u65f6\u6570\u636e\u4e00\u81f4\u6027\u548c\u6d41\u91cf\u5207\u6362\u600e\u4e48\u8003\u8651&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7cfb\u7edf\u505a\u591a\u673a\u623f\u90e8\u7f72&#xff0c;\u600e\u4e48\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4\u6027&#xff1f;\u673a\u623f\u6545\u969c\u600e\u4e48\u5207\u6d41&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u591a\u673a\u623f\u8981\u5148\u660e\u786e\u662f\u540c\u57ce\u53cc\u6d3b\u3001\u5f02\u5730\u591a\u6d3b&#xff0c;\u8fd8\u662f\u4e3b\u5907\u5bb9\u707e\u3002 \u4e0d\u540c\u67b6\u6784\u5bf9\u4e00\u81f4\u6027\u548c\u5ef6\u8fdf\u7684\u8981\u6c42\u4e0d\u4e00\u6837\u3002<\/p>\n<h4>\u5173\u952e\u8003\u8651<\/h4>\n<li>\n<p>\u7528\u6237\u6309\u5730\u57df\u6216\u7528\u6237 ID \u8def\u7531\u5230\u56fa\u5b9a\u673a\u623f<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u5199\u64cd\u4f5c\u907f\u514d\u591a\u673a\u623f\u540c\u65f6\u5199\u540c\u4e00\u4efd\u6570\u636e<\/p>\n<\/li>\n<li>\n<p>\u8de8\u673a\u623f\u540c\u6b65\u8981\u8003\u8651\u5ef6\u8fdf\u548c\u51b2\u7a81<\/p>\n<\/li>\n<li>\n<p>\u6545\u969c\u5207\u6d41\u8981\u6709\u9884\u6848\u548c\u6f14\u7ec3<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u3001MQ\u3001\u6570\u636e\u5e93\u90fd\u8981\u8003\u8651\u5bb9\u707e<\/p>\n<\/li>\n<li>\n<p>\u5207\u6d41\u540e\u8981\u505a\u6570\u636e\u6821\u9a8c\u548c\u56de\u5207\u65b9\u6848<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u533a\u5206\u662f\u4e3b\u5907\u8fd8\u662f\u53cc\u6d3b\u3002 \u5982\u679c\u662f\u4e3b\u5907&#xff0c;\u6b63\u5e38\u6d41\u91cf\u8d70\u4e3b\u673a\u623f&#xff0c;\u5907\u673a\u623f\u540c\u6b65\u6570\u636e&#xff0c;\u6545\u969c\u65f6\u5207\u5230\u5907\u673a\u623f\u3002 \u5982\u679c\u662f\u53cc\u6d3b&#xff0c;\u8981\u5c3d\u91cf\u6309\u7528\u6237\u7ef4\u5ea6\u505a\u6d41\u91cf\u5206\u7247&#xff0c;\u907f\u514d\u4e24\u4e2a\u673a\u623f\u540c\u65f6\u5199\u540c\u4e00\u4efd\u6570\u636e\u3002 \u8de8\u673a\u623f\u540c\u6b65\u4e00\u5b9a\u4f1a\u6709\u5ef6\u8fdf&#xff0c;\u6240\u4ee5\u8981\u8bbe\u8ba1\u51b2\u7a81\u5904\u7406\u3001\u5bf9\u8d26\u8865\u507f\u548c\u5207\u6d41\u6f14\u7ec3\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u591a\u673a\u623f\u5148\u5b9a\u67b6\u6784&#xff0c;\u6838\u5fc3\u662f\u8def\u7531\u3001\u540c\u6b65\u3001\u51b2\u7a81\u548c\u5207\u6d41<\/p>\n<hr \/>\n<hr \/>\n<h2>\u516b\u3001\u6279\u5904\u7406\u3001\u4efb\u52a1\u4e0e\u8fd0\u7ef4\u6545\u969c\u7c7b<\/h2>\n<h3>53. \u5b9a\u65f6\u4efb\u52a1\u91cd\u590d\u6267\u884c\u600e\u4e48\u89e3\u51b3&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u670d\u52a1\u90e8\u7f72\u591a\u53f0\u673a\u5668\u540e&#xff0c;\u5b9a\u65f6\u4efb\u52a1\u88ab\u591a\u53f0\u673a\u5668\u540c\u65f6\u6267\u884c\u4e86&#xff0c;\u600e\u4e48\u529e&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u591a\u5b9e\u4f8b\u90e8\u7f72\u65f6&#xff0c;\u672c\u5730\u5b9a\u65f6\u4efb\u52a1\u5929\u7136\u4f1a\u91cd\u590d\u6267\u884c&#xff0c;\u9700\u8981\u505a\u4efb\u52a1\u8c03\u5ea6\u534f\u8c03\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4f7f\u7528\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u6846\u67b6&#xff0c;\u6bd4\u5982 XXL-JOB\u3001ElasticJob<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u5206\u5e03\u5f0f\u9501\u4fdd\u8bc1\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\u6267\u884c<\/p>\n<\/li>\n<li>\n<p>\u4efb\u52a1\u672c\u8eab\u505a\u5e42\u7b49<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u6267\u884c\u7ed3\u679c\u505a\u72b6\u6001\u8bb0\u5f55&#xff0c;\u907f\u514d\u91cd\u590d\u5904\u7406<\/p>\n<\/li>\n<li>\n<p>\u957f\u4efb\u52a1\u8981\u8003\u8651\u9501\u7eed\u671f\u548c\u5931\u8d25\u91cd\u8bd5<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5982\u679c\u670d\u52a1\u591a\u5b9e\u4f8b\u90e8\u7f72&#xff0c;\u672c\u5730 &#064;Scheduled \u4f1a\u5728\u6bcf\u53f0\u673a\u5668\u90fd\u6267\u884c\u3002 \u7b80\u5355\u573a\u666f\u53ef\u4ee5\u7528 Redis \u5206\u5e03\u5f0f\u9501\u63a7\u5236\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\u6267\u884c&#xff0c;\u4f46\u4efb\u52a1\u5fc5\u987b\u505a\u5e42\u7b49\u3002 \u66f4\u89c4\u8303\u7684\u505a\u6cd5\u662f\u4f7f\u7528 XXL-JOB \u8fd9\u7c7b\u8c03\u5ea6\u5e73\u53f0&#xff0c;\u652f\u6301\u5206\u7247\u3001\u5931\u8d25\u91cd\u8bd5\u3001\u65e5\u5fd7\u548c\u544a\u8b66\u3002 \u5982\u679c\u4efb\u52a1\u6267\u884c\u65f6\u95f4\u8f83\u957f&#xff0c;\u8fd8\u8981\u8003\u8651\u9501\u8fc7\u671f\u548c\u7eed\u671f\u95ee\u9898\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u591a\u5b9e\u4f8b\u5b9a\u65f6\u4efb\u52a1\u4e00\u5b9a\u4f1a\u91cd\u590d&#xff0c;\u8c03\u5ea6\u6846\u67b6\u6216\u5206\u5e03\u5f0f\u9501&#xff0c;\u52a0\u5e42\u7b49\u515c\u5e95<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>54. \u5927\u6279\u91cf\u6570\u636e\u5bfc\u5165\u5bfc\u81f4\u7cfb\u7edf\u53d8\u6162\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7528\u6237\u4e0a\u4f20\u51e0\u5341\u4e07\u884c Excel&#xff0c;\u5bfc\u5165\u65f6\u7cfb\u7edf\u53d8\u6162\u751a\u81f3 OOM&#xff0c;\u4f60\u600e\u4e48\u4f18\u5316&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u5927\u6279\u91cf\u5bfc\u5165\u8981\u907f\u514d\u4e00\u6b21\u6027\u8bfb\u5165\u5185\u5b58\u3001\u907f\u514d\u5355\u6761\u63d2\u5165\u3001\u907f\u514d\u957f\u4e8b\u52a1\u3002<\/p>\n<h4>\u5e38\u89c1\u95ee\u9898<\/h4>\n<li>\n<p>Excel \u4e00\u6b21\u6027\u52a0\u8f7d\u5230\u5185\u5b58\u5bfc\u81f4 OOM<\/p>\n<\/li>\n<li>\n<p>\u5355\u6761\u63d2\u5165\u6570\u636e\u5e93\u6548\u7387\u4f4e<\/p>\n<\/li>\n<li>\n<p>\u4e00\u4e2a\u5927\u4e8b\u52a1\u6301\u6709\u9501\u592a\u4e45<\/p>\n<\/li>\n<li>\n<p>\u6821\u9a8c\u903b\u8f91\u9010\u6761\u67e5\u5e93<\/p>\n<\/li>\n<li>\n<p>\u5bfc\u5165\u8fc7\u7a0b\u5360\u6ee1\u4e1a\u52a1\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4f7f\u7528\u6d41\u5f0f\u8bfb\u53d6 Excel<\/p>\n<\/li>\n<li>\n<p>\u5206\u6279\u6821\u9a8c\u3001\u5206\u6279\u5165\u5e93<\/p>\n<\/li>\n<li>\n<p>\u6279\u91cf\u63d2\u5165\u6216\u6279\u91cf\u66f4\u65b0<\/p>\n<\/li>\n<li>\n<p>\u5927\u4e8b\u52a1\u62c6\u6210\u5c0f\u4e8b\u52a1<\/p>\n<\/li>\n<li>\n<p>\u5bfc\u5165\u4efb\u52a1\u5f02\u6b65\u5316&#xff0c;\u8fd4\u56de\u4efb\u52a1 ID<\/p>\n<\/li>\n<li>\n<p>\u72ec\u7acb\u7ebf\u7a0b\u6c60\u5904\u7406\u5bfc\u5165\u4efb\u52a1<\/p>\n<\/li>\n<li>\n<p>\u8bb0\u5f55\u5bfc\u5165\u8fdb\u5ea6\u548c\u5931\u8d25\u660e\u7ec6<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u5927\u6587\u4ef6\u5bfc\u5165\u6211\u4e0d\u4f1a\u540c\u6b65\u963b\u585e\u63a5\u53e3\u5904\u7406\u3002 \u4e00\u822c\u4f1a\u4e0a\u4f20\u540e\u751f\u6210\u5bfc\u5165\u4efb\u52a1&#xff0c;\u5f02\u6b65\u5904\u7406&#xff0c;\u5e76\u8fd4\u56de\u4efb\u52a1 ID \u7ed9\u524d\u7aef\u67e5\u8be2\u8fdb\u5ea6\u3002 \u5904\u7406\u65f6\u91c7\u7528\u6d41\u5f0f\u8bfb\u53d6&#xff0c;\u907f\u514d\u4e00\u6b21\u6027\u52a0\u8f7d\u5230\u5185\u5b58&#xff1b;\u6570\u636e\u5e93\u64cd\u4f5c\u6309\u6279\u6b21\u63d0\u4ea4&#xff0c;\u907f\u514d\u5355\u6761\u63d2\u5165\u548c\u5927\u4e8b\u52a1\u3002 \u540c\u65f6\u5bfc\u5165\u7ebf\u7a0b\u6c60\u8981\u548c\u6838\u5fc3\u4e1a\u52a1\u7ebf\u7a0b\u6c60\u9694\u79bb&#xff0c;\u9632\u6b62\u5bfc\u5165\u4efb\u52a1\u62d6\u6162\u6b63\u5e38\u63a5\u53e3\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u6d41\u5f0f\u8bfb\u53d6\u3001\u5206\u6279\u5165\u5e93\u3001\u5f02\u6b65\u4efb\u52a1\u3001\u7ebf\u7a0b\u6c60\u9694\u79bb<\/p>\n<hr \/>\n<hr \/>\n<hr \/>\n<h3>55. \u65e5\u5fd7\u91cf\u7a81\u7136\u66b4\u589e\u5bfc\u81f4\u78c1\u76d8\u6253\u6ee1\u600e\u4e48\u5904\u7406&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u7ebf\u4e0a\u670d\u52a1\u78c1\u76d8\u6ee1\u4e86&#xff0c;\u53d1\u73b0\u662f\u65e5\u5fd7\u6253\u6ee1\u7684&#xff0c;\u4f60\u600e\u4e48\u5904\u7406&#xff1f;<\/p>\n<h4>\u56de\u7b54\u601d\u8def<\/h4>\n<p>\u78c1\u76d8\u6ee1\u8981\u5148\u5feb\u901f\u91ca\u653e\u7a7a\u95f4\u6062\u590d\u670d\u52a1&#xff0c;\u518d\u5b9a\u4f4d\u65e5\u5fd7\u66b4\u589e\u539f\u56e0\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<li>\n<p>\u67e5\u770b\u78c1\u76d8<\/p>\n<\/li>\n<p>df -h<br \/>\ndu -sh *<\/p>\n<li>\n<p>\u627e\u5927\u6587\u4ef6<\/p>\n<\/li>\n<p>find \/path -type f -size &#043;1G<\/p>\n<li>\n<p>\u67e5\u770b\u65e5\u5fd7\u662f\u5426\u5927\u91cf\u91cd\u590d\u5f02\u5e38<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u65e5\u5fd7\u7ea7\u522b\u662f\u5426\u88ab\u8c03\u6210 DEBUG<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u662f\u5426\u6709\u5f02\u5e38\u5806\u6808\u5728\u5faa\u73af\u6253\u5370<\/p>\n<\/li>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u4e34\u65f6\u6e05\u7406\u6216\u538b\u7f29\u5386\u53f2\u65e5\u5fd7<\/p>\n<\/li>\n<li>\n<p>\u8c03\u6574\u65e5\u5fd7\u7ea7\u522b<\/p>\n<\/li>\n<li>\n<p>\u4fee\u590d\u5faa\u73af\u5f02\u5e38\u6253\u5370<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u65e5\u5fd7\u5207\u5272\u548c\u4fdd\u7559\u5929\u6570<\/p>\n<\/li>\n<li>\n<p>\u589e\u52a0\u78c1\u76d8\u4f7f\u7528\u7387\u544a\u8b66<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u9519\u8bef\u65e5\u5fd7\u9650\u9891<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u6211\u4f1a\u5148\u7528 df -h \u786e\u8ba4\u78c1\u76d8\u4f7f\u7528\u7387&#xff0c;\u518d\u7528 du \u6216 find \u627e\u5230\u5927\u65e5\u5fd7\u6587\u4ef6\u3002 \u77ed\u671f\u5148\u6e05\u7406\u5386\u53f2\u65e5\u5fd7\u6216\u538b\u7f29\u65e5\u5fd7&#xff0c;\u6062\u590d\u670d\u52a1\u53ef\u7528\u6027\u3002 \u7136\u540e\u770b\u662f\u4e0d\u662f\u65e5\u5fd7\u7ea7\u522b\u88ab\u8c03\u6210 DEBUG&#xff0c;\u6216\u8005\u67d0\u4e2a\u5f02\u5e38\u5728\u5faa\u73af\u6253\u5370\u3002 \u957f\u671f\u8981\u914d\u7f6e\u65e5\u5fd7\u6eda\u52a8\u3001\u4fdd\u7559\u5929\u6570\u3001\u78c1\u76d8\u544a\u8b66&#xff0c;\u5e76\u5bf9\u9ad8\u9891\u9519\u8bef\u65e5\u5fd7\u505a\u9650\u9891\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u5148\u91ca\u653e\u7a7a\u95f4&#xff0c;\u518d\u67e5\u65e5\u5fd7\u66b4\u589e\u539f\u56e0&#xff0c;\u6700\u540e\u52a0\u5207\u5272\u548c\u544a\u8b66<\/p>\n<hr \/>\n<hr \/>\n<h2>\u4e5d\u3001\u7ebf\u4e0a\u95ee\u9898\u590d\u76d8\u7c7b<\/h2>\n<h3>56. \u7ebf\u4e0a\u95ee\u9898\u590d\u76d8\u600e\u4e48\u8bb2&#xff1f;<\/h3>\n<h4>\u9762\u8bd5\u5b98\u5e38\u89c1\u95ee\u6cd5<\/h4>\n<p>\u4f60\u4eec\u7ebf\u4e0a\u51fa\u8fc7\u95ee\u9898\u5417&#xff1f;\u6700\u540e\u600e\u4e48\u590d\u76d8\u7684&#xff1f;<\/p>\n<h4>\u56de\u7b54\u7ed3\u6784<\/h4>\n<li>\n<p>\u95ee\u9898\u80cc\u666f<\/p>\n<\/li>\n<li>\n<p>\u5f71\u54cd\u8303\u56f4<\/p>\n<\/li>\n<li>\n<p>\u53d1\u73b0\u65b9\u5f0f<\/p>\n<\/li>\n<li>\n<p>\u6392\u67e5\u8fc7\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u6839\u56e0\u5206\u6790<\/p>\n<\/li>\n<li>\n<p>\u4e34\u65f6\u6b62\u635f<\/p>\n<\/li>\n<li>\n<p>\u957f\u671f\u4f18\u5316<\/p>\n<\/li>\n<li>\n<p>\u590d\u76d8\u6539\u8fdb<\/p>\n<\/li>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u7ebf\u4e0a\u95ee\u9898\u590d\u76d8\u6211\u4e00\u822c\u4f1a\u6309\u65f6\u95f4\u7ebf\u8bb2\u3002 \u5148\u8bf4\u660e\u4ec0\u4e48\u65f6\u95f4\u53d1\u73b0\u3001\u5f71\u54cd\u4e86\u54ea\u4e9b\u63a5\u53e3\u548c\u7528\u6237&#xff0c;\u7136\u540e\u8bb2\u6211\u4eec\u901a\u8fc7\u76d1\u63a7\u3001\u65e5\u5fd7\u3001\u94fe\u8def\u8ffd\u8e2a\u600e\u4e48\u4e00\u6b65\u6b65\u5b9a\u4f4d\u3002 \u5b9a\u4f4d\u540e\u5148\u91c7\u53d6\u4e86\u4ec0\u4e48\u6b62\u635f\u63aa\u65bd&#xff0c;\u6bd4\u5982\u56de\u6eda\u3001\u9650\u6d41\u3001\u6269\u5bb9\u6216\u964d\u7ea7\u3002 \u6700\u540e\u518d\u8bb2\u957f\u671f\u65b9\u6848&#xff0c;\u6bd4\u5982\u4fee\u590d\u4ee3\u7801\u3001\u8865\u5145\u76d1\u63a7\u544a\u8b66\u3001\u5b8c\u5584\u7070\u5ea6\u53d1\u5e03\u3001\u589e\u52a0\u538b\u6d4b\u548c\u56de\u5f52\u7528\u4f8b\u3002<\/p>\n<h4>\u8bb0\u5fc6\u70b9<\/h4>\n<p>\u80cc\u666f -&gt; \u5f71\u54cd -&gt; \u6392\u67e5 -&gt; \u6839\u56e0 -&gt; \u6b62\u635f -&gt; \u957f\u671f\u4f18\u5316<\/p>\n<hr \/>\n<h2>\u8865\u5145\u9ad8\u9891\u573a\u666f\u9898<\/h2>\n<hr \/>\n<h2>\u573a\u666f\u9898\u4e07\u80fd\u56de\u7b54\u516c\u5f0f<\/h2>\n<p>\u9762\u8bd5\u4e2d\u9047\u5230\u4e0d\u4f1a\u7684\u573a\u666f\u9898&#xff0c;\u53ef\u4ee5\u6309\u8fd9\u4e2a\u7ed3\u6784\u7ec4\u7ec7\u8bed\u8a00&#xff1a;<\/p>\n<li>\n<p>\u5148\u786e\u8ba4\u73b0\u8c61<\/p>\n<ul>\n<li>\n<p>\u662f\u54ea\u4e2a\u63a5\u53e3\u3001\u54ea\u4e2a\u670d\u52a1\u3001\u54ea\u53f0\u673a\u5668\u3001\u4ec0\u4e48\u65f6\u95f4\u5f00\u59cb\u5f02\u5e38<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u518d\u5224\u65ad\u5f71\u54cd\u8303\u56f4<\/p>\n<ul>\n<li>\n<p>\u5355\u673a\u8fd8\u662f\u96c6\u7fa4<\/p>\n<\/li>\n<li>\n<p>\u5355\u63a5\u53e3\u8fd8\u662f\u5168\u670d\u52a1<\/p>\n<\/li>\n<li>\n<p>\u90e8\u5206\u7528\u6237\u8fd8\u662f\u5168\u90e8\u7528\u6237<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6309\u94fe\u8def\u62c6\u5206<\/p>\n<ul>\n<li>\n<p>\u7f51\u5173<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93<\/p>\n<\/li>\n<li>\n<p>Redis<\/p>\n<\/li>\n<li>\n<p>MQ<\/p>\n<\/li>\n<li>\n<p>\u4e0b\u6e38\u670d\u52a1<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7ed3\u5408\u5de5\u5177\u5b9a\u4f4d<\/p>\n<ul>\n<li>\n<p>CPU&#xff1a;top\u3001top -Hp\u3001jstack<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58&#xff1a;jmap\u3001MAT\u3001GC \u65e5\u5fd7<\/p>\n<\/li>\n<li>\n<p>SQL&#xff1a;\u6162\u67e5\u8be2\u65e5\u5fd7\u3001EXPLAIN<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60&#xff1a;\u6d3b\u8dc3\u7ebf\u7a0b\u3001\u961f\u5217\u957f\u5ea6\u3001\u62d2\u7edd\u6b21\u6570<\/p>\n<\/li>\n<li>\n<p>Redis&#xff1a;slowlog\u3001bigkeys<\/p>\n<\/li>\n<li>\n<p>MQ&#xff1a;\u751f\u4ea7 TPS\u3001\u6d88\u8d39 TPS\u3001\u79ef\u538b\u91cf<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5148\u6b62\u635f<\/p>\n<ul>\n<li>\n<p>\u9650\u6d41<\/p>\n<\/li>\n<li>\n<p>\u964d\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u7194\u65ad<\/p>\n<\/li>\n<li>\n<p>\u6269\u5bb9<\/p>\n<\/li>\n<li>\n<p>\u56de\u6eda<\/p>\n<\/li>\n<li>\n<p>\u6458\u6d41\u91cf<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u518d\u957f\u671f\u4f18\u5316<\/p>\n<ul>\n<li>\n<p>\u4fee\u590d\u4ee3\u7801<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5316 SQL<\/p>\n<\/li>\n<li>\n<p>\u8c03\u6574 JVM<\/p>\n<\/li>\n<li>\n<p>\u589e\u52a0\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6c60\u9694\u79bb<\/p>\n<\/li>\n<li>\n<p>\u8865\u5145\u76d1\u63a7\u544a\u8b66<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u5584\u538b\u6d4b\u548c\u53d1\u5e03\u6d41\u7a0b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h2>\u9ad8\u9891\u5173\u952e\u8bcd<\/h2>\n<p>\u9762\u8bd5\u56de\u7b54\u65f6\u53ef\u4ee5\u81ea\u7136\u5e26\u4e0a\u8fd9\u4e9b\u5173\u952e\u8bcd&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5148\u770b\u76d1\u63a7&#xff0c;\u4e0d\u5148\u731c\u539f\u56e0<\/p>\n<\/li>\n<li>\n<p>\u5148\u5224\u65ad\u5f71\u54cd\u8303\u56f4<\/p>\n<\/li>\n<li>\n<p>\u6cbf\u8c03\u7528\u94fe\u62c6\u5206\u8017\u65f6<\/p>\n<\/li>\n<li>\n<p>\u5148\u6b62\u635f&#xff0c;\u518d\u5b9a\u4f4d\u6839\u56e0<\/p>\n<\/li>\n<li>\n<p>\u77ed\u671f\u6062\u590d\u670d\u52a1&#xff0c;\u957f\u671f\u6cbb\u7406\u95ee\u9898<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6808\u770b\u7ebf\u7a0b\u5361\u5728\u54ea\u91cc<\/p>\n<\/li>\n<li>\n<p>GC \u540e\u5185\u5b58\u964d\u4e0d\u4e0b\u6765&#xff0c;\u6000\u7591\u5185\u5b58\u6cc4\u6f0f<\/p>\n<\/li>\n<li>\n<p>\u6162 SQL \u5148\u770b\u6267\u884c\u8ba1\u5212<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u6c60\u6ee1\u901a\u5e38\u662f\u8fde\u63a5\u88ab\u5360\u7528\u592a\u4e45<\/p>\n<\/li>\n<li>\n<p>\u5206\u5e03\u5f0f\u9501\u4e0d\u80fd\u66ff\u4ee3\u4e1a\u52a1\u5e42\u7b49<\/p>\n<\/li>\n<li>\n<p>\u8d85\u65f6\u4e0d\u7b49\u4e8e\u5931\u8d25&#xff0c;\u8981\u67e5\u6700\u7ec8\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>MQ \u79ef\u538b\u672c\u8d28\u662f\u751f\u4ea7\u901f\u5ea6\u5927\u4e8e\u6d88\u8d39\u901f\u5ea6<\/p>\n<\/li>\n<li>\n<p>\u96ea\u5d29\u6cbb\u7406\u9760\u8d85\u65f6\u3001\u9650\u6d41\u3001\u7194\u65ad\u3001\u964d\u7ea7\u3001\u9694\u79bb<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2d\u9ad8\u7ea7 Java \u9879\u76ee\u573a\u666f\u9898&#xff1a;\u6392\u67e5\u4e0e\u89e3\u51b3\u65b9\u6848\u9002\u7528\u573a\u666f&#xff1a;\u4e2d\u9ad8\u7ea7 Java \u5f00\u53d1\u9762\u8bd5\u4e2d&#xff0c;\u9762\u8bd5\u5b98\u5e38\u95ee\u201c\u7ebf\u4e0a\u9047\u5230 CPU \u98d9\u9ad8\u3001\u63a5\u53e3\u53d8\u6162\u3001Full GC\u3001\u6162 SQL\u3001MQ \u79ef\u538b&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;\u201d \u56de\u7b54\u6838\u5fc3&#xff1a;\u4e0d\u8981\u4e00\u4e0a\u6765\u731c\u539f\u56e0&#xff0c;\u8981\u6309 \u73b0\u8c61\u786e\u8ba4 -&gt; \u5f71\u54cd\u8303\u56f4 -&gt; \u5206\u5c42\u6392\u67e5 -&gt; \u5b9a\u4f4d\u6839\u56e0 -&gt; \u4e34\u65f6\u6b62\u635f -&gt; \u957f\u671f\u4f18\u5316 \u6765\u8bb2\u3002\u573a\u666f\u9898\u5206\u7c7b\u76ee\u5f55\u4e00\u3001\u63a5\u53e3\u6027\u80fd\u4e0e\u670d\u52a1\u7a33\u5b9a\u6027\u7c7b&#xff1a;\u63a5\u53e3\u53d8\u6162\u3001<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10701,99],"topic":[],"class_list":["post-93661","post","type-post","status-publish","format-standard","hentry","category-server","tag-10701","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/93661.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e2d\u9ad8\u7ea7 Java \u9879\u76ee\u573a\u666f\u9898&#xff1a;\u6392\u67e5\u4e0e\u89e3\u51b3\u65b9\u6848\u9002\u7528\u573a\u666f&#xff1a;\u4e2d\u9ad8\u7ea7 Java \u5f00\u53d1\u9762\u8bd5\u4e2d&#xff0c;\u9762\u8bd5\u5b98\u5e38\u95ee\u201c\u7ebf\u4e0a\u9047\u5230 CPU \u98d9\u9ad8\u3001\u63a5\u53e3\u53d8\u6162\u3001Full GC\u3001\u6162 SQL\u3001MQ \u79ef\u538b&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;\u201d \u56de\u7b54\u6838\u5fc3&#xff1a;\u4e0d\u8981\u4e00\u4e0a\u6765\u731c\u539f\u56e0&#xff0c;\u8981\u6309 \u73b0\u8c61\u786e\u8ba4 -&gt; \u5f71\u54cd\u8303\u56f4 -&gt; \u5206\u5c42\u6392\u67e5 -&gt; \u5b9a\u4f4d\u6839\u56e0 -&gt; \u4e34\u65f6\u6b62\u635f -&gt; \u957f\u671f\u4f18\u5316 \u6765\u8bb2\u3002\u573a\u666f\u9898\u5206\u7c7b\u76ee\u5f55\u4e00\u3001\u63a5\u53e3\u6027\u80fd\u4e0e\u670d\u52a1\u7a33\u5b9a\u6027\u7c7b&#xff1a;\u63a5\u53e3\u53d8\u6162\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/93661.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-12T15:48:50+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93661.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/93661.html\",\"name\":\"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-12T15:48:50+00:00\",\"dateModified\":\"2026-08-12T15:48:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/93661.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/93661.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93661.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/93661.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e2d\u9ad8\u7ea7 Java \u9879\u76ee\u573a\u666f\u9898&#xff1a;\u6392\u67e5\u4e0e\u89e3\u51b3\u65b9\u6848\u9002\u7528\u573a\u666f&#xff1a;\u4e2d\u9ad8\u7ea7 Java \u5f00\u53d1\u9762\u8bd5\u4e2d&#xff0c;\u9762\u8bd5\u5b98\u5e38\u95ee\u201c\u7ebf\u4e0a\u9047\u5230 CPU \u98d9\u9ad8\u3001\u63a5\u53e3\u53d8\u6162\u3001Full GC\u3001\u6162 SQL\u3001MQ \u79ef\u538b&#xff0c;\u4f60\u600e\u4e48\u6392\u67e5&#xff1f;\u201d \u56de\u7b54\u6838\u5fc3&#xff1a;\u4e0d\u8981\u4e00\u4e0a\u6765\u731c\u539f\u56e0&#xff0c;\u8981\u6309 \u73b0\u8c61\u786e\u8ba4 -&gt; \u5f71\u54cd\u8303\u56f4 -&gt; \u5206\u5c42\u6392\u67e5 -&gt; \u5b9a\u4f4d\u6839\u56e0 -&gt; \u4e34\u65f6\u6b62\u635f -&gt; \u957f\u671f\u4f18\u5316 \u6765\u8bb2\u3002\u573a\u666f\u9898\u5206\u7c7b\u76ee\u5f55\u4e00\u3001\u63a5\u53e3\u6027\u80fd\u4e0e\u670d\u52a1\u7a33\u5b9a\u6027\u7c7b&#xff1a;\u63a5\u53e3\u53d8\u6162\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/93661.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-12T15:48:50+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"12 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/93661.html","url":"https:\/\/www.wsisp.com\/helps\/93661.html","name":"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-12T15:48:50+00:00","dateModified":"2026-08-12T15:48:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/93661.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/93661.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/93661.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9879\u76ee\u6392\u67e5\u7c7b\u573a\u666f\u6848\u4f8b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=93661"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93661\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=93661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=93661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=93661"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=93661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}