{"id":120,"date":"2017-08-07T01:53:11","date_gmt":"2017-08-07T01:53:11","guid":{"rendered":"https:\/\/oimi.me\/?p=120"},"modified":"2017-08-07T01:53:11","modified_gmt":"2017-08-07T01:53:11","slug":"debian-ubuntu-%e6%9b%b4%e6%96%b0%e5%86%85%e6%a0%b8%e5%b9%b6%e5%bc%80%e5%90%af-tcp-bbr-%e6%8b%a5%e5%a1%9e%e6%8e%a7%e5%88%b6%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/myya.net\/index.php\/2017\/08\/07\/debian-ubuntu-%e6%9b%b4%e6%96%b0%e5%86%85%e6%a0%b8%e5%b9%b6%e5%bc%80%e5%90%af-tcp-bbr-%e6%8b%a5%e5%a1%9e%e6%8e%a7%e5%88%b6%e7%ae%97%e6%b3%95\/","title":{"rendered":"Debian \/ Ubuntu \u66f4\u65b0\u5185\u6838\u5e76\u5f00\u542f TCP BBR \u62e5\u585e\u63a7\u5236\u7b97\u6cd5"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/google\/bbr\">BBR<\/a> (Bottleneck Bandwidth and RTT) \u662f Google \u63d0\u4f9b\u7684 TCP \u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u9002\u7528\u4e8e\u590d\u6742\u7f51\u7edc\u73af\u5883\u4e0b\u7684 TCP \u52a0\u901f\u3002\u7531\u4e8e\u4f17\u6240\u5468\u77e5\u7684\u539f\u56e0\uff0c\u5929\u671d\u7684\u7f51\u7edc\u60c5\u51b5\u5728\u5168\u4e16\u754c\u90fd\u6392\u5f97\u4e0a\u53f7\uff0c\u5f88\u591a\u60c5\u51b5\u4e0b\u6211\u4eec\u4e0d\u5f97\u4e0d\u8fdb\u884c\u4e00\u4e9b\u7ec6\u5c0f\u7684\u4f18\u5316\u624d\u80fd\u8fbe\u5230\u6ee1\u610f\u7684\u6548\u679c\u3002<!--more--><\/p>\n<p>\u8bdd\u4e0d\u591a\u8bf4\u4e86\uff0c\u9996\u5148\u9700\u8981\u51c6\u5907\u7684\u6761\u4ef6<\/p>\n<ol>\n<li>Debian 8.x \u6216\u8005 Debian 9.x \u7cfb\u7edf\uff0c\u5f53\u7136\u4ee5\u4e0b\u6559\u7a0b\u4e5f\u9002\u5408 Ubuntu 14.04 \u6216 Ubuntu 16.04<\/li>\n<li>\u5982\u679c\u662f\u865a\u62df\u673a\uff0c\u90a3\u4e48\u5f97\u4f7f\u7528 KVM \u6216 Xen \u7b49\u53ef\u4ee5\u4fee\u6539\u5185\u6838\u7684\u5e73\u53f0\uff0cOpenVZ \u65b9\u6cd5\u6211\u4eec\u4e0d\u505a\u4ecb\u7ecd<\/li>\n<li>\u5982\u679c\u4e0d\u662f\u65b0\u7684\u673a\u5668\uff0c\u8bf7\u4e8b\u5148\u505a\u597d\u5907\u4efd\uff0c\u56e0\u4e3a\u5185\u6838\u4e07\u4e00\u6302\u4e86\u673a\u5668\u542f\u52a8\u4e0d\u8d77\u6765\u662f\u4e00\u4ef6\u53ca\u5176\u9ebb\u70e6\u7684\u4e8b\u60c5<\/li>\n<\/ol>\n<h2 id=\"1\"><span id=\"h-1\"><\/span>1\u3001\u5347\u7ea7\u5185\u6838<\/h2>\n<p>BBR \u53ea\u652f\u6301 4.9.x \u4ee5\u4e0a\u7684\u5185\u6838\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u66f4\u65b0\u5347\u7ea7\u4ee5\u4e0b<\/p>\n<p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f Debian 9.x\uff0c\u90a3\u4e48\u8fd9\u4e00\u6b65\u53ef\u4ee5\u76f4\u63a5\u8df3\u8fc7\uff0c\u5176\u4ed6\u4e09\u4e2a\u5185\u6838\u7248\u672c\u8f83\u65e7\u7684\u7cfb\u7edf\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 Ubuntu \u6253\u5305\u597d\u7684<a href=\"http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/\">\u5185\u6838\u5b89\u88c5\u5305<\/a><\/p>\n<p>\u9996\u5148\uff0c\u627e\u5230 4.9.x \u4ee5\u4e0a\u7248\u672c\u7684\u7a33\u5b9a\u5185\u6838\uff0c\u8fd9\u91cc\u6211\u4eec\u63a8\u8350\u4f7f\u7528 LTS \u7248\u672c\uff0c\u76ee\u524d\u6700\u65b0\u7684\u662f 4.9.40 \u4e0b\u8f7d\u5b89\u88c5\u5373\u53ef<\/p>\n<pre class=\"hljs nginx\"><code class=\"language-bash\"><span class=\"hljs-attribute\">mkdir<\/span> kernel-tmp &amp;&amp; cd kernel-tmp\nwget http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/v4.9.40\/linux-headers-4.9.40-040940_4.9.40-040940.201707271932_all.deb\nwget http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/v4.9.40\/linux-headers-4.9.40-040940-generic_4.9.40-040940.201707271932_amd64.deb\nwget http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/v4.9.40\/linux-image-4.9.40-040940-generic_4.9.40-040940.201707271932_amd64.deb\nsudo dpkg -i <span class=\"hljs-regexp\">*.deb<\/span>\n<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8c\u4ee5\u540e\u76f4\u63a5 reboot \u91cd\u542f\uff0c\u4e00\u5207\u987a\u5229\u7684\u8bdd\u8bf7\u68c0\u67e5\u4ee5\u4e0b\u5f53\u524d\u7684\u5185\u6838\u7248\u672c<\/p>\n<pre class=\"hljs coffeescript\"><code class=\"language-bash\">root@debian ~ <span class=\"hljs-comment\"># uname -r<\/span>\n<span class=\"hljs-number\">4.9<\/span><span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">-3<\/span>-amd64\n<\/code><\/pre>\n<h2 id=\"2\"><span id=\"h-2\"><\/span>2\u3001\u5199\u5165\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u76f4\u63a5\u4fee\u6539 <code>\/etc\/sysctl.conf<\/code> \u6587\u4ef6\u5373\u53ef<\/p>\n<pre class=\"hljs ruby\"><code class=\"language-bash\">cat <span class=\"hljs-meta\">&gt;&gt; <\/span>\/etc\/sysctl.conf &lt;&lt; EOF\nnet.core.default_qdisc=fq\nnet.ipv4.tcp_congestion_control=bbr\nEOF\n<\/code><\/pre>\n<p>\u7136\u540e\u4f7f\u7528 <code>sysctl -p<\/code> \u547d\u4ee4\u8ba9\u5185\u6838\u914d\u7f6e\u751f\u6548\uff0c\u4e0d\u51fa\u610f\u5916\uff0c\u5e94\u8be5\u4f1a\u63d0\u793a<\/p>\n<pre class=\"hljs coffeescript\"><code class=\"language-bash\">root@debian ~ <span class=\"hljs-comment\"># sysctl -p<\/span>\nnet.core.default_qdisc = fq\nnet.ipv4.tcp_congestion_control = bbr\n<\/code><\/pre>\n<p>\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528 <code>lsmod | grep bbr<\/code> \u547d\u4ee4\u68c0\u67e5 BBR \u662f\u5426\u5df2\u6b63\u786e\u5f00\u542f<\/p>\n<pre class=\"hljs coffeescript\"><code class=\"language-bash\">root@debian ~ <span class=\"hljs-comment\"># lsmod | grep bbr<\/span>\ntcp_bbr                <span class=\"hljs-number\">16384<\/span>  <span class=\"hljs-number\">61<\/span>\n<\/code><\/pre>\n<p>\u5982\u679c\u51fa\u73b0 <code>tcp_bbr<\/code> \u5b57\u6837\u5219\u8bf4\u660e\u6ca1\u6709\u95ee\u9898<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BBR (Bottleneck Bandwidth and RTT) \u662f Google \u63d0\u4f9b\u7684 TCP \u62e5\u585e\u63a7 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[10],"tags":[80,288],"class_list":["post-120","post","type-post","status-publish","format-aside","hentry","category-hardware","tag-debian","tag-tcp-bbr","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":0,"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"wp:attachment":[{"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myya.net\/index.php\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}