{"id":59320,"date":"2023-10-28T11:35:37","date_gmt":"2023-10-28T03:35:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/?p=59320"},"modified":"2023-10-28T15:10:15","modified_gmt":"2023-10-28T07:10:15","slug":"%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96%e5%92%8c%e8%b0%83%e6%95%b4linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e7%bd%91%e7%bb%9c%e5%bb%b6%e8%bf%9f%e5%92%8c%e5%90%9e%e5%90%90%e9%87%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/59320.html","title":{"rendered":"\u5982\u4f55\u4f18\u5316\u548c\u8c03\u6574Linux\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5ef6\u8fdf\u548c\u541e\u5410\u91cf"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\">\n<p>\u200b\u7f51\u7edc\u6027\u80fd\u662fLinux\u670d\u52a1\u5668\u64cd\u4f5c\u7684\u6838\u5fc3\u3002\u4e3a\u4e86\u5b9e\u73b0\u66f4\u5feb\u3001\u66f4\u7a33\u5b9a\u7684\u670d\u52a1\uff0c\u4f60\u9700\u8981\uff1a1.\u76d1\u6d4b\u7f51\u7edc\u6027\u80fd\uff0c\u786e\u4fdd\u660e\u786e\u521d\u59cb\u72b6\u6001\uff1b2.\u8c03\u6574\u5185\u6838\u53c2\u6570\u4ee5\u5339\u914d\u5b9e\u9645\u9700\u6c42\uff1b3.\u4f18\u5316\u7f51\u7edc\u5806\u6808\uff1b4.\u9009\u62e9\u9002\u5f53\u7684\u7f51\u7edc\u8bbe\u5907\u548c\u9a71\u52a8\uff1b5.\u4f7f\u7528\u9ad8\u7ea7\u5de5\u5177\u8fdb\u884c\u8fdb\u4e00\u6b65\u4f18\u5316\u3002\u5f00\u59cb\u4f18\u5316\u524d\uff0c\u52a1\u5fc5\u7406\u89e3\u5f53\u524d\u7684\u7f51\u7edc\u72b6\u6001\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">1\uff0e\u76d1\u6d4b\u7f51\u7edc\u6027\u80fd\uff0c\u786e\u4fdd\u660e\u786e\u521d\u59cb\u72b6\u6001<\/h2>\n\n\n\n<p>\u5728\u8fdb\u884c\u4efb\u4f55\u4f18\u5316\u4e4b\u524d\uff0c\u9996\u5148\u8981\u660e\u786e\u5f53\u524d\u7f51\u7edc\u7684\u6027\u80fd\u72b6\u6001\u3002\u4f7f\u7528<strong>netstat<\/strong>, <strong>iftop<\/strong>, <strong>iperf<\/strong>, <strong>ping<\/strong>\u7b49\u5de5\u5177\u53ef\u4ee5\u63d0\u4f9b\u5927\u91cf\u5173\u4e8e\u670d\u52a1\u5668\u5f53\u524d\u7f51\u7edc\u6027\u80fd\u7684\u4fe1\u606f\u3002\u5e38\u89c1\u7684\u6307\u6807\u5305\u62ec\u5ef6\u8fdf\u3001\u541e\u5410\u91cf\u548c\u4e22\u5305\u7387\u3002\u53ea\u6709\u5728\u4e86\u89e3\u5f53\u524d\u72b6\u6001\u7684\u57fa\u7840\u4e0a\uff0c\u6211\u4eec\u624d\u80fd\u660e\u786e\u4f18\u5316\u7684\u65b9\u5411\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u8c03\u6574\u5185\u6838\u53c2\u6570\u4ee5\u5339\u914d\u5b9e\u9645\u9700\u6c42<\/h2>\n\n\n\n<p>&nbsp;Linux\u5185\u6838\u63d0\u4f9b\u4e86\u5927\u91cf\u53ef\u8c03\u6574\u7684\u7f51\u7edc\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u901a\u8fc7<strong>\/proc\/sys\/net<\/strong>\u8def\u5f84\u8fdb\u884c\u8bbf\u95ee\u548c\u8c03\u6574\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8c03\u6574TCP\u7684\u6700\u5927\u548c\u6700\u5c0f\u7f13\u51b2\u533a\u5927\u5c0f\uff0c\u4fee\u6539\u7f51\u7edc\u961f\u5217\u7684\u957f\u5ea6\u7b49\u3002\u8fd9\u4e9b\u8c03\u6574\u53ef\u4ee5\u5e2e\u52a9\u670d\u52a1\u5668\u66f4\u597d\u5730\u9002\u5e94\u4e0d\u540c\u7684\u7f51\u7edc\u73af\u5883\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u4f18\u5316\u7f51\u7edc\u5806\u6808<\/h2>\n\n\n\n<p>&nbsp;Linux\u7684\u7f51\u7edc\u5806\u6808\u8bbe\u8ba1\u5f97\u5f88\u7075\u6d3b\uff0c\u4f46\u9ed8\u8ba4\u8bbe\u7f6e\u53ef\u80fd\u4e0d\u9002\u5408\u6240\u6709\u573a\u666f\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8c03\u6574TCP\u7684\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u9009\u62e9\u5408\u9002\u7684\u7b97\u6cd5\uff08\u5982CUBIC\u3001BBR\u7b49\uff09\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7f51\u7edc\u6027\u80fd\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u7981\u7528\u4e0d\u5fc5\u8981\u7684\u7f51\u7edc\u670d\u52a1\u548c\u5b88\u62a4\u8fdb\u7a0b\u4e5f\u53ef\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u7f51\u7edc\u5e72\u6270\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4.\u9009\u62e9\u9002\u5f53\u7684\u7f51\u7edc\u8bbe\u5907\u548c\u9a71\u52a8<\/h2>\n\n\n\n<p>\u4e0d\u662f\u6240\u6709\u7684\u7f51\u7edc\u5361\u90fd\u662f\u76f8\u540c\u7684\u3002\u9009\u62e9\u9ad8\u6027\u80fd\u3001\u4e0eLinux\u826f\u597d\u517c\u5bb9\u7684\u7f51\u7edc\u5361\u548c\u9a71\u52a8\u53ef\u4ee5\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u7f51\u7edc\u6027\u80fd\u3002\u5f53\u9009\u62e9\u7f51\u7edc\u8bbe\u5907\u65f6\uff0c\u8003\u8651\u652f\u6301\u7684\u7279\u6027\uff08\u5982\u63a5\u6536\u4fa7\u6269\u5c55(RSS)\u3001TCP\u5378\u8f7d\u7b49\uff09\u4ee5\u53ca\u4e0eLinux\u7684\u517c\u5bb9\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5.\u4f7f\u7528\u9ad8\u7ea7\u5de5\u5177\u8fdb\u884c\u8fdb\u4e00\u6b65\u4f18\u5316<\/h2>\n\n\n\n<p>\u9664\u4e86\u4e0a\u8ff0\u57fa\u672c\u4f18\u5316\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u9ad8\u7ea7\u5de5\u5177\u8fdb\u4e00\u6b65\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u7f51\u7edc\u6027\u80fd\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<strong>tc<\/strong>\u5de5\u5177\u8fdb\u884c\u6d41\u91cf\u63a7\u5236\uff0c<strong>ethtool<\/strong>\u5de5\u5177\u8c03\u6574\u7f51\u7edc\u5361\u53c2\u6570\uff0c\u6216\u4f7f\u7528<strong>nftables<\/strong>\u6216<strong>iptables<\/strong>\u8fdb\u884c\u9ad8\u6548\u7684\u7f51\u7edc\u8fc7\u6ee4\u3002<\/p>\n\n\n\n<p>\u603b\u4e4b\uff0cLinux\u670d\u52a1\u5668\u7684\u7f51\u7edc\u6027\u80fd\u4f18\u5316\u662f\u4e00\u4e2a\u6301\u7eed\u7684\u8fc7\u7a0b\uff0c\u9700\u8981\u6839\u636e\u5b9e\u9645\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u3002\u53ea\u6709\u5145\u5206\u4e86\u89e3\u5f53\u524d\u7684\u7f51\u7edc\u72b6\u6001\uff0c\u5e76\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\u8fdb\u884c\u5408\u7406\u7684\u4f18\u5316\uff0c\u624d\u80fd\u786e\u4fdd\u670d\u52a1\u5668\u63d0\u4f9b\u9ad8\u6548\u3001\u7a33\u5b9a\u7684\u7f51\u7edc\u670d\u52a1\u3002\u8bb0\u4f4f\uff0c\u4e0d\u65ad\u7684\u76d1\u63a7\u548c\u6d4b\u8bd5\u662f\u6301\u7eed\u4f18\u5316\u7684\u5173\u952e\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"484\" height=\"300\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/10\/\u5982\u4f55\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u7ba1\u7406\u5b57\u4f53-66.png?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\" class=\"wp-image-59321\" \/><\/figure><\/div>\n\n\n<p><strong>\u5e38\u89c1\u95ee\u7b54\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Q1: \u4e3a\u4ec0\u4e48Linux\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5ef6\u8fdf\u548c\u541e\u5410\u91cf\u4f1a\u53d7\u5230\u5f71\u54cd\uff1f<\/strong><\/li>\n\n\n\n<li><strong>A1:<\/strong> Linux\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5ef6\u8fdf\u548c\u541e\u5410\u91cf\u53ef\u80fd\u4f1a\u53d7\u5230\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u7f51\u7edc\u786c\u4ef6\u3001\u670d\u52a1\u5668\u914d\u7f6e\u3001\u64cd\u4f5c\u7cfb\u7edf\u53c2\u6570\u3001\u7f51\u7edc\u62e5\u585e\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u7f51\u7edc\u4f7f\u7528\u6a21\u5f0f\u3002\u4e0d\u540c\u7684\u8bbe\u7f6e\u548c\u73af\u5883\u53ef\u80fd\u4f1a\u5bf9\u670d\u52a1\u5668\u7684\u7f51\u7edc\u6027\u80fd\u4ea7\u751f\u4e0d\u540c\u7684\u5f71\u54cd\u3002<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Q2: \u6211\u5982\u4f55\u8861\u91cf\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5ef6\u8fdf\u548c\u541e\u5410\u91cf\uff1f<\/strong><\/li>\n\n\n\n<li><strong>A2:<\/strong> \u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u548c\u65b9\u6cd5\u6765\u8861\u91cf\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5ef6\u8fdf\u548c\u541e\u5410\u91cf\u3002\u4f8b\u5982\uff0c<strong>ping<\/strong>\u547d\u4ee4\u53ef\u7528\u4e8e\u6d4b\u8bd5\u5ef6\u8fdf\uff0c\u800c<strong>iperf<\/strong>\u6216<strong>netperf<\/strong>\u53ef\u4ee5\u7528\u4e8e\u6d4b\u91cf\u7f51\u7edc\u541e\u5410\u91cf\u3002\u6700\u91cd\u8981\u7684\u662f\u5728\u8fdb\u884c\u4f18\u5316\u4e4b\u524d\u548c\u4e4b\u540e\u90fd\u8fdb\u884c\u6d4b\u91cf\uff0c\u4ee5\u4fbf\u4e86\u89e3\u4f18\u5316\u63aa\u65bd\u7684\u6548\u679c\u3002<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Q3: \u4f7f\u7528MTU (Maximum Transmission Unit) \u8c03\u6574\u5bf9\u7f51\u7edc\u6027\u80fd\u6709\u4f55\u5f71\u54cd\uff1f<\/strong><\/li>\n\n\n\n<li><strong>A3:<\/strong> MTU\u5b9a\u4e49\u4e86\u6570\u636e\u5305\u7684\u6700\u5927\u4f20\u8f93\u5355\u4f4d\u3002\u8f83\u5927\u7684MTU\u503c\u53ef\u80fd\u4f1a\u63d0\u9ad8\u541e\u5410\u91cf\uff0c\u4f46\u4e5f\u53ef\u80fd\u589e\u52a0\u5ef6\u8fdf\uff0c\u56e0\u4e3a\u5927\u7684\u6570\u636e\u5305\u9700\u8981\u66f4\u957f\u7684\u65f6\u95f4\u6765\u5904\u7406\u548c\u4f20\u8f93\u3002\u53cd\u4e4b\uff0c\u8f83\u5c0f\u7684MTU\u503c\u53ef\u80fd\u4f1a\u51cf\u5c11\u5ef6\u8fdf\uff0c\u4f46\u4e5f\u53ef\u80fd\u964d\u4f4e\u541e\u5410\u91cf\uff0c\u56e0\u4e3a\u9700\u8981\u53d1\u9001\u66f4\u591a\u7684\u5c0f\u5305\u6765\u4f20\u8f93\u76f8\u540c\u91cf\u7684\u6570\u636e\u3002\u6b63\u786e\u7684MTU\u8bbe\u7f6e\u53d6\u51b3\u4e8e\u7279\u5b9a\u7684\u7f51\u7edc\u548c\u5e94\u7528\u73af\u5883\u3002<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Q4: TCP BBR \u5bf9Linux\u670d\u52a1\u5668\u7684\u7f51\u7edc\u6027\u80fd\u6709\u4f55\u5e2e\u52a9\uff1f<\/strong><\/li>\n\n\n\n<li><strong>A4:<\/strong> TCP BBR (Bottleneck Bandwidth and RTT) \u662f\u4e00\u4e2a\u65b0\u7684\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u5b83\u53ef\u4ee5\u6839\u636e\u7f51\u7edc\u7684\u5e26\u5bbd\u548c\u5f80\u8fd4\u65f6\u95f4 (RTT) \u52a8\u6001\u5730\u8c03\u6574\u53d1\u9001\u901f\u7387\u3002\u76f8\u6bd4\u4f20\u7edf\u7684\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0cBBR \u53ef\u4ee5\u66f4\u6709\u6548\u5730\u5229\u7528\u53ef\u7528\u7684\u7f51\u7edc\u5e26\u5bbd\uff0c\u4ece\u800c\u63d0\u9ad8\u541e\u5410\u91cf\u5e76\u51cf\u5c11\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u200b\u7f51\u7edc\u6027\u80fd\u662fLinux\u670d\u52a1\u5668\u64cd\u4f5c\u7684\u6838\u5fc3\u3002\u4e3a\u4e86\u5b9e\u73b0\u66f4\u5feb\u3001\u66f4\u7a33\u5b9a\u7684\u670d\u52a1\uff0c\u4f60\u9700\u8981\uff1a1.\u76d1\u6d4b\u7f51\u7edc\u6027\u80fd\uff0c\u786e\u4fdd\u660e\u786e\u521d\u59cb\u72b6\u6001 [&hellip;]","protected":false},"author":7,"featured_media":59321,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/59320"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=59320"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/59320\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/59321"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=59320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=59320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=59320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}