{"id":5065,"date":"2021-12-16T20:28:00","date_gmt":"2021-12-17T04:28:00","guid":{"rendered":"https:\/\/www.xh86.me\/?p=5065"},"modified":"2021-12-18T17:53:07","modified_gmt":"2021-12-19T01:53:07","slug":"%e8%b6%85%e8%af%a6%e7%bb%86%e7%9a%84%e7%a7%92%e6%9d%80%e6%9e%b6%e6%9e%84%e8%ae%be%e8%ae%a1%ef%bc%8c%e8%bf%90%e7%bb%b4%ef%bc%8c%e4%ba%86%e8%a7%a3%e4%b8%80%e4%b8%8b","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=5065","title":{"rendered":"\u8d85\u8be6\u7ec6\u7684\u79d2\u6740\u67b6\u6784\u8bbe\u8ba1\uff0c\u8fd0\u7ef4\uff0c\u4e86\u89e3\u4e00\u4e0b"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<blockquote class=\"js_blockquote_wrap\" data-type=\"2\" data-url=\"\" data-author-name=\"\" data-content-utf8-length=\"58\" data-source-title=\"\" data-mpa-powered-by=\"yiban.io\">\n<section class=\"js_blockquote_digest\">\n<section>\n<p style=\"text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u7cfb\u7edf\u76f8\u4fe1\u5f88\u591a\u4eba\u89c1\u8fc7\uff0c\u6bd4\u5982\u4eac\u4e1c\u6216\u8005\u6dd8\u5b9d\u7684\u79d2\u6740\uff0c\u5c0f\u7c73\u624b\u673a\u7684\u79d2\u6740\uff0c\u90a3\u4e48\u79d2\u6740\u7cfb\u7edf\u7684\u540e\u53f0\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u5462\uff1f\u6211\u4eec\u5982\u4f55\u8bbe\u8ba1\u4e00\u4e2a\u79d2\u6740\u7cfb\u7edf\u5462\uff1f\u5bf9\u4e8e\u79d2\u6740\u7cfb\u7edf\u5e94\u8be5\u8003\u8651\u54ea\u4e9b\u95ee\u9898\uff1f\u5982\u4f55\u8bbe\u8ba1\u51fa\u5065\u58ee\u7684\u79d2\u6740\u7cfb\u7edf\uff1f\u672c\u6587\u6211\u4eec\u5c31\u6765\u63a2\u8ba8\u4e00\u4e0b\u8fd9\u4e2a\u95ee\u9898\u3002<\/span><\/p>\n<\/section>\n<\/section>\n<\/blockquote>\n<h3 style=\"margin-top: 1.5em; margin-right: 5px; margin-bottom: 2em; padding: 8px 15px; font-weight: bold; font-size: 1.3em; color: #ffffff; line-height: inherit; letter-spacing: 2px; background-image: linear-gradient(to right bottom, #00bcd4, #3f51b5); background-color: #3f51b5; border-left: 10px solid #333333; border-radius: 5px; text-shadow: #666666 1px 1px 1px; box-shadow: #666666 1px 1px 2px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; text-align: start; white-space: normal;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u79d2\u6740\u5e94\u8be5\u8003\u8651\u54ea\u4e9b\u95ee\u9898<\/span><\/h3>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u8d85\u5356\u95ee\u9898<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5206\u6790\u79d2\u6740\u7684\u4e1a\u52a1\u573a\u666f,\u6700\u91cd\u8981\u7684\u6709\u4e00\u70b9\u5c31\u662f\u8d85\u5356\u95ee\u9898\uff0c\u5047\u5982\u5907\u8d27\u53ea\u6709100\u4e2a\uff0c\u4f46\u662f\u6700\u7ec8\u8d85\u5356\u4e86200\uff0c\u4e00\u822c\u6765\u8bb2\u79d2\u6740\u7cfb\u7edf\u7684\u4ef7\u683c\u90fd\u6bd4\u8f83\u4f4e\uff0c\u5982\u679c\u8d85\u5356\u5c06\u4e25\u91cd\u5f71\u54cd\u516c\u53f8\u7684\u8d22\u4ea7\u5229\u76ca\uff0c\u56e0\u6b64\u9996\u5f53\u5176\u51b2\u7684\u5c31\u662f\u89e3\u51b3\u5546\u54c1\u7684\u8d85\u5356\u95ee\u9898\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u9ad8\u5e76\u53d1<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u5177\u6709\u65f6\u95f4\u77ed\u3001\u5e76\u53d1\u91cf\u5927\u7684\u7279\u70b9\uff0c\u79d2\u6740\u6301\u7eed\u65f6\u95f4\u53ea\u6709\u51e0\u5206\u949f\uff0c\u800c\u4e00\u822c\u516c\u53f8\u90fd\u4e3a\u4e86\u5236\u9020\u8f70\u52a8\u6548\u5e94\uff0c\u4f1a\u4ee5\u6781\u4f4e\u7684\u4ef7\u683c\u6765\u5438\u5f15\u7528\u6237\uff0c\u56e0\u6b64\u53c2\u4e0e\u62a2\u8d2d\u7684\u7528\u6237\u4f1a\u975e\u5e38\u7684\u591a\u3002\u77ed\u65f6\u95f4\u5185\u4f1a\u6709\u5927\u91cf\u8bf7\u6c42\u6d8c\u8fdb\u6765\uff0c\u540e\u7aef\u5982\u4f55\u9632\u6b62\u5e76\u53d1\u8fc7\u9ad8\u9020\u6210\u7f13\u5b58\u51fb\u7a7f\u6216\u8005\u5931\u6548\uff0c\u51fb\u57ae\u6570\u636e\u5e93\u90fd\u662f\u9700\u8981\u8003\u8651\u7684\u95ee\u9898\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u63a5\u53e3\u9632\u5237<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u73b0\u5728\u7684\u79d2\u6740\u5927\u591a\u90fd\u4f1a\u51fa\u6765\u9488\u5bf9\u79d2\u6740\u5bf9\u5e94\u7684\u8f6f\u4ef6\uff0c\u8fd9\u7c7b\u8f6f\u4ef6\u4f1a\u6a21\u62df\u4e0d\u65ad\u5411\u540e\u53f0\u670d\u52a1\u5668\u53d1\u8d77\u8bf7\u6c42\uff0c\u4e00\u79d2\u51e0\u767e\u6b21\u90fd\u662f\u5f88\u5e38\u89c1\u7684\uff0c\u5982\u4f55\u9632\u6b62\u8fd9\u7c7b\u8f6f\u4ef6\u7684\u91cd\u590d\u65e0\u6548\u8bf7\u6c42\uff0c\u9632\u6b62\u4e0d\u65ad\u53d1\u8d77\u7684\u8bf7\u6c42\u4e5f\u662f\u9700\u8981\u6211\u4eec\u9488\u5bf9\u6027\u8003\u8651\u7684\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u79d2\u6740 URL<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5bf9\u4e8e\u666e\u901a\u7528\u6237\u6765\u8bb2\uff0c\u770b\u5230\u7684\u53ea\u662f\u4e00\u4e2a\u6bd4\u8f83\u7b80\u5355\u7684\u79d2\u6740\u9875\u9762\uff0c\u5728\u672a\u8fbe\u5230\u89c4\u5b9a\u65f6\u95f4\uff0c\u79d2\u6740\u6309\u94ae\u662f\u7070\u8272\u7684\uff0c\u4e00\u65e6\u5230\u8fbe\u89c4\u5b9a\u65f6\u95f4\uff0c\u7070\u8272\u6309\u94ae\u53d8\u6210\u53ef\u70b9\u51fb\u72b6\u6001\u3002\u8fd9\u90e8\u5206\u662f\u9488\u5bf9\u5c0f\u767d\u7528\u6237\u7684\uff0c\u5982\u679c\u662f\u7a0d\u5fae\u6709\u70b9\u7535\u8111\u529f\u5e95\u7684\u7528\u6237\uff0c\u4f1a\u901a\u8fc7F12\u770b\u6d4f\u89c8\u5668\u7684network\u770b\u5230\u79d2\u6740\u7684url\uff0c\u901a\u8fc7\u7279\u5b9a\u8f6f\u4ef6\u53bb\u8bf7\u6c42\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u79d2\u6740\u3002\u6216\u8005\u63d0\u524d\u77e5\u9053\u79d2\u6740url\u7684\u4eba\uff0c\u4e00\u8bf7\u6c42\u5c31\u76f4\u63a5\u5b9e\u73b0\u79d2\u6740\u4e86\u3002\u8fd9\u4e2a\u95ee\u9898\u6211\u4eec\u9700\u8981\u8003\u8651\u89e3\u51b3\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u6570\u636e\u5e93\u8bbe\u8ba1<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u6709\u628a\u6211\u4eec\u670d\u52a1\u5668\u51fb\u57ae\u7684\u98ce\u9669\uff0c\u5982\u679c\u8ba9\u5b83\u4e0e\u6211\u4eec\u7684\u5176\u4ed6\u4e1a\u52a1\u4f7f\u7528\u5728\u540c\u4e00\u4e2a\u6570\u636e\u5e93\u4e2d\uff0c\u8026\u5408\u5728\u4e00\u8d77\uff0c\u5c31\u5f88\u6709\u53ef\u80fd\u7275\u8fde\u548c\u5f71\u54cd\u5176\u4ed6\u7684\u4e1a\u52a1\u3002\u5982\u4f55\u9632\u6b62\u8fd9\u7c7b\u95ee\u9898\u53d1\u751f\uff0c\u5c31\u7b97\u79d2\u6740\u53d1\u751f\u4e86\u5b95\u673a\u3001\u670d\u52a1\u5668\u5361\u6b7b\u95ee\u9898\uff0c\u4e5f\u5e94\u8be5\u8ba9\u4ed6\u5c3d\u91cf\u4e0d\u5f71\u54cd\u7ebf\u4e0a\u6b63\u5e38\u8fdb\u884c\u7684\u4e1a\u52a1\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u5927\u91cf\u8bf7\u6c42\u95ee\u9898<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u6309\u7167\u300c\u9ad8\u5e76\u53d1\u300d\u7684\u8003\u8651\uff0c\u5c31\u7b97\u4f7f\u7528\u7f13\u5b58\u8fd8\u662f\u4e0d\u8db3\u4ee5\u5e94\u5bf9\u77ed\u65f6\u95f4\u7684\u9ad8\u5e76\u53d1\u7684\u6d41\u91cf\u7684\u51b2\u51fb\u3002\u5982\u4f55\u627f\u8f7d\u8fd9\u6837\u5de8\u5927\u7684\u8bbf\u95ee\u91cf\uff0c\u540c\u65f6\u63d0\u4f9b\u7a33\u5b9a\u4f4e\u65f6\u5ef6\u7684\u670d\u52a1\u4fdd\u8bc1\uff0c\u662f\u9700\u8981\u9762\u5bf9\u7684\u4e00\u5927\u6311\u6218\u3002\u6211\u4eec\u6765\u7b97\u4e00\u7b14\u8d26\uff0c\u5047\u5982\u4f7f\u7528\u7684\u662f Redis \u7f13\u5b58\uff0c\u5355\u53f0 Redis \u670d\u52a1\u5668\u53ef\u627f\u53d7\u7684 QPS \u5927\u6982\u662f 4W \u5de6\u53f3\uff0c\u5982\u679c\u4e00\u4e2a\u79d2\u6740\u5438\u5f15\u7684\u7528\u6237\u91cf\u8db3\u591f\u591a\u7684\u8bdd\uff0c\u5355 QPS \u53ef\u80fd\u8fbe\u5230\u51e0\u5341\u4e07\uff0c\u5355\u4f53 Redis \u8fd8\u662f\u4e0d\u8db3\u4ee5\u652f\u6491\u5982\u6b64\u5de8\u5927\u7684\u8bf7\u6c42\u91cf\u3002\u7f13\u5b58\u4f1a\u88ab\u51fb\u7a7f\uff0c\u76f4\u63a5\u6e17\u900f\u5230 DB\uff0c\u4ece\u800c\u51fb\u57aeMySQL\uff0c\u540e\u53f0\u4f1a\u5c06\u4f1a\u5927\u91cf\u62a5\u9519\u3002<\/span><\/section>\n<h3 style=\"margin-top: 1.5em; margin-right: 5px; margin-bottom: 2em; padding: 8px 15px; font-weight: bold; font-size: 1.3em; color: #ffffff; line-height: inherit; letter-spacing: 2px; background-image: linear-gradient(to right bottom, #00bcd4, #3f51b5); background-color: #3f51b5; border-left: 10px solid #333333; border-radius: 5px; text-shadow: #666666 1px 1px 1px; box-shadow: #666666 1px 1px 2px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; text-align: start; white-space: normal;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u79d2\u6740\u7cfb\u7edf\u7684\u8bbe\u8ba1\u548c\u6280\u672f\u65b9\u6848<\/span><\/h3>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u79d2\u6740\u7cfb\u7edf\u6570\u636e\u5e93\u8bbe\u8ba1<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u9488\u5bf9\u300c\u6570\u636e\u5e93\u8bbe\u8ba1\u300d\u63d0\u51fa\u7684\u79d2\u6740\u6570\u636e\u5e93\u7684\u95ee\u9898\uff0c\u56e0\u6b64\u5e94\u8be5\u5355\u72ec\u8bbe\u8ba1\u4e00\u4e2a\u79d2\u6740\u6570\u636e\u5e93\uff0c\u9632\u6b62\u56e0\u4e3a\u79d2\u6740\u6d3b\u52a8\u7684\u9ad8\u5e76\u53d1\u8bbf\u95ee\u62d6\u57ae\u6574\u4e2a\u7f51\u7ad9\u3002\u8fd9\u91cc\u53ea\u9700\u8981\u4e24\u5f20\u8868\uff0c\u4e00\u5f20\u662f\u79d2\u6740\u8ba2\u5355\u8868\uff0c\u4e00\u5f20\u662f\u79d2\u6740\u8d27\u54c1\u8868\u3002<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: center;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-cb2dfca121797736fd18bd1d6108c657.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-cb2dfca121797736fd18bd1d6108c657.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.08425925925925926\" data-type=\"png\" data-w=\"1080\" \/><\/div><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5176\u5b9e\u5e94\u8be5\u8fd8\u6709\u51e0\u5f20\u8868\uff0c\u5546\u54c1\u8868\uff1a\u53ef\u4ee5\u5173\u8054goods_id\u67e5\u5230\u5177\u4f53\u7684\u5546\u54c1\u4fe1\u606f\uff0c\u5546\u54c1\u56fe\u50cf\u3001\u540d\u79f0\u3001\u5e73\u65f6\u4ef7\u683c\u3001\u79d2\u6740\u4ef7\u683c\u7b49\uff0c\u8fd8\u6709\u7528\u6237\u8868\uff1a\u6839\u636e\u7528\u6237user_id\u53ef\u4ee5\u67e5\u8be2\u5230\u7528\u6237\u6635\u79f0\u3001\u7528\u6237\u624b\u673a\u53f7\uff0c\u6536\u8d27\u5730\u5740\u7b49\u5176\u4ed6\u989d\u5916\u4fe1\u606f\uff0c\u8fd9\u4e2a\u5177\u4f53\u5c31\u4e0d\u7ed9\u51fa\u5b9e\u4f8b\u4e86\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u79d2\u6740 URL \u7684\u8bbe\u8ba1<\/span><\/h4>\n<p style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u4e3a\u4e86\u907f\u514d\u6709\u7a0b\u5e8f\u8bbf\u95ee\u7ecf\u9a8c\u7684\u4eba\u901a\u8fc7\u4e0b\u5355\u9875\u9762url\u76f4\u63a5\u8bbf\u95ee\u540e\u53f0\u63a5\u53e3\u6765\u79d2\u6740\u8d27\u54c1\uff0c\u6211\u4eec\u9700\u8981\u5c06\u79d2\u6740\u7684 URL \u5b9e\u73b0\u52a8\u6001\u5316\uff0c\u5373\u4f7f\u662f\u5f00\u53d1\u6574\u4e2a\u7cfb\u7edf\u7684\u4eba\u90fd\u65e0\u6cd5\u5728\u79d2\u6740\u5f00\u59cb\u524d\u77e5\u9053\u79d2\u6740\u7684URL \u3002\u5177\u4f53\u7684\u505a\u6cd5\u5c31\u662f\u901a\u8fc7 md5 \u52a0\u5bc6\u4e00\u4e32\u968f\u673a\u5b57\u7b26\u4f5c\u4e3a\u79d2\u6740\u7684 URL\uff0c\u7136\u540e\u524d\u7aef\u8bbf\u95ee\u540e\u53f0\u83b7\u53d6\u5177\u4f53\u7684 URL\uff0c\u540e\u53f0\u6821\u9a8c\u901a\u8fc7\u4e4b\u540e\u624d\u53ef\u4ee5\u7ee7\u7eed\u79d2\u6740\u3002<\/span><\/p>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u79d2\u6740\u9875\u9762\u9759\u6001\u5316<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5c06\u5546\u54c1\u7684\u63cf\u8ff0\u3001\u53c2\u6570\u3001\u6210\u4ea4\u8bb0\u5f55\u3001\u56fe\u50cf\u3001\u8bc4\u4ef7\u7b49\u5168\u90e8\u5199\u5165\u5230\u4e00\u4e2a\u9759\u6001\u9875\u9762\uff0c\u7528\u6237\u8bf7\u6c42\u4e0d\u9700\u8981\u901a\u8fc7\u8bbf\u95ee\u540e\u7aef\u670d\u52a1\u5668\uff0c\u4e0d\u9700\u8981\u7ecf\u8fc7\u6570\u636e\u5e93\uff0c\u76f4\u63a5\u5728\u524d\u53f0\u5ba2\u6237\u7aef\u751f\u6210\uff0c\u8fd9\u6837\u53ef\u4ee5\u6700\u5927\u53ef\u80fd\u7684\u51cf\u5c11\u670d\u52a1\u5668\u7684\u538b\u529b\u3002\u5177\u4f53\u7684\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528freemarker\u6a21\u677f\u6280\u672f\uff0c\u5efa\u7acb\u7f51\u9875\u6a21\u677f\uff0c\u586b\u5145\u6570\u636e\uff0c\u7136\u540e\u6e32\u67d3\u7f51\u9875\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u5355\u4f53 Redis \u5347\u7ea7\u4e3a\u96c6\u7fa4 Redis<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u662f\u4e00\u4e2a\u8bfb\u591a\u5199\u5c11\u7684\u573a\u666f\uff0c\u4f7f\u7528 Redis \u505a\u7f13\u5b58\u518d\u5408\u9002\u4e0d\u8fc7\u3002\u4e0d\u8fc7\u8003\u8651\u5230\u7f13\u5b58\u51fb\u7a7f\u95ee\u9898\uff0c\u6211\u4eec\u5e94\u8be5\u6784\u5efa Redis \u96c6\u7fa4\uff0c\u91c7\u7528\u54e8\u5175\u6a21\u5f0f\uff0c\u53ef\u4ee5\u63d0\u5347Redis\u7684\u6027\u80fd\u548c\u53ef\u7528\u6027\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u4f7f\u7528 Nginx<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">Nginx \u662f\u4e00\u4e2a\u9ad8\u6027\u80fd Web \u670d\u52a1\u5668\uff0c\u5b83\u7684\u5e76\u53d1\u80fd\u529b\u53ef\u4ee5\u8fbe\u5230\u51e0\u4e07\uff0c\u800c Tomcat \u53ea\u6709\u51e0\u767e\u3002\u901a\u8fc7 Nginx \u6620\u5c04\u5ba2\u6237\u7aef\u8bf7\u6c42\uff0c\u518d\u5206\u53d1\u5230\u540e\u53f0 Tomcat \u670d\u52a1\u5668\u96c6\u7fa4\u4e2d\u53ef\u4ee5\u5927\u5927\u63d0\u5347\u5e76\u53d1\u80fd\u529b\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u7cbe\u7b80 SQL<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5178\u578b\u7684\u4e00\u4e2a\u573a\u666f\u662f\u5728\u8fdb\u884c\u6263\u51cf\u5e93\u5b58\u7684\u65f6\u5019\uff0c\u4f20\u7edf\u7684\u505a\u6cd5\u662f\u5148\u67e5\u8be2\u5e93\u5b58\uff0c\u518d\u53bbupdate\u3002\u8fd9\u6837\u7684\u8bdd\u9700\u8981\u4e24\u4e2aSQL\uff0c\u800c\u5b9e\u9645\u4e0a\u4e00\u4e2aSQL\u6211\u4eec\u5c31\u53ef\u4ee5\u5b8c\u6210\u7684\u3002\u53ef\u4ee5\u7528\u8fd9\u6837\u7684\u505a\u6cd5\uff1aupdate miaosha_goods set stock =stock-1 where goos_id ={#goods_id} and version = #{version} and sock&gt;0;\u8fd9\u6837\u7684\u8bdd\uff0c\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u5e93\u5b58\u4e0d\u4f1a\u8d85\u5356\u5e76\u4e14\u4e00\u6b21\u66f4\u65b0\u5e93\u5b58\uff0c\u8fd8\u6709\u6ce8\u610f\u4e00\u70b9\u8fd9\u91cc\u4f7f\u7528\u4e86\u7248\u672c\u53f7\u7684\u4e50\u89c2\u9501\uff0c\u76f8\u6bd4\u8f83\u60b2\u89c2\u9501\uff0c\u5b83\u7684\u6027\u80fd\u8f83\u597d\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">Redis \u9884\u51cf\u5e93\u5b58<\/span><\/h4>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5f88\u591a\u8bf7\u6c42\u8fdb\u6765\uff0c\u90fd\u9700\u8981\u540e\u53f0\u67e5\u8be2\u5e93\u5b58,\u8fd9\u662f\u4e00\u4e2a\u9891\u7e41\u8bfb\u7684\u573a\u666f\u3002\u53ef\u4ee5\u4f7f\u7528Redis\u6765\u9884\u51cf\u5e93\u5b58\uff0c\u5728\u79d2\u6740\u5f00\u59cb\u524d\u53ef\u4ee5\u5728 Redis \u8bbe\u503c\uff0c\u6bd4\u5982 redis.set(goodsId,100)\uff0c\u8fd9\u91cc\u9884\u653e\u7684\u5e93\u5b58\u4e3a100\u53ef\u4ee5\u8bbe\u503c\u4e3a\u5e38\u91cf\uff0c\u6bcf\u6b21\u4e0b\u5355\u6210\u529f\u4e4b\u540e\uff0cInteger stock = (Integer)redis.get(goosId); \u7136\u540e\u5224\u65ad sock \u7684\u503c\uff0c\u5982\u679c\u5c0f\u4e8e\u5e38\u91cf\u503c\u5c31\u51cf\u53bb1\uff1b\u4e0d\u8fc7\u6ce8\u610f\u5f53\u53d6\u6d88\u7684\u65f6\u5019\uff0c\u9700\u8981\u589e\u52a0\u5e93\u5b58\uff0c\u589e\u52a0\u5e93\u5b58\u7684\u65f6\u5019\u4e5f\u5f97\u6ce8\u610f\u4e0d\u80fd\u5927\u4e8e\u4e4b\u95f4\u8bbe\u5b9a\u7684\u603b\u5e93\u5b58\u6570\uff08\u67e5\u8be2\u5e93\u5b58\u548c\u6263\u51cf\u5e93\u5b58\u9700\u8981\u539f\u5b50\u64cd\u4f5c\uff0c\u6b64\u65f6\u53ef\u4ee5\u501f\u52a9 lua \u811a\u672c\uff09\u4e0b\u6b21\u4e0b\u5355\u518d\u83b7\u53d6\u5e93\u5b58\u7684\u65f6\u5019\uff0c\u76f4\u63a5\u4eceRedis\u91cc\u9762\u67e5\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/section>\n<h4 style=\"margin: 1.3em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.2em; line-height: 1.75em; text-align: left;\"><span style=\"font-size: 16px; color: #ab1942;\">\u63a5\u53e3\u9650\u6d41<\/span><\/h4>\n<p style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u6700\u7ec8\u7684\u672c\u8d28\u662f\u6570\u636e\u5e93\u7684\u66f4\u65b0\uff0c\u4f46\u662f\u6709\u5f88\u591a\u5927\u91cf\u65e0\u6548\u7684\u8bf7\u6c42\uff0c\u6211\u4eec\u6700\u7ec8\u8981\u505a\u7684\u5c31\u662f\u5982\u4f55\u628a\u8fd9\u4e9b\u65e0\u6548\u7684\u8bf7\u6c42\u8fc7\u6ee4\u6389\uff0c\u9632\u6b62\u6e17\u900f\u5230\u6570\u636e\u5e93\u3002\u9650\u6d41\u7684\u8bdd\uff0c\u9700\u8981\u5165\u624b\u7684\u65b9\u9762\u5f88\u591a\uff1a<\/span><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\"><strong>\u524d\u7aef\u9650\u6d41<\/strong><\/span><\/section>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u9996\u5148\u7b2c\u4e00\u6b65\u5c31\u662f\u901a\u8fc7\u524d\u7aef\u9650\u6d41\uff0c\u7528\u6237\u5728\u79d2\u6740\u6309\u94ae\u70b9\u51fb\u4ee5\u540e\u53d1\u8d77\u8bf7\u6c42\uff0c\u90a3\u4e48\u5728\u63a5\u4e0b\u6765\u76845\u79d2\u662f\u65e0\u6cd5\u70b9\u51fb\uff08\u901a\u8fc7\u8bbe\u7f6e\u6309\u94ae\u4e3adisable\uff09\u3002\u8fd9\u4e00\u5c0f\u4e3e\u63aa\u5f00\u53d1\u8d77\u6765\u6210\u672c\u5f88\u5c0f\uff0c\u4f46\u662f\u5f88\u6709\u6548\u3002<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\"><strong>\u540c\u4e00\u4e2a\u7528\u6237xx\u79d2\u5185\u91cd\u590d\u8bf7\u6c42\u76f4\u63a5\u62d2\u7edd<\/strong><\/span><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5177\u4f53\u591a\u5c11\u79d2\u9700\u8981\u6839\u636e\u5b9e\u9645\u4e1a\u52a1\u548c\u79d2\u6740\u7684\u4eba\u6570\u800c\u5b9a\uff0c\u4e00\u822c\u9650\u5b9a\u4e3a10\u79d2\u3002\u5177\u4f53\u7684\u505a\u6cd5\u5c31\u662f\u901a\u8fc7Redis\u7684\u952e\u8fc7\u671f\u7b56\u7565\uff0c\u9996\u5148\u5bf9\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u4ece String value = redis.get(userId)\uff1b\u5982\u679c\u83b7\u53d6\u5230\u8fd9\u4e2a value \u4e3a\u7a7a\u6216\u8005\u4e3a null\uff0c\u8868\u793a\u5b83\u662f\u6709\u6548\u7684\u8bf7\u6c42\uff0c\u7136\u540e\u653e\u884c\u8fd9\u4e2a\u8bf7\u6c42\u3002\u5982\u679c\u4e0d\u4e3a\u7a7a\u8868\u793a\u5b83\u662f\u91cd\u590d\u6027\u8bf7\u6c42\uff0c\u76f4\u63a5\u4e22\u6389\u8fd9\u4e2a\u8bf7\u6c42\u3002\u5982\u679c\u6709\u6548\uff0c\u91c7\u7528redis.setexpire(userId,value,10).value \u53ef\u4ee5\u662f\u4efb\u610f\u503c\uff0c\u4e00\u822c\u653e\u4e1a\u52a1\u5c5e\u6027\u6bd4\u8f83\u597d\uff0c\u8fd9\u4e2a\u662f\u8bbe\u7f6e\u4ee5 userId \u4e3a key\uff0c10\u79d2\u7684\u8fc7\u671f\u65f6\u95f4\uff0810\u79d2\u540e\uff0ckey\u5bf9\u5e94\u7684\u503c\u81ea\u52a8\u4e3anull\uff09\u3002<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\"><strong>\u4ee4\u724c\u6876\u7b97\u6cd5\u9650\u6d41<\/strong><\/span><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u63a5\u53e3\u9650\u6d41\u7684\u7b56\u7565\u6709\u5f88\u591a\uff0c\u6211\u4eec\u8fd9\u91cc\u91c7\u7528\u4ee4\u724c\u6876\u7b97\u6cd5\u3002\u4ee4\u724c\u6876\u7b97\u6cd5\u7684\u57fa\u672c\u601d\u8def\u662f\u6bcf\u4e2a\u8bf7\u6c42\u5c1d\u8bd5\u83b7\u53d6\u4e00\u4e2a\u4ee4\u724c\uff0c\u540e\u7aef\u53ea\u5904\u7406\u6301\u6709\u4ee4\u724c\u7684\u8bf7\u6c42\uff0c\u751f\u4ea7\u4ee4\u724c\u7684\u901f\u5ea6\u548c\u6548\u7387\u6211\u4eec\u90fd\u53ef\u4ee5\u81ea\u5df1\u9650\u5b9a\uff0cGuava \u63d0\u4f9b\u4e86 RateLimter \u7684 API \u4f9b\u6211\u4eec\u4f7f\u7528\u3002\u4ee5\u4e0b\u505a\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u6ce8\u610f\u9700\u8981\u5f15\u5165Guava\uff1a<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\">public class TestRateLimiter {<\/span><\/code><code>\r\n<\/code><code><span class=\"code-snippet_outer\">    public static void main(String[] args) {<\/span><\/code><code><span class=\"code-snippet_outer\">        \/\/1\u79d2\u4ea7\u751f1\u4e2a\u4ee4\u724c<\/span><\/code><code><span class=\"code-snippet_outer\">        final RateLimiter rateLimiter = RateLimiter.create(1);<\/span><\/code><code><span class=\"code-snippet_outer\">        for (int i = 0; i &lt; 10; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">            \/\/\u8be5\u65b9\u6cd5\u4f1a\u963b\u585e\u7ebf\u7a0b\uff0c\u76f4\u5230\u4ee4\u724c\u6876\u4e2d\u80fd\u53d6\u5230\u4ee4\u724c\u4e3a\u6b62\u624d\u7ee7\u7eed\u5411\u4e0b\u6267\u884c\u3002<\/span><\/code><code><span class=\"code-snippet_outer\">            double waitTime= rateLimiter.acquire();<\/span><\/code><code><span class=\"code-snippet_outer\">            System.out.println(\"\u4efb\u52a1\u6267\u884c\" + i + \"\u7b49\u5f85\u65f6\u95f4\" + waitTime);<\/span><\/code><code><span class=\"code-snippet_outer\">        }<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(\"\u6267\u884c\u7ed3\u675f\");<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u4e0a\u9762\u4ee3\u7801\u7684\u601d\u8def\u5c31\u662f\u901a\u8fc7RateLimiter\u6765\u9650\u5b9a\u6211\u4eec\u7684\u4ee4\u724c\u6876\u6bcf\u79d2\u4ea7\u751f1\u4e2a\u4ee4\u724c\uff08\u751f\u4ea7\u7684\u6548\u7387\u6bd4\u8f83\u4f4e\uff09\uff0c\u5faa\u73af10\u6b21\u53bb\u6267\u884c\u4efb\u52a1\u3002acquire\u4f1a\u963b\u585e\u5f53\u524d\u7ebf\u7a0b\u76f4\u5230\u83b7\u53d6\u5230\u4ee4\u724c\uff0c\u4e5f\u5c31\u662f\u5982\u679c\u4efb\u52a1\u6ca1\u6709\u83b7\u53d6\u5230\u4ee4\u724c\uff0c\u4f1a\u4e00\u76f4\u7b49\u5f85\u3002\u90a3\u4e48\u8bf7\u6c42\u5c31\u4f1a\u5361\u5728\u6211\u4eec\u9650\u5b9a\u7684\u65f6\u95f4\u5185\u624d\u53ef\u4ee5\u7ee7\u7eed\u5f80\u4e0b\u8d70\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u8fd4\u56de\u7684\u662f\u7ebf\u7a0b\u5177\u4f53\u7b49\u5f85\u7684\u65f6\u95f4\u3002\u6267\u884c\u5982\u4e0b\uff1a<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: left;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-ccca5430b93ba61e9facd92dcaa286cb.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-ccca5430b93ba61e9facd92dcaa286cb.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.34843205574912894\" data-type=\"png\" data-w=\"574\" \/><\/div><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u53ef\u4ee5\u770b\u5230\u4efb\u52a1\u6267\u884c\u7684\u8fc7\u7a0b\u4e2d\uff0c\u7b2c1\u4e2a\u662f\u65e0\u9700\u7b49\u5f85\u7684\uff0c\u56e0\u4e3a\u5df2\u7ecf\u5728\u5f00\u59cb\u7684\u7b2c1\u79d2\u751f\u4ea7\u51fa\u4e86\u4ee4\u724c\u3002\u63a5\u4e0b\u6765\u7684\u4efb\u52a1\u8bf7\u6c42\u5c31\u5fc5\u987b\u7b49\u5230\u4ee4\u724c\u6876\u4ea7\u751f\u4e86\u4ee4\u724c\u624d\u53ef\u4ee5\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c\u3002\u5982\u679c\u6ca1\u6709\u83b7\u53d6\u5230\u5c31\u4f1a\u963b\u585e\uff08\u6709\u4e00\u4e2a\u505c\u987f\u7684\u8fc7\u7a0b\uff09\u3002\u4e0d\u8fc7\u8fd9\u4e2a\u65b9\u5f0f\u4e0d\u592a\u597d\uff0c\u56e0\u4e3a\u7528\u6237\u5982\u679c\u5728\u5ba2\u6237\u7aef\u8bf7\u6c42\uff0c\u5982\u679c\u8f83\u591a\u7684\u8bdd\uff0c\u76f4\u63a5\u540e\u53f0\u5728\u751f\u4ea7token\u5c31\u4f1a\u5361\u987f\uff08\u7528\u6237\u4f53\u9a8c\u8f83\u5dee\uff09\uff0c\u5b83\u662f\u4e0d\u4f1a\u629b\u5f03\u4efb\u52a1\u7684\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u66f4\u4f18\u79c0\u7684\u7b56\u7565\uff1a\u5982\u679c\u8d85\u8fc7\u67d0\u4e2a\u65f6\u95f4\u6ca1\u6709\u83b7\u53d6\u5230\uff0c\u76f4\u63a5\u62d2\u7edd\u8be5\u4efb\u52a1\u3002\u63a5\u4e0b\u6765\u518d\u6765\u4e2a\u6848\u4f8b\uff1a<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\">public class TestRateLimiter2 {<\/span><\/code><code>\r\n<\/code><code><span class=\"code-snippet_outer\">    public static void main(String[] args) {<\/span><\/code><code><span class=\"code-snippet_outer\">        final RateLimiter rateLimiter = RateLimiter.create(1);<\/span><\/code><code>\r\n<\/code><code><span class=\"code-snippet_outer\">        for (int i = 0; i &lt; 10; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">            long timeOut = (long) 0.5;<\/span><\/code><code><span class=\"code-snippet_outer\">            boolean isValid = rateLimiter.tryAcquire(timeOut, TimeUnit.SECONDS);<\/span><\/code><code><span class=\"code-snippet_outer\">            System.out.println(\"\u4efb\u52a1\" + i + \"\u6267\u884c\u662f\u5426\u6709\u6548:\" + isValid);<\/span><\/code><code><span class=\"code-snippet_outer\">            if (!isValid) {<\/span><\/code><code><span class=\"code-snippet_outer\">                continue;<\/span><\/code><code><span class=\"code-snippet_outer\">            }<\/span><\/code><code><span class=\"code-snippet_outer\">            System.out.println(\"\u4efb\u52a1\" + i + \"\u5728\u6267\u884c\");<\/span><\/code><code><span class=\"code-snippet_outer\">        }<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(\"\u7ed3\u675f\");<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5176\u4e2d\u7528\u5230\u4e86tryAcquire\u65b9\u6cd5\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u8bbe\u5b9a\u4e00\u4e2a\u8d85\u65f6\u7684\u65f6\u95f4\uff0c\u5982\u679c\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u5185\u9884\u4f30\uff08\u6ce8\u610f\u662f\u9884\u4f30\u5e76\u4e0d\u4f1a\u771f\u5b9e\u7684\u7b49\u5f85\uff09\uff0c\u5982\u679c\u80fd\u62ff\u5230\u4ee4\u724c\u5c31\u8fd4\u56detrue\uff0c\u5982\u679c\u62ff\u4e0d\u5230\u5c31\u8fd4\u56defalse\u3002\u7136\u540e\u6211\u4eec\u8ba9\u65e0\u6548\u7684\u76f4\u63a5\u8df3\u8fc7\uff0c\u8fd9\u91cc\u8bbe\u5b9a\u6bcf\u79d2\u751f\u4ea71\u4e2a\u4ee4\u724c\uff0c\u8ba9\u6bcf\u4e2a\u4efb\u52a1\u5c1d\u8bd5\u57280.5\u79d2\u83b7\u53d6\u4ee4\u724c\uff0c\u5982\u679c\u83b7\u53d6\u4e0d\u5230\uff0c\u5c31\u76f4\u63a5\u8df3\u8fc7\u8fd9\u4e2a\u4efb\u52a1\uff08\u653e\u5728\u79d2\u6740\u73af\u5883\u91cc\u5c31\u662f\u76f4\u63a5\u629b\u5f03\u8fd9\u4e2a\u8bf7\u6c42\uff09\u3002\u7a0b\u5e8f\u5b9e\u9645\u8fd0\u884c\u5982\u4e0b\uff1a<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: left;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-53bebb627d6af6d3c3fe98736db0c6fa.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-53bebb627d6af6d3c3fe98736db0c6fa.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3380503144654088\" data-type=\"png\" data-w=\"636\" \/><\/div><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u53ea\u6709\u7b2c1\u4e2a\u83b7\u53d6\u5230\u4e86\u4ee4\u724c\uff0c\u987a\u5229\u6267\u884c\u4e86\uff0c\u4e0b\u9762\u7684\u57fa\u672c\u90fd\u76f4\u63a5\u629b\u5f03\u4e86\uff0c\u56e0\u4e3a0.5\u79d2\u5185\uff0c\u4ee4\u724c\u6876\uff081\u79d21\u4e2a\uff09\u6765\u4e0d\u53ca\u751f\u4ea7\u5c31\u80af\u5b9a\u83b7\u53d6\u4e0d\u5230\u8fd4\u56defalse\u4e86\u3002<\/span><\/section>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u8fd9\u4e2a\u9650\u6d41\u7b56\u7565\u7684\u6548\u7387\u6709\u591a\u9ad8\u5462\uff1f\u5047\u5982\u6211\u4eec\u7684\u5e76\u53d1\u8bf7\u6c42\u662f400\u4e07\u77ac\u95f4\u7684\u8bf7\u6c42\uff0c\u5c06\u4ee4\u724c\u4ea7\u751f\u7684\u6548\u7387\u8bbe\u4e3a\u6bcf\u79d220\u4e2a\uff0c\u6bcf\u6b21\u5c1d\u8bd5\u83b7\u53d6\u4ee4\u724c\u7684\u65f6\u95f4\u662f0.05\u79d2\uff0c\u90a3\u4e48\u6700\u7ec8\u6d4b\u8bd5\u4e0b\u6765\u7684\u7ed3\u679c\u662f\uff0c\u6bcf\u6b21\u53ea\u4f1a\u653e\u884c4\u4e2a\u5de6\u53f3\u7684\u8bf7\u6c42\uff0c\u5927\u91cf\u7684\u8bf7\u6c42\u4f1a\u88ab\u62d2\u7edd\uff0c\u8fd9\u5c31\u662f\u4ee4\u724c\u6876\u7b97\u6cd5\u7684\u4f18\u79c0\u4e4b\u5904\u3002<\/span><\/section>\n<h3 style=\"margin-top: 1.5em; margin-right: 5px; margin-bottom: 2em; padding: 8px 15px; font-weight: bold; font-size: 1.3em; color: #ffffff; line-height: inherit; letter-spacing: 2px; background-image: linear-gradient(to right bottom, #00bcd4, #3f51b5); background-color: #3f51b5; border-left: 10px solid #333333; border-radius: 5px; text-shadow: #666666 1px 1px 1px; box-shadow: #666666 1px 1px 2px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; text-align: start; white-space: normal;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u5f02\u6b65\u4e0b\u5355<\/span><\/h3>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u4e3a\u4e86\u63d0\u5347\u4e0b\u5355\u7684\u6548\u7387\uff0c\u5e76\u4e14\u9632\u6b62\u4e0b\u5355\u670d\u52a1\u7684\u5931\u8d25\u3002\u9700\u8981\u5c06\u4e0b\u5355\u8fd9\u4e00\u64cd\u4f5c\u8fdb\u884c\u5f02\u6b65\u5904\u7406\u3002\u6700\u5e38\u91c7\u7528\u7684\u529e\u6cd5\u662f\u4f7f\u7528\u961f\u5217\uff0c\u961f\u5217\u6700\u663e\u8457\u7684\u4e09\u4e2a\u4f18\u70b9\uff1a\u5f02\u6b65\u3001\u524a\u5cf0\u3001\u89e3\u8026\u3002\u8fd9\u91cc\u53ef\u4ee5\u91c7\u7528 RabbitMQ\uff0c\u5728\u540e\u53f0\u7ecf\u8fc7\u4e86\u9650\u6d41\u3001\u5e93\u5b58\u6821\u9a8c\u4e4b\u540e\uff0c\u6d41\u5165\u5230\u8fd9\u4e00\u6b65\u9aa4\u7684\u5c31\u662f\u6709\u6548\u8bf7\u6c42\u3002\u7136\u540e\u53d1\u9001\u5230\u961f\u5217\u91cc\uff0c\u961f\u5217\u63a5\u53d7\u6d88\u606f\uff0c\u5f02\u6b65\u4e0b\u5355\u3002\u4e0b\u5b8c\u5355\uff0c\u5165\u5e93\u6ca1\u6709\u95ee\u9898\u53ef\u4ee5\u7528\u77ed\u4fe1\u901a\u77e5\u7528\u6237\u79d2\u6740\u6210\u529f\u3002\u5047\u5982\u5931\u8d25\u7684\u8bdd\uff0c\u53ef\u4ee5\u91c7\u7528\u8865\u507f\u673a\u5236\uff0c\u91cd\u8bd5\u3002<\/span><\/section>\n<h3 style=\"margin-top: 1.5em; margin-right: 5px; margin-bottom: 2em; padding: 8px 15px; font-weight: bold; font-size: 1.3em; color: #ffffff; line-height: inherit; letter-spacing: 2px; background-image: linear-gradient(to right bottom, #00bcd4, #3f51b5); background-color: #3f51b5; border-left: 10px solid #333333; border-radius: 5px; text-shadow: #666666 1px 1px 1px; box-shadow: #666666 1px 1px 2px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; text-align: start; white-space: normal;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u670d\u52a1\u964d\u7ea7<\/span><\/h3>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u5047\u5982\u5728\u79d2\u6740\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86\u67d0\u4e2a\u670d\u52a1\u5668\u5b95\u673a\uff0c\u6216\u8005\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u5e94\u8be5\u505a\u597d\u540e\u5907\u5de5\u4f5c\u3002\u4e4b\u524d\u7684\u535a\u5ba2\u91cc\u6709\u4ecb\u7ecd\u901a\u8fc7Hystrix\u8fdb\u884c\u670d\u52a1\u7194\u65ad\u548c\u964d\u7ea7\uff0c\u53ef\u4ee5\u5f00\u53d1\u4e00\u4e2a\u5907\u7528\u670d\u52a1\uff0c\u5047\u5982\u670d\u52a1\u5668\u771f\u7684\u5b95\u673a\u4e86\uff0c\u76f4\u63a5\u7ed9\u7528\u6237\u4e00\u4e2a\u53cb\u597d\u7684\u63d0\u793a\u8fd4\u56de\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5361\u6b7b\uff0c\u670d\u52a1\u5668\u9519\u8bef\u7b49\u751f\u786c\u7684\u53cd\u9988\u3002<\/span><\/section>\n<h3 style=\"margin-top: 1.5em; margin-right: 5px; margin-bottom: 2em; padding: 8px 15px; font-weight: bold; font-size: 1.3em; color: #ffffff; line-height: inherit; letter-spacing: 2px; background-image: linear-gradient(to right bottom, #00bcd4, #3f51b5); background-color: #3f51b5; border-left: 10px solid #333333; border-radius: 5px; text-shadow: #666666 1px 1px 1px; box-shadow: #666666 1px 1px 2px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; text-align: start; white-space: normal;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u603b\u7ed3<\/span><\/h3>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u79d2\u6740\u6d41\u7a0b\u56fe\uff1a<\/span><\/section>\n<p style=\"margin: 0px 0px 1.2em !important; text-align: center;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-b4a942e56feb443b8ad9d8e9ceb7dea8.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-b4a942e56feb443b8ad9d8e9ceb7dea8.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4666666666666667\" data-type=\"png\" data-w=\"1080\" \/><\/div><\/p>\n<section style=\"line-height: 1.75em; margin: 0px 0px 1.2em !important; text-align: left;\"><span style=\"font-size: 15px;\">\u8fd9\u5c31\u662f\u6211\u8bbe\u8ba1\u51fa\u6765\u7684\u79d2\u6740\u6d41\u7a0b\u56fe\uff0c\u5f53\u7136\u4e0d\u540c\u7684\u79d2\u6740\u4f53\u91cf\u9488\u5bf9\u7684\u6280\u672f\u9009\u578b\u90fd\u4e0d\u4e00\u6837\uff0c\u8fd9\u4e2a\u6d41\u7a0b\u53ef\u4ee5\u652f\u6491\u8d77\u51e0\u5341\u4e07\u7684\u6d41\u91cf\uff0c\u5982\u679c\u662f\u6210\u5343\u4e07\u7834\u4ebf\u90a3\u5c31\u5f97\u91cd\u65b0\u8bbe\u8ba1\u4e86\u3002\u6bd4\u5982\u6570\u636e\u5e93\u7684\u5206\u5e93\u5206\u8868\u3001\u961f\u5217\u6539\u6210\u7528Kafka\u3001Redis\u589e\u52a0\u96c6\u7fa4\u6570\u91cf\u7b49\u624b\u6bb5\u3002\u901a\u8fc7\u672c\u6b21\u8bbe\u8ba1\u4e3b\u8981\u662f\u8981\u8868\u660e\u7684\u662f\u6211\u4eec\u5982\u4f55\u5e94\u5bf9\u9ad8\u5e76\u53d1\u7684\u5904\u7406\uff0c\u5e76\u5f00\u59cb\u5c1d\u8bd5\u89e3\u51b3\u5b83\uff0c\u5728\u5de5\u4f5c\u4e2d\u591a\u601d\u8003\u3001\u591a\u52a8\u624b\u80fd\u63d0\u5347\u6211\u4eec\u7684\u80fd\u529b\u6c34\u5e73\uff0c\u52a0\u6cb9\uff01\u5982\u679c\u672c\u7bc7\u535a\u5ba2\u6709\u4efb\u4f55\u9519\u8bef\uff0c\u8bf7\u9ebb\u70e6\u6307\u51fa\u6765\uff0c\u4e0d\u80dc\u611f\u6fc0\u3002<\/span><\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u79d2\u6740\u7cfb\u7edf\u76f8\u4fe1\u5f88\u591a\u4eba\u89c1\u8fc7\uff0c\u6bd4\u5982\u4eac\u4e1c\u6216\u8005\u6dd8\u5b9d\u7684\u79d2\u6740\uff0c\u5c0f\u7c73\u624b\u673a\u7684\u79d2\u6740\uff0c\u90a3\u4e48\u79d2\u6740\u7cfb\u7edf\u7684\u540e\u53f0\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u5462\uff1f\u6211\u4eec\u5982\u4f55\u8bbe\u8ba1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-5065","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5065"}],"version-history":[{"count":2,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5065\/revisions"}],"predecessor-version":[{"id":5247,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5065\/revisions\/5247"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}