{"id":5679,"date":"2022-01-09T01:37:22","date_gmt":"2022-01-09T09:37:22","guid":{"rendered":"https:\/\/www.xh86.me\/?p=5679"},"modified":"2022-01-09T02:12:59","modified_gmt":"2022-01-09T10:12:59","slug":"kafka%e6%80%a7%e8%83%bd%e7%af%87%ef%bc%9a%e4%b8%ba%e4%bd%95kafka%e8%bf%99%e4%b9%88%e5%bf%ab%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=5679","title":{"rendered":"Kafka\u6027\u80fd\u7bc7\uff1a\u4e3a\u4f55Kafka\u8fd9\u4e48\u5feb\uff1f"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"line-height: 1.6; word-break: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; padding: 5px; font-size: 16px; color: #353535; word-spacing: 0.8px; letter-spacing: 0.8px; border-radius: 16px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" data-mpa-powered-by=\"yiban.io\">\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-4ea9b5c27639f75320e3f9b9d672e5c5.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-4ea9b5c27639f75320e3f9b9d672e5c5.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3971363978899774\" data-type=\"png\" data-w=\"1327\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ee5\u8bb2\u89e3\u6027\u80fd\u4f5c\u4e3a Kafka \u4e4b\u65c5\u7684\u5f00\u7bc7\u4e4b\u4f5c\uff0c\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u6df1\u5165\u4e86\u89e3 Kafka \u201c\u5feb\u201d\u7684\u5185\u90e8\u79d8\u5bc6\u3002\u4f60\u4e0d\u4ec5\u53ef\u4ee5\u5b66\u4e60\u5230 Kafka \u6027\u80fd\u4f18\u5316\u7684\u5404\u79cd\u624b\u6bb5\uff0c\u4e5f\u53ef\u4ee5\u63d0\u70bc\u51fa\u5404\u79cd\u6027\u80fd\u4f18\u5316\u7684\u65b9\u6cd5\u8bba\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u8bba\u4e5f\u53ef\u4ee5\u5e94\u7528\u5230\u6211\u4eec\u81ea\u5df1\u7684\u9879\u76ee\u4e4b\u4e2d\uff0c\u52a9\u529b\u6211\u4eec\u5199\u51fa\u9ad8\u6027\u80fd\u7684\u9879\u76ee\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u5173\u516c\u6218\u79e6\u743c<\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65: Redis \u548c Kafka \u5b8c\u5168\u662f\u4e0d\u540c\u4f5c\u7528\u7684\u4e2d\u95f4\u4ef6\uff0c\u6709\u6bd4\u8f83\u6027\u5417\uff1f<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u662f\u7684\uff0c\u6240\u4ee5\u6b64\u6587\u8bb2\u7684\u4e0d\u662f<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u300a\u5206\u5e03\u5f0f\u7f13\u5b58\u7684\u9009\u578b\u300b<\/code>\uff0c\u4e5f\u4e0d\u662f<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u300a\u5206\u5e03\u5f0f\u4e2d\u95f4\u4ef6\u5bf9\u6bd4\u300b<\/code>\u3002\u6211\u4eec\u805a\u7126\u4e8e\u8fd9\u4e24\u4e2a\u4e0d\u540c\u9886\u57df\u7684\u9879\u76ee\u5bf9\u6027\u80fd\u7684\u4f18\u5316\uff0c\u770b\u4e00\u770b\u4f18\u79c0\u9879\u76ee\u5bf9\u6027\u80fd\u4f18\u5316\u7684\u901a\u7528\u624b\u6bb5\uff0c\u4ee5\u53ca\u5728\u9488\u5bf9\u4e0d\u540c\u573a\u666f\u4e0b\u7684\u7279\u8272\u7684\u4f18\u5316\u65b9\u5f0f\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f88\u591a\u4eba\u5b66\u4e60\u4e86\u5f88\u591a\u4e1c\u897f\uff0c\u4e86\u89e3\u4e86\u5f88\u591a\u6846\u67b6\uff0c\u4f46\u5728\u9047\u5230\u5b9e\u9645\u95ee\u9898\u65f6\uff0c\u5374\u5e38\u5e38\u4f1a\u611f\u89c9\u5230\u77e5\u8bc6\u4e0d\u8db3\u3002\u8fd9\u5c31\u662f\u6ca1\u6709\u5c06\u5b66\u4e60\u5230\u7684\u77e5\u8bc6\u4f53\u7cfb\u5316\uff0c\u6ca1\u6709\u4ece\u5177\u4f53\u7684\u5b9e\u73b0\u4e2d\u62bd\u8c61\u51fa\u53ef\u4ee5\u884c\u4e4b\u6709\u6548\u7684<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u65b9\u6cd5\u8bba<\/code>\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b66\u4e60\u5f00\u6e90\u9879\u76ee\u5f88\u91cd\u8981\u7684\u4e00\u70b9\u5c31\u662f<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5f52\u7eb3<\/code>\uff0c\u5c06\u4e0d\u540c\u9879\u76ee\u7684\u4f18\u79c0\u5b9e\u73b0\u603b\u7ed3\u51fa\u65b9\u6cd5\u8bba\uff0c\u7136\u540e<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u6f14\u7ece<\/code>\u5230\u81ea\u6211\u7684\u5b9e\u8df5\u4e2d\u53bb\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px; color: #222;\">\u5f00\u7bc7\u5bc4\u8bed<\/span><\/h3>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">\u7801\u54e5\uff1a\u7406\u6027\u3001\u5ba2\u89c2\u3001\u8c28\u614e\u662f\u7a0b\u5e8f\u5458\u7684\u7279\u70b9\uff0c\u4e5f\u662f\u4f18\u70b9\uff0c\u4f46\u662f\u5f88\u591a\u65f6\u5019\u6211\u4eec\u4e5f\u9700\u8981\u5e26\u4e00\u70b9\u611f\u6027\uff0c\u5e26\u4e00\u70b9\u51b2\u52a8\uff0c\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u5feb\u7684\u505a\u51b3\u7b56\u3002\u300c\u60b2\u89c2\u8005\u6b63\u786e\u3001\u4e50\u89c2\u8005\u6210\u529f\u3002\u300d\u5e0c\u671b\u5927\u5bb6\u90fd\u662f\u4e00\u4e2a\u4e50\u89c2\u5730\u89e3\u51b3\u95ee\u9898\u7684\u4eba\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">Kafka \u6027\u80fd\u5168\u666f<\/span><\/h2>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-c37495d96345de54decc6233fafdcdb2.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-c37495d96345de54decc6233fafdcdb2.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.6862745098039216\" data-type=\"png\" data-w=\"1530\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ece\u9ad8\u5ea6\u62bd\u8c61\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u6027\u80fd\u95ee\u9898\u9003\u4e0d\u51fa\u4e0b\u9762\u4e09\u4e2a\u65b9\u9762\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7f51\u7edc<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u78c1\u76d8<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u590d\u6742\u5ea6<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5bf9\u4e8e Kafka \u8fd9\u79cd\u7f51\u7edc\u5206\u5e03\u5f0f\u961f\u5217\u6765\u8bf4\uff0c\u7f51\u7edc\u548c\u78c1\u76d8\u66f4\u662f\u4f18\u5316\u7684\u91cd\u4e2d\u4e4b\u91cd\u3002\u9488\u5bf9\u4e8e\u4e0a\u9762\u63d0\u51fa\u7684\u62bd\u8c61\u95ee\u9898\uff0c\u89e3\u51b3\u65b9\u6848\u9ad8\u5ea6\u62bd\u8c61\u51fa\u6765\u4e5f\u5f88\u7b80\u5355\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u5e76\u53d1<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u538b\u7f29<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u6279\u91cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7f13\u5b58<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7b97\u6cd5<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u77e5\u9053\u4e86\u95ee\u9898\u548c\u601d\u8def\uff0c\u6211\u4eec\u518d\u6765\u770b\u770b\uff0c\u5728 Kafka \u4e2d\uff0c\u6709\u54ea\u4e9b\u89d2\u8272\uff0c\u800c\u8fd9\u4e9b\u89d2\u8272\u5c31\u662f\u53ef\u4ee5\u4f18\u5316\u7684\u70b9\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Producer<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Broker<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Consumer<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u662f\u7684\uff0c\u6240\u6709\u7684\u95ee\u9898\uff0c\u601d\u8def\uff0c\u4f18\u5316\u70b9\u90fd\u5df2\u7ecf\u5217\u51fa\u6765\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u5c3d\u53ef\u80fd\u7684\u7ec6\u5316\uff0c\u4e09\u4e2a\u65b9\u5411\u90fd\u53ef\u4ee5\u7ec6\u5316\uff0c\u5982\u6b64\uff0c\u6240\u6709\u7684\u5b9e\u73b0\u4fbf\u4e00\u76ee\u4e86\u7136\uff0c\u5373\u4f7f\u4e0d\u770b Kafka \u7684\u5b9e\u73b0\uff0c\u6211\u4eec\u81ea\u5df1\u4e5f\u53ef\u4ee5\u60f3\u5230\u4e00\u4e8c\u70b9\u53ef\u4ee5\u4f18\u5316\u7684\u5730\u65b9\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u5c31\u662f\u601d\u8003\u65b9\u5f0f\u3002<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u63d0\u51fa\u95ee\u9898<\/code> &gt; <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5217\u51fa\u95ee\u9898\u70b9<\/code> &gt; <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5217\u51fa\u4f18\u5316\u65b9\u6cd5<\/code> &gt; <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5217\u51fa\u5177\u4f53\u53ef\u5207\u5165\u7684\u70b9<\/code> &gt; <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">tradeoff\u548c\u7ec6\u5316\u5b9e\u73b0<\/code>\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u73b0\u5728\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u81ea\u5df1\u60f3\u4e00\u60f3\u4f18\u5316\u7684\u70b9\u548c\u65b9\u6cd5\uff0c\u4e0d\u7528\u5c3d\u5584\u5c3d\u7f8e\uff0c\u4e0d\u7528\u7ba1\u597d\u4e0d\u597d\u5b9e\u73b0\uff0c\u60f3\u4e00\u70b9\u662f\u4e00\u70b9\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u4e0d\u884c\u554a\uff0c\u6211\u5f88\u7b28\uff0c\u4e5f\u5f88\u61d2\uff0c\u4f60\u8fd8\u662f\u76f4\u63a5\u548c\u6211\u8bf4\u5427\uff0c\u6211\u767d\u5ad6\u6bd4\u8f83\u884c\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u987a\u5e8f\u5199<\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u4eba\u5bb6 Redis \u662f\u57fa\u4e8e\u7eaf\u5185\u5b58\u7684\u7cfb\u7edf\uff0c\u4f60 kafka \u8fd8\u8981\u8bfb\u5199\u78c1\u76d8\uff0c\u80fd\u6bd4\uff1f<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u4e3a\u4ec0\u4e48\u8bf4\u5199\u78c1\u76d8\u6162\uff1f<\/code><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6211\u4eec\u4e0d\u80fd\u53ea\u77e5\u9053\u7ed3\u8bba\uff0c\u800c\u4e0d\u77e5\u5176\u6240\u4ee5\u7136\u3002\u8981\u56de\u7b54\u8fd9\u4e2a\u95ee\u9898\uff0c\u5c31\u5f97\u56de\u5230\u5728\u6821\u65f6\u6211\u4eec\u5b66\u7684\u64cd\u4f5c\u7cfb\u7edf\u8bfe\u7a0b\u4e86\u300265 \u54e5\u8fd8\u7559\u7740\u8bfe\u672c\u5417\uff1f\u6765\uff0c\u7ffb\u5230\u8bb2\u78c1\u76d8\u7684\u7ae0\u8282\uff0c\u8ba9\u6211\u4eec\u56de\u987e\u4e00\u4e0b\u78c1\u76d8\u7684\u8fd0\u884c\u539f\u7406\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u9b3c\u8fd8\u7559\u7740\u54e6\uff0c\u8bfe\u7a0b\u8fd8\u6ca1\u4e0a\u5230\u4e00\u534a\u4e66\u5c31\u6ca1\u4e86\u3002\u8981\u4e0d\u662f\u8003\u8bd5\u4ffa\u773c\u795e\u597d\uff0c\u4f30\u8ba1\u73b0\u5728\u8fd8\u6ca1\u6bd5\u4e1a\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u770b\u7ecf\u5178\u5927\u56fe\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-9d04cc2cac3536ee68e22822b6fcf71a.jpeg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-9d04cc2cac3536ee68e22822b6fcf71a.jpeg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.5896551724137931\" data-type=\"jpeg\" data-w=\"580\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b8c\u6210\u4e00\u6b21\u78c1\u76d8 IO\uff0c\u9700\u8981\u7ecf\u8fc7<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5bfb\u9053<\/code>\u3001<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u65cb\u8f6c<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u6570\u636e\u4f20\u8f93<\/code>\u4e09\u4e2a\u6b65\u9aa4\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f71\u54cd\u78c1\u76d8 IO \u6027\u80fd\u7684\u56e0\u7d20\u4e5f\u5c31\u53d1\u751f\u5728\u4e0a\u9762\u4e09\u4e2a\u6b65\u9aa4\u4e0a\uff0c\u56e0\u6b64\u4e3b\u8981\u82b1\u8d39\u7684\u65f6\u95f4\u5c31\u662f\uff1a<\/p>\n<ol class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u5bfb\u9053\u65f6\u95f4\uff1aTseek \u662f\u6307\u5c06\u8bfb\u5199\u78c1\u5934\u79fb\u52a8\u81f3\u6b63\u786e\u7684\u78c1\u9053\u4e0a\u6240\u9700\u8981\u7684\u65f6\u95f4\u3002\u5bfb\u9053\u65f6\u95f4\u8d8a\u77ed\uff0cI\/O \u64cd\u4f5c\u8d8a\u5feb\uff0c\u76ee\u524d\u78c1\u76d8\u7684\u5e73\u5747\u5bfb\u9053\u65f6\u95f4\u4e00\u822c\u5728 3-15ms\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u65cb\u8f6c\u5ef6\u8fdf\uff1aTrotation \u662f\u6307\u76d8\u7247\u65cb\u8f6c\u5c06\u8bf7\u6c42\u6570\u636e\u6240\u5728\u7684\u6247\u533a\u79fb\u52a8\u5230\u8bfb\u5199\u78c1\u76d8\u4e0b\u65b9\u6240\u9700\u8981\u7684\u65f6\u95f4\u3002\u65cb\u8f6c\u5ef6\u8fdf\u53d6\u51b3\u4e8e\u78c1\u76d8\u8f6c\u901f\uff0c\u901a\u5e38\u7528\u78c1\u76d8\u65cb\u8f6c\u4e00\u5468\u6240\u9700\u65f6\u95f4\u7684 1\/2 \u8868\u793a\u3002\u6bd4\u5982\uff1a7200rpm \u7684\u78c1\u76d8\u5e73\u5747\u65cb\u8f6c\u5ef6\u8fdf\u5927\u7ea6\u4e3a 60*1000\/7200\/2 = 4.17ms\uff0c\u800c\u8f6c\u901f\u4e3a 15000rpm \u7684\u78c1\u76d8\u5176\u5e73\u5747\u65cb\u8f6c\u5ef6\u8fdf\u4e3a 2ms\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u6570\u636e\u4f20\u8f93\u65f6\u95f4\uff1aTtransfer \u662f\u6307\u5b8c\u6210\u4f20\u8f93\u6240\u8bf7\u6c42\u7684\u6570\u636e\u6240\u9700\u8981\u7684\u65f6\u95f4\uff0c\u5b83\u53d6\u51b3\u4e8e\u6570\u636e\u4f20\u8f93\u7387\uff0c\u5176\u503c\u7b49\u4e8e\u6570\u636e\u5927\u5c0f\u9664\u4ee5\u6570\u636e\u4f20\u8f93\u7387\u3002\u76ee\u524d IDE\/ATA \u80fd\u8fbe\u5230 133MB\/s\uff0cSATA II \u53ef\u8fbe\u5230 300MB\/s \u7684\u63a5\u53e3\u6570\u636e\u4f20\u8f93\u7387\uff0c\u6570\u636e\u4f20\u8f93\u65f6\u95f4\u901a\u5e38\u8fdc\u5c0f\u4e8e\u524d\u4e24\u90e8\u5206\u6d88\u8017\u65f6\u95f4\u3002\u7b80\u5355\u8ba1\u7b97\u65f6\u53ef\u5ffd\u7565\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u56e0\u6b64\uff0c\u5982\u679c\u5728\u5199\u78c1\u76d8\u7684\u65f6\u5019\u7701\u53bb<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5bfb\u9053<\/code>\u3001<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u65cb\u8f6c<\/code>\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u78c1\u76d8\u8bfb\u5199\u7684\u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u91c7\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u987a\u5e8f\u5199<\/code>\u6587\u4ef6\u7684\u65b9\u5f0f\u6765\u63d0\u9ad8\u78c1\u76d8\u5199\u5165\u6027\u80fd\u3002<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u987a\u5e8f\u5199<\/code>\u6587\u4ef6\uff0c\u57fa\u672c\u51cf\u5c11\u4e86\u78c1\u76d8<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u5bfb\u9053<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u65cb\u8f6c<\/code>\u7684\u6b21\u6570\u3002\u78c1\u5934\u518d\u4e5f\u4e0d\u7528\u5728\u78c1\u9053\u4e0a\u4e71\u821e\u4e86\uff0c\u800c\u662f\u4e00\u8def\u5411\u524d\u98de\u901f\u524d\u884c\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u4e2d\u6bcf\u4e2a\u5206\u533a\u662f\u4e00\u4e2a\u6709\u5e8f\u7684\uff0c\u4e0d\u53ef\u53d8\u7684\u6d88\u606f\u5e8f\u5217\uff0c\u65b0\u7684\u6d88\u606f\u4e0d\u65ad\u8ffd\u52a0\u5230 Partition \u7684\u672b\u5c3e\uff0c\u5728 Kafka \u4e2d Partition \u53ea\u662f\u4e00\u4e2a\u903b\u8f91\u6982\u5ff5\uff0cKafka \u5c06 Partition \u5212\u5206\u4e3a\u591a\u4e2a Segment\uff0c\u6bcf\u4e2a Segment \u5bf9\u5e94\u4e00\u4e2a\u7269\u7406\u6587\u4ef6\uff0cKafka \u5bf9 segment \u6587\u4ef6\u8ffd\u52a0\u5199\uff0c\u8fd9\u5c31\u662f\u987a\u5e8f\u5199\u6587\u4ef6\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u4e3a\u4ec0\u4e48 Kafka \u53ef\u4ee5\u4f7f\u7528\u8ffd\u52a0\u5199\u7684\u65b9\u5f0f\u5462\uff1f<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u548c Kafka \u7684\u6027\u8d28\u6709\u5173\uff0c\u6211\u4eec\u6765\u770b\u770b Kafka \u548c Redis\uff0c\u8bf4\u767d\u4e86\uff0cKafka \u5c31\u662f\u4e00\u4e2a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Queue<\/code>\uff0c\u800c Redis \u5c31\u662f\u4e00\u4e2a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">HashMap<\/code>\u3002<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Queue<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Map<\/code>\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Queue<\/code> \u662f FIFO \u7684\uff0c\u6570\u636e\u662f\u6709\u5e8f\u7684\uff1b<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">HashMap<\/code>\u6570\u636e\u662f\u65e0\u5e8f\u7684\uff0c\u662f\u968f\u673a\u8bfb\u5199\u7684\u3002Kafka \u7684\u4e0d\u53ef\u53d8\u6027\uff0c\u6709\u5e8f\u6027\u4f7f\u5f97 Kafka \u53ef\u4ee5\u4f7f\u7528\u8ffd\u52a0\u5199\u7684\u65b9\u5f0f\u5199\u6587\u4ef6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u5b9e\u5f88\u591a\u7b26\u5408\u4ee5\u4e0a\u7279\u6027\u7684\u6570\u636e\u7cfb\u7edf\uff0c\u90fd\u53ef\u4ee5\u91c7\u7528\u8ffd\u52a0\u5199\u7684\u65b9\u5f0f\u6765\u4f18\u5316\u78c1\u76d8\u6027\u80fd\u3002\u5178\u578b\u7684\u6709<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Redis<\/code>\u7684 AOF \u6587\u4ef6\uff0c\u5404\u79cd\u6570\u636e\u5e93\u7684<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">WAL(Write ahead log)<\/code>\u673a\u5236\u7b49\u7b49\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">\u6240\u4ee5\u6e05\u695a\u660e\u767d\u81ea\u8eab\u4e1a\u52a1\u7684\u7279\u70b9\uff0c\u5c31\u53ef\u4ee5\u9488\u5bf9\u6027\u5730\u505a\u51fa\u4f18\u5316\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u96f6\u62f7\u8d1d<\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u54c8\u54c8\uff0c\u8fd9\u4e2a\u6211\u9762\u8bd5\u88ab\u95ee\u5230\u8fc7\u3002\u53ef\u60dc\u7b54\u5f97\u4e00\u822c\u822c\uff0c\u5509\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u4ec0\u4e48\u662f\u96f6\u62f7\u8d1d\uff1f<\/code><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6211\u4eec\u4ece Kafka \u7684\u573a\u666f\u6765\u770b\uff0cKafka Consumer \u6d88\u8d39\u5b58\u50a8\u5728 Broker \u78c1\u76d8\u7684\u6570\u636e\uff0c\u4ece\u8bfb\u53d6 Broker \u78c1\u76d8\u5230\u7f51\u7edc\u4f20\u8f93\u7ed9 Consumer\uff0c\u671f\u95f4\u6d89\u53ca\u54ea\u4e9b\u7cfb\u7edf\u4ea4\u4e92\u3002Kafka Consumer \u4ece Broker \u6d88\u8d39\u6570\u636e\uff0cBroker \u8bfb\u53d6 Log\uff0c\u5c31\u4f7f\u7528\u4e86 sendfile\u3002\u5982\u679c\u4f7f\u7528\u4f20\u7edf\u7684 IO \u6a21\u578b\uff0c\u4f2a\u4ee3\u7801\u903b\u8f91\u5c31\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">readFile(buffer)\r\nsend(buffer)\r\n<\/code><\/pre>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-ca55810fb77a4a29675c9748ce2a6591.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-ca55810fb77a4a29675c9748ce2a6591.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.8761904761904762\" data-type=\"gif\" data-w=\"420\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u56fe\uff0c\u5982\u679c\u91c7\u7528\u4f20\u7edf\u7684 IO \u6d41\u7a0b\uff0c\u5148\u8bfb\u53d6\u7f51\u7edc IO\uff0c\u518d\u5199\u5165\u78c1\u76d8 IO\uff0c\u5b9e\u9645\u9700\u8981\u5c06\u6570\u636e Copy \u56db\u6b21\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-2e84424b8b6f38604149e972da020266.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-2e84424b8b6f38604149e972da020266.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.7654320987654321\" data-type=\"gif\" data-w=\"405\" \/><\/div><\/figure>\n<ol class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7b2c\u4e00\u6b21\uff1a\u8bfb\u53d6\u78c1\u76d8\u6587\u4ef6\u5230\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u7f13\u51b2\u533a\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7b2c\u4e8c\u6b21\uff1a\u5c06\u5185\u6838\u7f13\u51b2\u533a\u7684\u6570\u636e\uff0ccopy \u5230\u5e94\u7528\u7a0b\u5e8f\u7684 buffer\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7b2c\u4e09\u6b65\uff1a\u5c06\u5e94\u7528\u7a0b\u5e8f buffer \u4e2d\u7684\u6570\u636e\uff0ccopy \u5230 socket \u7f51\u7edc\u53d1\u9001\u7f13\u51b2\u533a\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7b2c\u56db\u6b21\uff1a\u5c06 socket buffer \u7684\u6570\u636e\uff0ccopy \u5230\u7f51\u5361\uff0c\u7531\u7f51\u5361\u8fdb\u884c\u7f51\u7edc\u4f20\u8f93\u3002<\/section>\n<\/li>\n<\/ol>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u554a\uff0c\u64cd\u4f5c\u7cfb\u7edf\u8fd9\u4e48\u50bb\u5417\uff1fcopy \u6765 copy \u53bb\u7684\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5e76\u4e0d\u662f\u64cd\u4f5c\u7cfb\u7edf\u50bb\uff0c\u64cd\u4f5c\u7cfb\u7edf\u7684\u8bbe\u8ba1\u5c31\u662f\u6bcf\u4e2a\u5e94\u7528\u7a0b\u5e8f\u90fd\u6709\u81ea\u5df1\u7684\u7528\u6237\u5185\u5b58\uff0c\u7528\u6237\u5185\u5b58\u548c\u5185\u6838\u5185\u5b58\u9694\u79bb\uff0c\u8fd9\u662f\u4e3a\u4e86\u7a0b\u5e8f\u548c\u7cfb\u7edf\u5b89\u5168\u8003\u8651\uff0c\u5426\u5219\u7684\u8bdd\u6bcf\u4e2a\u5e94\u7528\u7a0b\u5e8f\u5185\u5b58\u6ee1\u5929\u98de\uff0c\u968f\u610f\u8bfb\u5199\u90a3\u8fd8\u5f97\u4e86\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0d\u8fc7\uff0c\u8fd8\u6709<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u96f6\u62f7\u8d1d<\/code>\u6280\u672f\uff0c\u82f1\u6587\u2014\u2014<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Zero-Copy<\/code>\u3002<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u96f6\u62f7\u8d1d<\/code>\u5c31\u662f\u5c3d\u91cf\u53bb\u51cf\u5c11\u4e0a\u9762\u6570\u636e\u7684\u62f7\u8d1d\u6b21\u6570\uff0c\u4ece\u800c\u51cf\u5c11\u62f7\u8d1d\u7684 CPU \u5f00\u9500\uff0c\u51cf\u5c11\u7528\u6237\u6001\u5185\u6838\u6001\u7684\u4e0a\u4e0b\u6587\u5207\u6362\u6b21\u6570\uff0c\u4ece\u800c\u4f18\u5316\u6570\u636e\u4f20\u8f93\u7684\u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5e38\u89c1\u7684\u96f6\u62f7\u8d1d\u601d\u8def\u4e3b\u8981\u6709\u4e09\u79cd\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u76f4\u63a5 I\/O\uff1a\u6570\u636e\u76f4\u63a5\u8de8\u8fc7\u5185\u6838\uff0c\u5728\u7528\u6237\u5730\u5740\u7a7a\u95f4\u4e0e I\/O \u8bbe\u5907\u4e4b\u95f4\u4f20\u9012\uff0c\u5185\u6838\u53ea\u662f\u8fdb\u884c\u5fc5\u8981\u7684\u865a\u62df\u5b58\u50a8\u914d\u7f6e\u7b49\u8f85\u52a9\u5de5\u4f5c\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u907f\u514d\u5185\u6838\u548c\u7528\u6237\u7a7a\u95f4\u4e4b\u95f4\u7684\u6570\u636e\u62f7\u8d1d\uff1a\u5f53\u5e94\u7528\u7a0b\u5e8f\u4e0d\u9700\u8981\u5bf9\u6570\u636e\u8fdb\u884c\u8bbf\u95ee\u65f6\uff0c\u5219\u53ef\u4ee5\u907f\u514d\u5c06\u6570\u636e\u4ece\u5185\u6838\u7a7a\u95f4\u62f7\u8d1d\u5230\u7528\u6237\u7a7a\u95f4\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u5199\u65f6\u590d\u5236\uff1a\u6570\u636e\u4e0d\u9700\u8981\u63d0\u524d\u62f7\u8d1d\uff0c\u800c\u662f\u5f53\u9700\u8981\u4fee\u6539\u7684\u65f6\u5019\u518d\u8fdb\u884c\u90e8\u5206\u62f7\u8d1d\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u4f7f\u7528\u5230\u4e86 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">mmap<\/code> \u548c <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">sendfile<\/code> \u7684\u65b9\u5f0f\u6765\u5b9e\u73b0<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u96f6\u62f7\u8d1d<\/code>\u3002\u5206\u522b\u5bf9\u5e94 Java \u7684 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">MappedByteBuffer<\/code> \u548c <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">FileChannel.transferTo<\/code>\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528 Java NIO \u5b9e\u73b0<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u96f6\u62f7\u8d1d<\/code>\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">FileChannel.transferTo()\r\n<\/code><\/pre>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-3f11ec1e4355fa6945b86dbd0d9aa356.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-3f11ec1e4355fa6945b86dbd0d9aa356.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.8914285714285715\" data-type=\"gif\" data-w=\"350\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u6b64\u6a21\u578b\u4e0b\uff0c\u4e0a\u4e0b\u6587\u5207\u6362\u7684\u6570\u91cf\u51cf\u5c11\u5230\u4e00\u4e2a\u3002\u5177\u4f53\u800c\u8a00\uff0c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">transferTo()<\/code>\u65b9\u6cd5\u6307\u793a\u5757\u8bbe\u5907\u901a\u8fc7 DMA \u5f15\u64ce\u5c06\u6570\u636e\u8bfb\u53d6\u5230\u8bfb\u53d6\u7f13\u51b2\u533a\u4e2d\u3002\u7136\u540e\uff0c\u5c06\u8be5\u7f13\u51b2\u533a\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u5185\u6838\u7f13\u51b2\u533a\u4ee5\u6682\u5b58\u5230\u5957\u63a5\u5b57\u3002\u6700\u540e\uff0c\u5957\u63a5\u5b57\u7f13\u51b2\u533a\u901a\u8fc7 DMA \u590d\u5236\u5230 NIC \u7f13\u51b2\u533a\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-7a7cb9b03ba37dba0fffd0b505c0a99c.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-7a7cb9b03ba37dba0fffd0b505c0a99c.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.4317617866004963\" data-type=\"gif\" data-w=\"403\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6211\u4eec\u5c06\u526f\u672c\u6570\u4ece\u56db\u51cf\u5c11\u5230\u4e09\uff0c\u5e76\u4e14\u8fd9\u4e9b\u526f\u672c\u4e2d\u53ea\u6709\u4e00\u4e2a\u6d89\u53ca CPU\u3002\u6211\u4eec\u8fd8\u5c06\u4e0a\u4e0b\u6587\u5207\u6362\u7684\u6570\u91cf\u4ece\u56db\u4e2a\u51cf\u5c11\u5230\u4e86\u4e24\u4e2a\u3002\u8fd9\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u6539\u8fdb\uff0c\u4f46\u662f\u8fd8\u6ca1\u6709\u67e5\u8be2\u96f6\u526f\u672c\u3002\u5f53\u8fd0\u884c Linux \u5185\u6838 2.4 \u53ca\u66f4\u9ad8\u7248\u672c\u4ee5\u53ca\u652f\u6301\u6536\u96c6\u64cd\u4f5c\u7684\u7f51\u7edc\u63a5\u53e3\u5361\u65f6\uff0c\u540e\u8005\u53ef\u4ee5\u4f5c\u4e3a\u8fdb\u4e00\u6b65\u7684\u4f18\u5316\u6765\u5b9e\u73b0\u3002\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-5961c359c782b818f4a37370adffb0dc.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-5961c359c782b818f4a37370adffb0dc.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"1.0057142857142858\" data-type=\"gif\" data-w=\"350\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6839\u636e\u524d\u9762\u7684\u793a\u4f8b\uff0c\u8c03\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">transferTo()<\/code>\u65b9\u6cd5\u4f1a\u4f7f\u8bbe\u5907\u901a\u8fc7 DMA \u5f15\u64ce\u5c06\u6570\u636e\u8bfb\u53d6\u5230\u5185\u6838\u8bfb\u53d6\u7f13\u51b2\u533a\u4e2d\u3002\u4f46\u662f\uff0c\u4f7f\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">gather<\/code>\u64cd\u4f5c\u65f6\uff0c\u8bfb\u53d6\u7f13\u51b2\u533a\u548c\u5957\u63a5\u5b57\u7f13\u51b2\u533a\u4e4b\u95f4\u6ca1\u6709\u590d\u5236\u3002\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\uff0c\u7ed9 NIC \u4e00\u4e2a\u6307\u5411\u8bfb\u53d6\u7f13\u51b2\u533a\u7684\u6307\u9488\u4ee5\u53ca\u504f\u79fb\u91cf\u548c\u957f\u5ea6\uff0c\u8be5\u504f\u79fb\u91cf\u548c\u957f\u5ea6\u7531 DMA \u6e05\u9664\u3002CPU \u7edd\u5bf9\u4e0d\u53c2\u4e0e\u590d\u5236\u7f13\u51b2\u533a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5173\u4e8e<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">\u96f6\u62f7\u8d1d<\/code>\u8be6\u60c5\uff0c\u53ef\u4ee5\u8be6\u8bfb\u8fd9\u7bc7\u6587\u7ae0\u96f6\u62f7\u8d1d (Zero-copy) \u6d45\u6790\u53ca\u5176\u5e94\u7528\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">PageCache<\/span><\/h2>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-a9e7a4a07d26f1f86e2c1070f66598bb.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-a9e7a4a07d26f1f86e2c1070f66598bb.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.6372832369942196\" data-type=\"png\" data-w=\"692\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">producer \u751f\u4ea7\u6d88\u606f\u5230 Broker \u65f6\uff0cBroker \u4f1a\u4f7f\u7528 pwrite() \u7cfb\u7edf\u8c03\u7528\u3010\u5bf9\u5e94\u5230 Java NIO \u7684 FileChannel.write() API\u3011\u6309\u504f\u79fb\u91cf\u5199\u5165\u6570\u636e\uff0c\u6b64\u65f6\u6570\u636e\u90fd\u4f1a\u5148\u5199\u5165<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">page cache<\/code>\u3002consumer \u6d88\u8d39\u6d88\u606f\u65f6\uff0cBroker \u4f7f\u7528 sendfile() \u7cfb\u7edf\u8c03\u7528\u3010\u5bf9\u5e94 FileChannel.transferTo() API\u3011\uff0c\u96f6\u62f7\u8d1d\u5730\u5c06\u6570\u636e\u4ece page cache \u4f20\u8f93\u5230 broker \u7684 Socket buffer\uff0c\u518d\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">leader \u4e0e follower \u4e4b\u95f4\u7684\u540c\u6b65\uff0c\u4e0e\u4e0a\u9762 consumer \u6d88\u8d39\u6570\u636e\u7684\u8fc7\u7a0b\u662f\u540c\u7406\u7684\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">page cache<\/code>\u4e2d\u7684\u6570\u636e\u4f1a\u968f\u7740\u5185\u6838\u4e2d flusher \u7ebf\u7a0b\u7684\u8c03\u5ea6\u4ee5\u53ca\u5bf9 sync()\/fsync() \u7684\u8c03\u7528\u5199\u56de\u5230\u78c1\u76d8\uff0c\u5c31\u7b97\u8fdb\u7a0b\u5d29\u6e83\uff0c\u4e5f\u4e0d\u7528\u62c5\u5fc3\u6570\u636e\u4e22\u5931\u3002\u53e6\u5916\uff0c\u5982\u679c consumer \u8981\u6d88\u8d39\u7684\u6d88\u606f\u4e0d\u5728<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">page cache<\/code>\u91cc\uff0c\u624d\u4f1a\u53bb\u78c1\u76d8\u8bfb\u53d6\uff0c\u5e76\u4e14\u4f1a\u987a\u4fbf\u9884\u8bfb\u51fa\u4e00\u4e9b\u76f8\u90bb\u7684\u5757\u653e\u5165 page cache\uff0c\u4ee5\u65b9\u4fbf\u4e0b\u4e00\u6b21\u8bfb\u53d6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u56e0\u6b64\u5982\u679c Kafka producer \u7684\u751f\u4ea7\u901f\u7387\u4e0e consumer \u7684\u6d88\u8d39\u901f\u7387\u76f8\u5dee\u4e0d\u5927\uff0c\u90a3\u4e48\u5c31\u80fd\u51e0\u4e4e\u53ea\u9760\u5bf9 broker page cache \u7684\u8bfb\u5199\u5b8c\u6210\u6574\u4e2a\u751f\u4ea7 &#8211; \u6d88\u8d39\u8fc7\u7a0b\uff0c\u78c1\u76d8\u8bbf\u95ee\u975e\u5e38\u5c11\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u7f51\u7edc\u6a21\u578b<\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u7f51\u7edc\u561b\uff0c\u4f5c\u4e3a Java \u7a0b\u5e8f\u5458\uff0c\u81ea\u7136\u662f Netty<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u662f\u7684\uff0cNetty \u662f JVM \u9886\u57df\u4e00\u4e2a\u4f18\u79c0\u7684\u7f51\u7edc\u6846\u67b6\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6027\u80fd\u7684\u7f51\u7edc\u670d\u52a1\u3002\u5927\u591a\u6570 Java \u7a0b\u5e8f\u5458\u63d0\u5230\u7f51\u7edc\u6846\u67b6\uff0c\u9996\u5148\u60f3\u5230\u7684\u5c31\u662f Netty\u3002Dubbo\u3001Avro-RPC \u7b49\u7b49\u4f18\u79c0\u7684\u6846\u67b6\u90fd\u4f7f\u7528 Netty \u4f5c\u4e3a\u5e95\u5c42\u7684\u7f51\u7edc\u901a\u4fe1\u6846\u67b6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u81ea\u5df1\u5b9e\u73b0\u4e86\u7f51\u7edc\u6a21\u578b\u505a RPC\u3002\u5e95\u5c42\u57fa\u4e8e Java NIO\uff0c\u91c7\u7528\u548c Netty \u4e00\u6837\u7684 Reactor \u7ebf\u7a0b\u6a21\u578b\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-592e6620eb719a479ff3265180583073.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-592e6620eb719a479ff3265180583073.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.7108571428571429\" data-type=\"png\" data-w=\"875\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Reacotr \u6a21\u578b\u4e3b\u8981\u5206\u4e3a\u4e09\u4e2a\u89d2\u8272<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Reactor\uff1a\u628a IO \u4e8b\u4ef6\u5206\u914d\u7ed9\u5bf9\u5e94\u7684 handler \u5904\u7406<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Acceptor\uff1a\u5904\u7406\u5ba2\u6237\u7aef\u8fde\u63a5\u4e8b\u4ef6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Handler\uff1a\u5904\u7406\u975e\u963b\u585e\u7684\u4efb\u52a1<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u4f20\u7edf\u963b\u585e IO \u6a21\u578b\u4e2d\uff0c\u6bcf\u4e2a\u8fde\u63a5\u90fd\u9700\u8981\u72ec\u7acb\u7ebf\u7a0b\u5904\u7406\uff0c\u5f53\u5e76\u53d1\u6570\u5927\u65f6\uff0c\u521b\u5efa\u7ebf\u7a0b\u6570\u591a\uff0c\u5360\u7528\u8d44\u6e90\uff1b\u91c7\u7528\u963b\u585e IO \u6a21\u578b\uff0c\u8fde\u63a5\u5efa\u7acb\u540e\uff0c\u82e5\u5f53\u524d\u7ebf\u7a0b\u6ca1\u6709\u6570\u636e\u53ef\u8bfb\uff0c\u7ebf\u7a0b\u4f1a\u963b\u585e\u5728\u8bfb\u64cd\u4f5c\u4e0a\uff0c\u9020\u6210\u8d44\u6e90\u6d6a\u8d39<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9488\u5bf9\u4f20\u7edf\u963b\u585e IO \u6a21\u578b\u7684\u4e24\u4e2a\u95ee\u9898\uff0cReactor \u6a21\u578b\u57fa\u4e8e\u6c60\u5316\u601d\u60f3\uff0c\u907f\u514d\u4e3a\u6bcf\u4e2a\u8fde\u63a5\u521b\u5efa\u7ebf\u7a0b\uff0c\u8fde\u63a5\u5b8c\u6210\u540e\u5c06\u4e1a\u52a1\u5904\u7406\u4ea4\u7ed9\u7ebf\u7a0b\u6c60\u5904\u7406\uff1b\u57fa\u4e8e IO \u590d\u7528\u6a21\u578b\uff0c\u591a\u4e2a\u8fde\u63a5\u5171\u7528\u540c\u4e00\u4e2a\u963b\u585e\u5bf9\u8c61\uff0c\u4e0d\u7528\u7b49\u5f85\u6240\u6709\u7684\u8fde\u63a5\u3002\u904d\u5386\u5230\u6709\u65b0\u6570\u636e\u53ef\u4ee5\u5904\u7406\u65f6\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u901a\u77e5\u7a0b\u5e8f\uff0c\u7ebf\u7a0b\u8df3\u51fa\u963b\u585e\u72b6\u6001\uff0c\u8fdb\u884c\u4e1a\u52a1\u903b\u8f91\u5904\u7406<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u5373\u57fa\u4e8e Reactor \u6a21\u578b\u5b9e\u73b0\u4e86\u591a\u8def\u590d\u7528\u548c\u5904\u7406\u7ebf\u7a0b\u6c60\u3002\u5176\u8bbe\u8ba1\u5982\u4e0b\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-d135434f85215c9682f41d4d4eef34dc.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-d135434f85215c9682f41d4d4eef34dc.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3492990654205608\" data-type=\"png\" data-w=\"856\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u4e2d\u5305\u542b\u4e86\u4e00\u4e2a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Acceptor<\/code>\u7ebf\u7a0b\uff0c\u7528\u4e8e\u5904\u7406\u65b0\u7684\u8fde\u63a5\uff0c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Acceptor<\/code> \u6709 N \u4e2a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Processor<\/code> \u7ebf\u7a0b select \u548c read socket \u8bf7\u6c42\uff0cN \u4e2a <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Handler<\/code> \u7ebf\u7a0b\u5904\u7406\u8bf7\u6c42\u5e76\u76f8\u5e94\uff0c\u5373\u5904\u7406\u4e1a\u52a1\u903b\u8f91\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">I\/O \u591a\u8def\u590d\u7528\u53ef\u4ee5\u901a\u8fc7\u628a\u591a\u4e2a I\/O \u7684\u963b\u585e\u590d\u7528\u5230\u540c\u4e00\u4e2a select \u7684\u963b\u585e\u4e0a\uff0c\u4ece\u800c\u4f7f\u5f97\u7cfb\u7edf\u5728\u5355\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u53ef\u4ee5\u540c\u65f6\u5904\u7406\u591a\u4e2a\u5ba2\u6237\u7aef\u8bf7\u6c42\u3002\u5b83\u7684\u6700\u5927\u4f18\u52bf\u662f\u7cfb\u7edf\u5f00\u9500\u5c0f\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u521b\u5efa\u65b0\u7684\u8fdb\u7a0b\u6216\u8005\u7ebf\u7a0b\uff0c\u964d\u4f4e\u4e86\u7cfb\u7edf\u7684\u8d44\u6e90\u5f00\u9500\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-weight: bold; color: #f83929;\">\u603b\u7ed3\uff1a<\/span> Kafka Broker \u7684 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">KafkaServer<\/code> \u8bbe\u8ba1\u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u7f51\u7edc\u67b6\u6784\uff0c\u6709\u60f3\u4e86\u89e3 Java \u7f51\u7edc\u7f16\u7a0b\uff0c\u6216\u9700\u8981\u4f7f\u7528\u5230\u8fd9\u65b9\u9762\u6280\u672f\u7684\u540c\u5b66\u4e0d\u59a8\u53bb\u8bfb\u4e00\u8bfb\u6e90\u7801\u3002\u540e\u7eed\u300e\u7801\u54e5\u300f\u7684 Kafka \u7cfb\u5217\u6587\u7ae0\u4e5f\u5c06\u6d89\u53ca\u8fd9\u5757\u6e90\u7801\u7684\u89e3\u8bfb\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u6279\u91cf\u4e0e\u538b\u7f29<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka Producer \u5411 Broker \u53d1\u9001\u6d88\u606f\u4e0d\u662f\u4e00\u6761\u6d88\u606f\u4e00\u6761\u6d88\u606f\u7684\u53d1\u9001\u3002\u4f7f\u7528\u8fc7 Kafka \u7684\u540c\u5b66\u5e94\u8be5\u77e5\u9053\uff0cProducer \u6709\u4e24\u4e2a\u91cd\u8981\u7684\u53c2\u6570\uff1a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">batch.size<\/code>\u548c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">linger.ms<\/code>\u3002\u8fd9\u4e24\u4e2a\u53c2\u6570\u5c31\u548c Producer \u7684\u6279\u91cf\u53d1\u9001\u6709\u5173\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka Producer \u7684\u6267\u884c\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-7008450c10e2abad03402f555e5bf4a9.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-7008450c10e2abad03402f555e5bf4a9.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.36014405762304924\" data-type=\"png\" data-w=\"1666\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53d1\u9001\u6d88\u606f\u4f9d\u6b21\u7ecf\u8fc7\u4ee5\u4e0b\u5904\u7406\u5668\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Serialize\uff1a\u952e\u548c\u503c\u90fd\u6839\u636e\u4f20\u9012\u7684\u5e8f\u5217\u5316\u5668\u8fdb\u884c\u5e8f\u5217\u5316\u3002\u4f18\u79c0\u7684\u5e8f\u5217\u5316\u65b9\u5f0f\u53ef\u4ee5\u63d0\u9ad8\u7f51\u7edc\u4f20\u8f93\u7684\u6548\u7387\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Partition\uff1a\u51b3\u5b9a\u5c06\u6d88\u606f\u5199\u5165\u4e3b\u9898\u7684\u54ea\u4e2a\u5206\u533a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u9075\u5faa murmur2 \u7b97\u6cd5\u3002\u81ea\u5b9a\u4e49\u5206\u533a\u7a0b\u5e8f\u4e5f\u53ef\u4ee5\u4f20\u9012\u7ed9\u751f\u4ea7\u8005\uff0c\u4ee5\u63a7\u5236\u5e94\u5c06\u6d88\u606f\u5199\u5165\u54ea\u4e2a\u5206\u533a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Compress\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5728 Kafka \u751f\u4ea7\u8005\u4e2d\u4e0d\u542f\u7528\u538b\u7f29.Compression \u4e0d\u4ec5\u53ef\u4ee5\u66f4\u5feb\u5730\u4ece\u751f\u4ea7\u8005\u4f20\u8f93\u5230\u4ee3\u7406\uff0c\u8fd8\u53ef\u4ee5\u5728\u590d\u5236\u8fc7\u7a0b\u4e2d\u8fdb\u884c\u66f4\u5feb\u7684\u4f20\u8f93\u3002\u538b\u7f29\u6709\u52a9\u4e8e\u63d0\u9ad8\u541e\u5410\u91cf\uff0c\u964d\u4f4e\u5ef6\u8fdf\u5e76\u63d0\u9ad8\u78c1\u76d8\u5229\u7528\u7387\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Accumulate\uff1a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Accumulate<\/code>\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u4e00\u4e2a\u6d88\u606f\u7d2f\u8ba1\u5668\u3002\u5176\u5185\u90e8\u4e3a\u6bcf\u4e2a Partition \u7ef4\u62a4\u4e00\u4e2a<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Deque<\/code>\u53cc\u7aef\u961f\u5217\uff0c\u961f\u5217\u4fdd\u5b58\u5c06\u8981\u53d1\u9001\u7684\u6279\u6b21\u6570\u636e\uff0c<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">Accumulate<\/code>\u5c06\u6570\u636e\u7d2f\u8ba1\u5230\u4e00\u5b9a\u6570\u91cf\uff0c\u6216\u8005\u5728\u4e00\u5b9a\u8fc7\u671f\u65f6\u95f4\u5185\uff0c\u4fbf\u5c06\u6570\u636e\u4ee5\u6279\u6b21\u7684\u65b9\u5f0f\u53d1\u9001\u51fa\u53bb\u3002\u8bb0\u5f55\u88ab\u7d2f\u79ef\u5728\u4e3b\u9898\u6bcf\u4e2a\u5206\u533a\u7684\u7f13\u51b2\u533a\u4e2d\u3002\u6839\u636e\u751f\u4ea7\u8005\u6279\u6b21\u5927\u5c0f\u5c5e\u6027\u5c06\u8bb0\u5f55\u5206\u7ec4\u3002\u4e3b\u9898\u4e2d\u7684\u6bcf\u4e2a\u5206\u533a\u90fd\u6709\u4e00\u4e2a\u5355\u72ec\u7684\u7d2f\u52a0\u5668 \/ \u7f13\u51b2\u533a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Group Send\uff1a\u8bb0\u5f55\u7d2f\u79ef\u5668\u4e2d\u5206\u533a\u7684\u6279\u6b21\u6309\u5c06\u5b83\u4eec\u53d1\u9001\u5230\u7684\u4ee3\u7406\u5206\u7ec4\u3002\u6279\u5904\u7406\u4e2d\u7684\u8bb0\u5f55\u57fa\u4e8e batch.size \u548c linger.ms \u5c5e\u6027\u53d1\u9001\u5230\u4ee3\u7406\u3002\u8bb0\u5f55\u7531\u751f\u4ea7\u8005\u6839\u636e\u4e24\u4e2a\u6761\u4ef6\u53d1\u9001\u3002\u5f53\u8fbe\u5230\u5b9a\u4e49\u7684\u6279\u6b21\u5927\u5c0f\u6216\u8fbe\u5230\u5b9a\u4e49\u7684\u5ef6\u8fdf\u65f6\u95f4\u65f6\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u652f\u6301\u591a\u79cd\u538b\u7f29\u7b97\u6cd5\uff1alz4\u3001snappy\u3001gzip\u3002Kafka 2.1.0 \u6b63\u5f0f\u652f\u6301 ZStandard \u2014\u2014 ZStandard \u662f Facebook \u5f00\u6e90\u7684\u538b\u7f29\u7b97\u6cd5\uff0c\u65e8\u5728\u63d0\u4f9b\u8d85\u9ad8\u7684\u538b\u7f29\u6bd4 (compression ratio)\uff0c\u5177\u4f53\u7ec6\u8282\u53c2\u89c1 zstd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Producer\u3001Broker \u548c Consumer \u4f7f\u7528\u76f8\u540c\u7684\u538b\u7f29\u7b97\u6cd5\uff0c\u5728 producer \u5411 Broker \u5199\u5165\u6570\u636e\uff0cConsumer \u5411 Broker \u8bfb\u53d6\u6570\u636e\u65f6\u751a\u81f3\u53ef\u4ee5\u4e0d\u7528\u89e3\u538b\u7f29\uff0c\u6700\u7ec8\u5728 Consumer Poll \u5230\u6d88\u606f\u65f6\u624d\u89e3\u538b\uff0c\u8fd9\u6837\u8282\u7701\u4e86\u5927\u91cf\u7684\u7f51\u7edc\u548c\u78c1\u76d8\u5f00\u9500\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u5206\u533a\u5e76\u53d1<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u7684 Topic \u53ef\u4ee5\u5206\u6210\u591a\u4e2a Partition\uff0c\u6bcf\u4e2a Paritition \u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u961f\u5217\uff0c\u4fdd\u8bc1\u6570\u636e\u6709\u5e8f\u3002\u540c\u4e00\u4e2a Group \u4e0b\u7684\u4e0d\u540c Consumer \u5e76\u53d1\u6d88\u8d39 Paritition\uff0c\u5206\u533a\u5b9e\u9645\u4e0a\u662f\u8c03\u4f18 Kafka \u5e76\u884c\u5ea6\u7684\u6700\u5c0f\u5355\u5143\uff0c\u56e0\u6b64\uff0c\u53ef\u4ee5\u8bf4\uff0c\u6bcf\u589e\u52a0\u4e00\u4e2a Paritition \u5c31\u589e\u52a0\u4e86\u4e00\u4e2a\u6d88\u8d39\u5e76\u53d1\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-08ca5b98fbbbdcda12a6e004cc0627fb.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-08ca5b98fbbbdcda12a6e004cc0627fb.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.35125\" data-type=\"png\" data-w=\"800\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u5177\u6709\u4f18\u79c0\u7684\u5206\u533a\u5206\u914d\u7b97\u6cd5\u2014\u2014StickyAssignor\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u5206\u533a\u7684\u5206\u914d\u5c3d\u91cf\u5730\u5747\u8861\uff0c\u4e14\u6bcf\u4e00\u6b21\u91cd\u5206\u914d\u7684\u7ed3\u679c\u5c3d\u91cf\u4e0e\u4e0a\u4e00\u6b21\u5206\u914d\u7ed3\u679c\u4fdd\u6301\u4e00\u81f4\u3002\u8fd9\u6837\uff0c\u6574\u4e2a\u96c6\u7fa4\u7684\u5206\u533a\u5c3d\u91cf\u5730\u5747\u8861\uff0c\u5404\u4e2a Broker \u548c Consumer \u7684\u5904\u7406\u4e0d\u81f3\u4e8e\u51fa\u73b0\u592a\u5927\u7684\u503e\u659c\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\uff1a\u90a3\u662f\u4e0d\u662f\u5206\u533a\u6570\u8d8a\u591a\u8d8a\u597d\u5462\uff1f<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f53\u7136\u4e0d\u662f\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8d8a\u591a\u7684\u5206\u533a\u9700\u8981\u6253\u5f00\u66f4\u591a\u7684\u6587\u4ef6\u53e5\u67c4<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728 kafka \u7684 broker \u4e2d\uff0c\u6bcf\u4e2a\u5206\u533a\u90fd\u4f1a\u5bf9\u7167\u7740\u6587\u4ef6\u7cfb\u7edf\u7684\u4e00\u4e2a\u76ee\u5f55\u3002\u5728 kafka \u7684\u6570\u636e\u65e5\u5fd7\u6587\u4ef6\u76ee\u5f55\u4e2d\uff0c\u6bcf\u4e2a\u65e5\u5fd7\u6570\u636e\u6bb5\u90fd\u4f1a\u5206\u914d\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u7d22\u5f15\u6587\u4ef6\u548c\u4e00\u4e2a\u6570\u636e\u6587\u4ef6\u3002\u56e0\u6b64\uff0c\u968f\u7740 partition \u7684\u589e\u591a\uff0c\u9700\u8981\u7684\u6587\u4ef6\u53e5\u67c4\u6570\u6025\u5267\u589e\u52a0\uff0c\u5fc5\u8981\u65f6\u9700\u8981\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u5141\u8bb8\u6253\u5f00\u7684\u6587\u4ef6\u53e5\u67c4\u6570\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5ba2\u6237\u7aef \/ \u670d\u52a1\u5668\u7aef\u9700\u8981\u4f7f\u7528\u7684\u5185\u5b58\u5c31\u8d8a\u591a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5ba2\u6237\u7aef producer \u6709\u4e2a\u53c2\u6570 batch.size\uff0c\u9ed8\u8ba4\u662f 16KB\u3002\u5b83\u4f1a\u4e3a\u6bcf\u4e2a\u5206\u533a\u7f13\u5b58\u6d88\u606f\uff0c\u4e00\u65e6\u6ee1\u4e86\u5c31\u6253\u5305\u5c06\u6d88\u606f\u6279\u91cf\u53d1\u51fa\u3002\u770b\u4e0a\u53bb\u8fd9\u662f\u4e2a\u80fd\u591f\u63d0\u5347\u6027\u80fd\u7684\u8bbe\u8ba1\u3002\u4e0d\u8fc7\u5f88\u663e\u7136\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u53c2\u6570\u662f\u5206\u533a\u7ea7\u522b\u7684\uff0c\u5982\u679c\u5206\u533a\u6570\u8d8a\u591a\uff0c\u8fd9\u90e8\u5206\u7f13\u5b58\u6240\u9700\u7684\u5185\u5b58\u5360\u7528\u4e5f\u4f1a\u66f4\u591a\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u964d\u4f4e\u9ad8\u53ef\u7528\u6027<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5206\u533a\u8d8a\u591a\uff0c\u6bcf\u4e2a Broker \u4e0a\u5206\u914d\u7684\u5206\u533a\u4e5f\u5c31\u8d8a\u591a\uff0c\u5f53\u4e00\u4e2a\u53d1\u751f Broker \u5b95\u673a\uff0c\u90a3\u4e48\u6062\u590d\u65f6\u95f4\u5c06\u5f88\u957f\u3002<\/p>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u6587\u4ef6\u7ed3\u6784<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u6d88\u606f\u662f\u4ee5 Topic \u4e3a\u5355\u4f4d\u8fdb\u884c\u5f52\u7c7b\uff0c\u5404\u4e2a Topic \u4e4b\u95f4\u662f\u5f7c\u6b64\u72ec\u7acb\u7684\uff0c\u4e92\u4e0d\u5f71\u54cd\u3002\u6bcf\u4e2a Topic \u53c8\u53ef\u4ee5\u5206\u4e3a\u4e00\u4e2a\u6216\u591a\u4e2a\u5206\u533a\u3002\u6bcf\u4e2a\u5206\u533a\u5404\u81ea\u5b58\u5728\u4e00\u4e2a\u8bb0\u5f55\u6d88\u606f\u6570\u636e\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u6bcf\u4e2a\u5206\u533a\u65e5\u5fd7\u5728\u7269\u7406\u4e0a\u5b9e\u9645\u6309\u5927\u5c0f\u88ab\u5206\u6210\u591a\u4e2a Segment\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-c507263bae7b969302f9b876c8ada9d1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-c507263bae7b969302f9b876c8ada9d1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.42625\" data-type=\"png\" data-w=\"800\" \/><\/div><\/figure>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">segment file \u7ec4\u6210\uff1a\u7531 2 \u5927\u90e8\u5206\u7ec4\u6210\uff0c\u5206\u522b\u4e3a index file \u548c data file\uff0c\u6b64 2 \u4e2a\u6587\u4ef6\u4e00\u4e00\u5bf9\u5e94\uff0c\u6210\u5bf9\u51fa\u73b0\uff0c\u540e\u7f00\u201d.index\u201d\u548c\u201c.log\u201d\u5206\u522b\u8868\u793a\u4e3a segment \u7d22\u5f15\u6587\u4ef6\u3001\u6570\u636e\u6587\u4ef6\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">segment \u6587\u4ef6\u547d\u540d\u89c4\u5219\uff1apartion \u5168\u5c40\u7684\u7b2c\u4e00\u4e2a segment \u4ece 0 \u5f00\u59cb\uff0c\u540e\u7eed\u6bcf\u4e2a segment \u6587\u4ef6\u540d\u4e3a\u4e0a\u4e00\u4e2a segment \u6587\u4ef6\u6700\u540e\u4e00\u6761\u6d88\u606f\u7684 offset \u503c\u3002\u6570\u503c\u6700\u5927\u4e3a 64 \u4f4d long \u5927\u5c0f\uff0c19 \u4f4d\u6570\u5b57\u5b57\u7b26\u957f\u5ea6\uff0c\u6ca1\u6709\u6570\u5b57\u7528 0 \u586b\u5145\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">index \u91c7\u7528\u7a00\u758f\u7d22\u5f15\uff0c\u8fd9\u6837\u6bcf\u4e2a index \u6587\u4ef6\u5927\u5c0f\u6709\u9650\uff0cKafka \u91c7\u7528<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">mmap<\/code>\u7684\u65b9\u5f0f\uff0c\u76f4\u63a5\u5c06 index \u6587\u4ef6\u6620\u5c04\u5230\u5185\u5b58\uff0c\u8fd9\u6837\u5bf9 index \u7684\u64cd\u4f5c\u5c31\u4e0d\u9700\u8981\u64cd\u4f5c\u78c1\u76d8 IO\u3002<code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">mmap<\/code>\u7684 Java \u5b9e\u73b0\u5bf9\u5e94 <code style=\"font-size: 14px; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff5d6c;\">MappedByteBuffer<\/code> \u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; margin-bottom: 20px; margin-top: 20px; padding-top: 15px; padding-right: 10px; padding-bottom: 15px; line-height: 1.75; border-radius: 13px; color: #353535; background: #f5f5f5; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; font-size: 16px; margin-right: 10px; margin-left: 10px;\">65 \u54e5\u7b14\u8bb0\uff1ammap \u662f\u4e00\u79cd\u5185\u5b58\u6620\u5c04\u6587\u4ef6\u7684\u65b9\u6cd5\u3002\u5373\u5c06\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u5176\u5b83\u5bf9\u8c61\u6620\u5c04\u5230\u8fdb\u7a0b\u7684\u5730\u5740\u7a7a\u95f4\uff0c\u5b9e\u73b0\u6587\u4ef6\u78c1\u76d8\u5730\u5740\u548c\u8fdb\u7a0b\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4e2d\u4e00\u6bb5\u865a\u62df\u5730\u5740\u7684\u4e00\u4e00\u5bf9\u6620\u5173\u7cfb\u3002\u5b9e\u73b0\u8fd9\u6837\u7684\u6620\u5c04\u5173\u7cfb\u540e\uff0c\u8fdb\u7a0b\u5c31\u53ef\u4ee5\u91c7\u7528\u6307\u9488\u7684\u65b9\u5f0f\u8bfb\u5199\u64cd\u4f5c\u8fd9\u4e00\u6bb5\u5185\u5b58\uff0c\u800c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u56de\u5199\u810f\u9875\u9762\u5230\u5bf9\u5e94\u7684\u6587\u4ef6\u78c1\u76d8\u4e0a\uff0c\u5373\u5b8c\u6210\u4e86\u5bf9\u6587\u4ef6\u7684\u64cd\u4f5c\u800c\u4e0d\u5fc5\u518d\u8c03\u7528 read,write \u7b49\u7cfb\u7edf\u8c03\u7528\u51fd\u6570\u3002\u76f8\u53cd\uff0c\u5185\u6838\u7a7a\u95f4\u5bf9\u8fd9\u6bb5\u533a\u57df\u7684\u4fee\u6539\u4e5f\u76f4\u63a5\u53cd\u6620\u7528\u6237\u7a7a\u95f4\uff0c\u4ece\u800c\u53ef\u4ee5\u5b9e\u73b0\u4e0d\u540c\u8fdb\u7a0b\u95f4\u7684\u6587\u4ef6\u5171\u4eab\u3002<\/p>\n<p><span style=\"float: right; display: block; font-size: 2em; color: #f83929; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201d<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u5145\u5206\u5229\u7528\u4e8c\u5206\u6cd5\u6765\u67e5\u627e\u5bf9\u5e94 offset \u7684\u6d88\u606f\u4f4d\u7f6e\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 16px; overflow: hidden;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-5c1200d4279a616877bb642d19f57705.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"border-radius: 6px; display: block; margin: 20px auto; max-width: 95%; object-fit: contain;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2022\/01\/wxsync-2022-01-5c1200d4279a616877bb642d19f57705.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.75\" data-type=\"png\" data-w=\"1024\" \/><\/div><\/figure>\n<ol class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u6309\u7167\u4e8c\u5206\u6cd5\u627e\u5230\u5c0f\u4e8e offset \u7684 segment \u7684.log \u548c.index<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u7528\u76ee\u6807 offset \u51cf\u53bb\u6587\u4ef6\u540d\u4e2d\u7684 offset \u5f97\u5230\u6d88\u606f\u5728\u8fd9\u4e2a segment \u4e2d\u7684\u504f\u79fb\u91cf\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u518d\u6b21\u7528\u4e8c\u5206\u6cd5\u5728 index \u6587\u4ef6\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u7d22\u5f15\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u5230 log \u6587\u4ef6\u4e2d\uff0c\u987a\u5e8f\u67e5\u627e\uff0c\u76f4\u5230\u627e\u5230 offset \u5bf9\u5e94\u7684\u6d88\u606f\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"font-weight: bold; color: black; font-size: 22px; margin-top: 20px; margin-right: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #222222; display: inline-block; padding-left: 10px; border-left: 5px solid #f83929;\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Kafka \u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u5f00\u6e90\u9879\u76ee\u3002\u5176\u5728\u6027\u80fd\u4e0a\u9762\u7684\u4f18\u5316\u505a\u7684\u6dcb\u6f13\u5c3d\u81f4\uff0c\u662f\u5f88\u503c\u5f97\u6211\u4eec\u6df1\u5165\u5b66\u4e60\u7684\u4e00\u4e2a\u9879\u76ee\u3002\u65e0\u8bba\u662f\u601d\u60f3\u8fd8\u662f\u5b9e\u73b0\uff0c\u6211\u4eec\u90fd\u5e94\u8be5\u8ba4\u771f\u7684\u53bb\u770b\u4e00\u770b\uff0c\u60f3\u4e00\u60f3\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 1.75; margin-top: 0.8em; margin-bottom: 0.8em;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-weight: bold; color: #f83929;\">Kafka \u6027\u80fd\u4f18\u5316\uff1a<\/span><\/p>\n<ol class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: #f83929;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u96f6\u62f7\u8d1d\u7f51\u7edc\u548c\u78c1\u76d8<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u4f18\u79c0\u7684\u7f51\u7edc\u6a21\u578b\uff0c\u57fa\u4e8e Java NIO<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u9ad8\u6548\u7684\u6587\u4ef6\u6570\u636e\u7ed3\u6784\u8bbe\u8ba1<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">Parition \u5e76\u884c\u548c\u53ef\u6269\u5c55<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u6570\u636e\u6279\u91cf\u4f20\u8f93<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u6570\u636e\u538b\u7f29<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u987a\u5e8f\u8bfb\u5199\u78c1\u76d8<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #353535;\">\u65e0\u9501\u8f7b\u91cf\u7ea7 offset<\/section>\n<\/li>\n<\/ol>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u8bb2\u89e3\u6027\u80fd\u4f5c\u4e3a Kafka \u4e4b\u65c5\u7684\u5f00\u7bc7\u4e4b\u4f5c\uff0c\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u6df1\u5165\u4e86\u89e3 Kafka \u201c\u5feb\u201d\u7684\u5185\u90e8\u79d8\u5bc6\u3002\u4f60\u4e0d\u4ec5\u53ef\u4ee5\u5b66\u4e60 [&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-5679","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5679","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=5679"}],"version-history":[{"count":2,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5679\/revisions"}],"predecessor-version":[{"id":5802,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5679\/revisions\/5802"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}