{"id":378,"date":"2018-08-26T21:12:12","date_gmt":"2018-08-26T13:12:12","guid":{"rendered":"http:\/\/blog.lovexu.cc\/?p=378"},"modified":"2022-09-17T12:14:46","modified_gmt":"2022-09-17T04:14:46","slug":"%e5%8d%87%e7%ba%a7ubuntu%e5%86%85%e6%a0%b8%e5%bc%80%e5%90%afbbr%e5%8a%a0%e9%80%9f","status":"publish","type":"post","link":"https:\/\/lox.im\/index.php\/378.html","title":{"rendered":"\u5347\u7ea7Ubuntu\u5185\u6838\u5f00\u542fBBR\u52a0\u901f"},"content":{"rendered":"<p>BBR\u662f\u5565\uff0c\u6709\u4ec0\u4e48\u7528\u6211\u4e0d\u77e5\u9053\uff0c\u6211\u53ea\u77e5\u9053\u8c37\u6b4c\u51fa\u54c1\uff0c\u5fc5\u5c5e\u7cbe\u54c1\uff1b\u661f\u5bbf\u8001\u4ed9\uff0c\u6cd5\u529b\u65e0\u8fb9\u3002linux\u5185\u6838\u7248\u672c\u8981\u9ad8\u4e8e4.9\uff0c\u624d\u652f\u6301BBR\uff0c\u6240\u4ee5\u4eca\u5929\u8bb2\u4e00\u8bb2Ubuntu\u5185\u6838\u7248\u672c\u7684\u5347\u7ea7\u64cd\u4f5c\u3002<\/p>\n<p>\u9996\u5148\u67e5\u770b\u5f53\u524d\u5185\u6838\u7248\u672c\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# uname -r\r\n4.4.0-83-generic\r\n<\/code><\/pre>\n<p>\u5f97\u5230\u4e24\u4e2a\u4fe1\u606f\uff0c\u7248\u672c\u53f74.4\u660e\u663e\u4e0d\u591f\uff0c\u8fd8\u6709\u540e\u9762\u4e00\u4e2ageneric\uff0c\u4e0b\u6587\u8981\u7528\u5230\u3002\u987a\u4fbf\u770b\u4e00\u4e0b\u7cfb\u7edf\u4f4d\u6570\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# arch\r\nx86_64\r\n<\/code><\/pre>\n<h2 id=\"\u5347\u7ea7Ubuntu\u5185\u6838\">\u5347\u7ea7Ubuntu\u5185\u6838<\/h2>\n<p>Ubuntu\u7684\u6700\u65b0\u5185\u6838\u53ef\u4ee5\u5728http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/ \u627e\u5230\uff0c\u6253\u5f00\u7f51\u9875\u540e\uff0c\u6309End\u952e\uff0c\u8df3\u5230\u6700\u4e0b\u9762\uff0c\u627e\u4e00\u4e2a\u7248\u672c\u6700\u5927\uff0c\u4e0d\u5e26rc\u5b57\u6837\u7684\u94fe\u63a5\u70b9\u51fb\u8fdb\u53bb\uff0c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-693\" src=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/1-2.jpg\" width=\"403\" height=\"210\" alt=\"1-2\" title=\"1-2\" srcset=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/1-2.jpg 403w, https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/1-2-300x156.jpg 300w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u9009\u62e94.12.4\uff0c\u70b9\u51fb\u8fdb\u53bb\u540e\uff0c\u4e00\u5927\u5806\u5185\u6838\u7684\u94fe\u63a5\uff0c\u6211\u4eec\u4e0b\u8f7d\u54ea\u4e00\u4e2a\u5462\uff1f\u6587\u672c\u5f00\u59cb\uff0c\u6211\u4eec\u901a\u8fc7uname -r\u62ff\u5230\u4e00\u4e2ageneric\uff0c\u901a\u8fc7arch\u786e\u5b9a\u7cfb\u7edf\u4e3a64\u4f4d\uff0c\u73b0\u5728\u8fd9\u4e24\u4e2a\u4e1c\u897f\u5c31\u6709\u7528\u4e86\uff0c\u6b64\u65f6\u6211\u4eec\u5728\u6d4f\u89c8\u5668\u7a97\u53e3\u6309\u4e0bF3\u6267\u884c\u641c\u7d22\uff0c\u7531\u4e8e\u8fd9\u4e2a\u641c\u7d22\u6846\u4e0d\u652f\u6301\u6b63\u5219\uff0c\u6211\u4eec\u53ea\u80fd\u641camd64\u5b57\u6837\uff0c\u7136\u540e\u76ee\u6d4bgeneric\uff0c\u8fd9\u91cc\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u4e3a\u4ec0\u4e4864\u4f4d\u67b6\u6784\u8981\u53ebamd64\u5462\uff0c\u867d\u7136\u73b0\u5728amd\u88ab\u7259\u818f\u5382\u540a\u6253\uff0c\u4f46\u4e16\u754c\u4e0a\u7b2c\u4e00\u679a64\u4f4d\u7684\u5904\u7406\u5668\u786e\u662fAMD\u53d1\u5e03\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-694\" src=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/2-1.jpg\" width=\"845\" height=\"451\" alt=\"2-1\" title=\"2-1\" srcset=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/2-1.jpg 845w, https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/2-1-300x160.jpg 300w, https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/2-1-768x410.jpg 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/p>\n<p>\u4e0b\u8f7d\u5185\u6838\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# wget http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/v4.12.4\/linux-<a href=\"https:\/\/www.centos.bz\/tag\/image\/\" target=\"_blank\"  rel=\"nofollow\" >image<\/a>-4.12.4-041204-generic_4.12.4-041204.201707271932_amd64.deb\r\n<\/code><\/pre>\n<p>\u5b89\u88c5\u5185\u6838\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# dpkg -i linux-image-4.12.4-041204-generic_4.12.4-041204.201707271932_amd64.deb \r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-695\" src=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/3-1.jpg\" width=\"969\" height=\"480\" alt=\"3-1\" title=\"3-1\" srcset=\"https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/3-1.jpg 969w, https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/3-1-300x149.jpg 300w, https:\/\/lox.im\/wp-content\/uploads\/2020\/05\/3-1-768x380.jpg 768w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/p>\n<p>\u6700\u540e\uff0c\u6267\u884c\u547d\u4ee4update-grub\uff0c\u66f4\u65b0grub\u5f15\u5bfc\u4f7f\u7528\u65b0\u7684\u5185\u6838\u3002<\/p>\n<pre><code>root@HuangQiDi:~# update-grub\r\nGenerating grub configuration file ...\r\nFound linux image: \/boot\/vmlinuz-4.12.4-041204-generic\r\nFound initrd image: \/boot\/initrd.img-4.12.4-041204-generic\r\nFound linux image: \/boot\/vmlinuz-4.4.0-83-generic\r\nFound initrd image: \/boot\/initrd.img-4.4.0-83-generic\r\ndone\r\n<\/code><\/pre>\n<p>\u8fd9\u91cc\u5f88\u591a\u6709\u6d01\u7656\u7684\u4eba\u559c\u6b22\u5220\u9664\u65e7\u5185\u6838\uff0c\u6211\u7279\u522b\u4e0d\u5efa\u8bae\u8fd9\u4e48\u505a\uff0c\u4e00\u4e2a\u5185\u6838\u624d\u591a\u5927\u554a\uff0c\u4e07\u4e00\u65b0\u5185\u6838\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\uff0c\u90a3\u4e0d\u662f\u81ea\u627e\u9ebb\u70e6\u5417\u3002<br \/>\n\u91cd\u542f\u7cfb\u7edf\u540e\u68c0\u67e5\u5185\u6838\u662f\u5426\u6210\u529f\u5347\u7ea7\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# uname -r\r\n4.12.4-041204-generic\r\n<\/code><\/pre>\n<h2 id=\"\u542f\u7528BBR\">\u542f\u7528BBR<\/h2>\n<pre><code>root@HuangQiDi:~# echo \"net.core.default_qdisc=fq\" &gt;&gt; \/etc\/sysctl.conf\r\nroot@HuangQiDi:~# echo \"net.ipv4.tcp_congestion_control=bbr\" &gt;&gt; \/etc\/sysctl.conf\r\nroot@HuangQiDi:~# sysctl -p\r\nnet.core.default_qdisc = fq\r\nnet.ipv4.tcp_congestion_control = bbr\r\n<\/code><\/pre>\n<p>net.core.default_qdisc\u7684\u503c\u771f\u6709\u610f\u601dfq\uff0c\u756a\u8304\u756a\u8304\u3002<br \/>\n\u6b64\u65f6\u6267\u884csysctl net.ipv4.tcp_available_congestion_control\uff0c\u82e5\u8fd4\u56de\u7ed3\u679c\u4e3a\u201cnet.ipv4.tcp_available_congestion_control = bbr cubic reno\u201d\uff0c\u8868\u793aBBR\u6a21\u5757\u5f00\u542f\u6210\u529f\u3002<\/p>\n<p>\u6700\u540e\u6765\u7a0d\u5fae\u770b\u4e0b\u8fd9\u4e2aBBR\u6a21\u5757<\/p>\n<pre><code>root@HuangQiDi:~# lsmod | sed -n '1p;\/bbr\/p'\r\n<a href=\"https:\/\/www.centos.bz\/tag\/module\/\" target=\"_blank\"  rel=\"nofollow\" >Module<\/a>                  Size  Used by\r\ntcp_bbr                20480  0\r\n<\/code><\/pre>\n<p>Used by\u4e0b\u9762\u76840\uff0c\u8868\u793a\u8be5\u6a21\u5757\u53ef\u4ee5\u968f\u65f6\u5378\u8f7d\u3002\u5378\u8f7d\u547d\u4ee4\u4e3amodprobe -r tcp_bbr<\/p>\n<p>\u67e5\u770b\u6a21\u5757\u8be6\u7ec6\u4fe1\u606f\uff1a<\/p>\n<pre><code>root@HuangQiDi:~# modinfo tcp_bbr\r\nfilename:       \/lib\/<a href=\"https:\/\/www.centos.bz\/tag\/modules\/\" target=\"_blank\"  rel=\"nofollow\" >modules<\/a>\/4.12.4-041204-generic\/kernel\/net\/ipv4\/tcp_bbr.ko\r\ndescription:    TCP BBR (Bottleneck Bandwidth and RTT)\r\nlicense:        Dual BSD\/GPL\r\n<a href=\"https:\/\/www.centos.bz\/tag\/author\/\" target=\"_blank\"  rel=\"nofollow\" >author<\/a>:         Soheil Hassas Yeganeh \r\nauthor:         Yuchung Cheng &lt;ycheng@<a href=\"https:\/\/www.centos.bz\/tag\/google\/\" target=\"_blank\"  rel=\"nofollow\" >google<\/a>.com&gt;\r\nauthor:         Neal Cardwell \r\nauthor:         Van Jacobson \r\nsrcversion:     3D237D080AC188DD9000A9A\r\ndepends:        \r\nintree:         Y\r\nvermagic:       4.12.4-041204-generic SMP mod_unload\r\n<\/code><\/pre>\n<p class=\"post-copyright\">\u539f\u6587\u51fa\u5904\uff1ahqidi -&gt;\u00a0<a href=\"http:\/\/hqidi.com\/94.html\" rel=\"nofollow\" target=\"_blank\" >http:\/\/hqidi.com\/94.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>BBR\u662f\u5565\uff0c\u6709\u4ec0\u4e48\u7528\u6211\u4e0d\u77e5\u9053\uff0c\u6211\u53ea\u77e5\u9053\u8c37\u6b4c\u51fa\u54c1\uff0c\u5fc5\u5c5e\u7cbe\u54c1\uff1b\u661f\u5bbf\u8001\u4ed9\uff0c\u6cd5\u529b\u65e0\u8fb9\u3002linux\u5185\u6838\u7248\u672c\u8981\u9ad8\u4e8e4.9\uff0c\u624d\u652f\u6301BBR\uff0c\u6240\u4ee5\u4eca &#8230;<\/p>\n","protected":false},"author":1,"featured_media":379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[4],"tags":[24],"class_list":["post-378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-internet","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":4,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"predecessor-version":[{"id":829,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions\/829"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/media\/379"}],"wp:attachment":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}