{"id":36,"date":"2019-01-02T18:33:12","date_gmt":"2019-01-02T10:33:12","guid":{"rendered":"http:\/\/149.129.64.77\/?p=36"},"modified":"2019-01-11T18:22:29","modified_gmt":"2019-01-11T10:22:29","slug":"centos7-%e5%bc%80%e5%90%afgoogle-bbr%e5%8a%a0%e9%80%9f","status":"publish","type":"post","link":"http:\/\/blog.inhowe.com\/index.php\/2019\/01\/02\/centos7-%e5%bc%80%e5%90%afgoogle-bbr%e5%8a%a0%e9%80%9f\/","title":{"rendered":"CentOS7\u5347\u7ea7\u5185\u6838\u5e76\u5f00\u542fGoogle BBR\u52a0\u901f"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\u81ea\uff1a<a href=\"https:\/\/laod.cn\/black-technology\/centos7-google-bbr-vps.html\">https:\/\/laod.cn\/black-technology\/centos7-google-bbr-vps.html<\/a>\uff0c\u5e76\u8fdb\u884c\u4e86\u52d8\u8bef\u3002<br>\u53c2\u8003\u6587\u732e\uff1a<a href=\"https:\/\/www.openos.org\/post\/291\/\">CentOS 7\u5b89\u88c5\u6307\u5b9a\u5185\u6838 \u5e76\u542f\u52a8BBR\u52a0\u901f <\/a><\/p>\n\n\n\n<p>BBR \u662f Google \u63d0\u51fa\u7684\u4e00\u79cd\u65b0\u578b\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u53ef\u4ee5\u4f7f Linux \u670d\u52a1\u5668\u663e\u8457\u5730\u63d0\u9ad8\u541e\u5410\u91cf\u548c\u51cf\u5c11 TCP \u8fde\u63a5\u7684\u5ef6\u8fdf\u3002<\/p>\n\n\n\n<p>BBR\u89e3\u51b3\u4e86\u4e24\u4e2a\u95ee\u9898\uff1a<\/p>\n\n\n\n<p>\u518d\u6709\u4e00\u5b9a\u4e22\u5305\u7387\u7684\u7f51\u7edc\u94fe\u8def\u4e0a\u5145\u5206\u5229\u7528\u5e26\u5bbd\u3002\u975e\u5e38\u9002\u5408\u9ad8\u5ef6\u8fdf\uff0c\u9ad8\u5e26\u5bbd\u7684\u7f51\u7edc\u94fe\u8def\u3002<\/p>\n\n\n\n<p>\u964d\u4f4e\u7f51\u7edc\u94fe\u8def\u4e0a\u7684buffer\u5360\u7528\u7387\uff0c\u4ece\u800c\u964d\u4f4e\u5ef6\u8fdf\u3002\u975e\u5e38\u9002\u5408\u6162\u901f\u63a5\u5165\u7f51\u7edc\u7684\u7528\u6237\u3002<\/p>\n\n\n\n<p>\u9879\u76ee\u5730\u5740:https:\/\/github.com\/google\/bbr<\/p>\n\n\n\n<h4 id=\"title-0\">\u5347\u7ea7\u5185\u6838<\/h4>\n\n\n\n<p>\u5f00\u542f BBR \u8981\u6c42 4.10 \u4ee5\u4e0a\u7248\u672c Linux \u5185\u6838\uff0c\u53ef\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u5185\u6838\u7248\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">uname&nbsp;-r<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u5f97\u5230\u7c7b\u4f3c\u5982\u4e0b\u7684\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">3.10.0-514.10.2.el7.x86_64<\/pre>\n\n\n\n<p>\u5982\u679c\u5f53\u524d\u5185\u6838\u7248\u672c\u4f4e\u4e8e 4.10\uff0c\u53ef\u4f7f\u7528 ELRepo \u6e90\u66f4\u65b0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo&nbsp;rpm&nbsp;--import&nbsp;https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org<br>$ sudo&nbsp;rpm&nbsp;-Uvh&nbsp;http:\/\/www.elrepo.org\/elrepo-release-7.0-2.el7.elrepo.noarch.rpm<br>$ sudo&nbsp;yum&nbsp;--enablerepo=elrepo-kernel&nbsp;install&nbsp;kernel-ml&nbsp;-y<\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u5185\u6838\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rpm&nbsp;-qa&nbsp;|&nbsp;grep&nbsp;kernel<\/pre>\n\n\n\n<p>\u5f97\u5230\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kernel-3.10.0-123.el7.x86_64<br>kernel-headers-3.10.0-514.16.1.el7.x86_64 <br>kernel-ml-4.11.0-1.el7.elrepo.x86_64 <br>kernel-tools-3.10.0-514.16.1.el7.x86_64 <br>kernel-3.10.0-514.16.1.el7.x86_64<br>kernel-tools-libs-3.10.0-514.16.1.el7.x86_64<\/pre>\n\n\n\n<p>\u5728\u8f93\u51fa\u4e2d\u770b\u5230&nbsp;kernel-ml-4.11.0-1.el7.elrepo.x86_64<strong>&nbsp;<\/strong>\u7c7b\u4f3c\u7684\u5185\u5bb9\uff0c\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<p><strong>\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u90e8\u7f72\u4e86\u5b9d\u5854\u5e94\u7528\u5219\u5e94\u5c0f\u5fc3\uff1a\u8fc7\u9ad8\u7248\u672c\u7684\u5185\u6838\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u76d1\u63a7\u529f\u80fd\u6545\u969c\u3002<\/strong>\u56e0\u6b64\u53ef\u4ee5\u5347\u7ea7\u5230\u6307\u5b9a\u7248\u672c\u7684\u5185\u6838\uff0c\u76ee\u524d 5.2\u7248\u672c\u7684\u5b9d\u5854\u5e94\u7528\u5728\u75284.18.16-1.el7.elrepo.x86_64 \u7684\u5185\u6838\u662f\u6ca1\u6709\u95ee\u9898\u7684\uff0c\u53ef\u53c2\u8003\u5982\u4e0b\u4ee3\u7801\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget http:\/\/mirror.rc.usf.edu\/compute_lock\/elrepo\/kernel\/el7\/x86_64\/RPMS\/kernel-ml-4.18.16-1.el7.elrepo.x86_64.rpm <br>wget http:\/\/mirror.rc.usf.edu\/compute_lock\/elrepo\/kernel\/el7\/x86_64\/RPMS\/kernel-ml-headers-4.18.16-1.el7.elrepo.x86_64.rpm <br>wget http:\/\/mirror.rc.usf.edu\/compute_lock\/elrepo\/kernel\/el7\/x86_64\/RPMS\/kernel-ml-devel-4.18.16-1.el7.elrepo.x86_64.rpm <br><br>yum install kernel-ml-4.18.16-1.el7.elrepo.x86_64.rpm -y <br>yum install kernel-ml-headers-4.18.16-1.el7.elrepo.x86_64.rpm -y <br>yum install kernel-ml-devel-4.18.16-1.el7.elrepo.x86_64.rpm -y <\/pre>\n\n\n\n<h4 id=\"title-1\">\u4fee\u6539grub2\u5f15\u5bfc<\/h4>\n\n\n\n<p>\u6267\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo egrep ^menuentry \/etc\/grub2.cfg | cut -f 2 -d&nbsp;\\'<\/pre>\n\n\n\n<p>\u4f1a\u5f97\u5230\u5982\u4e0b\u7c7b\u4f3c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CentOS&nbsp;Linux&nbsp;7&nbsp;Rescue&nbsp;a0cbf86a6ef1416a8812657bb4f2b860&nbsp;(4.11.0-1.el7.elrepo.x86_64)<br>CentOS&nbsp;Linux&nbsp;(4.11.0-1.el7.elrepo.x86_64)&nbsp;7&nbsp;(Core)<br>CentOS&nbsp;Linux&nbsp;(3.10.0-514.16.1.el7.x86_64)&nbsp;7&nbsp;(Core)<br>CentOS&nbsp;Linux&nbsp;(3.10.0-123.el7.x86_64)&nbsp;7&nbsp;(Core)<br>CentOS&nbsp;Linux&nbsp;(0-rescue-2d3f9371c20d3e90a544ccc814d485e3)&nbsp;7&nbsp;(Core)<\/pre>\n\n\n\n<p>\u4e0a\u8ff0\u7ed3\u679c\u7684\u5e8f\u53f7\u4ece0\u5f00\u59cb\uff0c\u627e\u5230\u5185\u68384.0\u4ee5\u4e0a\u7248\u672c\u7684\u5e8f\u53f7\u503c\uff08\u8fd9\u91cc\u4e3a1\uff09\uff0c\u56e0\u6b64\u8bbe\u7f6e\u9ed8\u8ba4\u542f\u52a8\u9879\u4e3a1\u5e76\u91cd\u542f\u7cfb\u7edf\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo grub2-set-default 1<br>reboot<br><\/pre>\n\n\n\n<p>\u91cd\u542f\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u767b\u5f55\u5e76\u91cd\u65b0\u8fd0\u884cuname\u547d\u4ee4\u6765\u786e\u8ba4\u4f60\u662f\u5426\u4f7f\u7528\u4e86\u6b63\u786e\u7684\u5185\u6838\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">uname -r<\/pre>\n\n\n\n<p>\u5f97\u5230\u5982\u4e0b\u7ed3\u679c\u5219\u5347\u7ea7\u6210\u529f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">4.11.0-1.el7.elrepo.x86_64<\/pre>\n\n\n\n<h4 id=\"title-2\">\u5f00\u542fBBR<\/h4>\n\n\n\n<p>\u6267\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo 'net.core.default_qdisc=fq' | sudo tee -a \/etc\/sysctl.conf<br>echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a \/etc\/sysctl.conf<br>sudo sysctl -p<\/pre>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u5206\u522b\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5 BBR \u662f\u5426\u5f00\u542f\u6210\u529f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sysctl net.ipv4.tcp_available_congestion_control<\/pre>\n\n\n\n<p>#\u00a0\u8f93\u51fa\u5e94\u4e3anet.ipv4.tcp_available_congestion_control\u00a0=\u00a0bbr\u00a0cubic\u00a0reno<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sysctl -n net.ipv4.tcp_congestion_control<\/pre>\n\n\n\n<p>#&nbsp;\u8f93\u51fa\u5e94\u4e3a&nbsp;bbr<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lsmod | grep bbr<\/pre>\n\n\n\n<p>#&nbsp;\u8f93\u51fa\u5e94\u7c7b\u4f3c&nbsp;tcp_bbr&nbsp;&nbsp;16384&nbsp;&nbsp;28<\/p>\n\n\n\n<h4 id=\"title-3\">\u901f\u5ea6\u6d4b\u8bd5<\/h4>\n\n\n\n<p>\u9700\u5148\u5728&nbsp;firewalld&nbsp;\u4e2d\u5f00\u542f&nbsp;http&nbsp;\u670d\u52a1\uff08\u4e00\u822c\u5df2\u7ecf\u5f00\u542f\uff09<br>\u5728IP\u5730\u5740\u6839\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2a500MB\u7684\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dd if=\/dev\/zero of=500mb.zip bs=1024k count=500<\/pre>\n\n\n\n<p>\u8bbf\u95ee&nbsp;http:\/\/[your-server-IP]\/500mb.zip&nbsp;\u6765\u6d4b\u8bd5\u4e00\u4e0b\u4e0b\u8f7d\u901f\u5ea6\u5427<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\u81ea\uff1ahttps:\/\/laod.cn\/black-technology\/centos7-google-bbr&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"http:\/\/blog.inhowe.com\/index.php\/2019\/01\/02\/centos7-%e5%bc%80%e5%90%afgoogle-bbr%e5%8a%a0%e9%80%9f\/\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/posts\/36"}],"collection":[{"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":1,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":119,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/posts\/36\/revisions\/119"}],"wp:attachment":[{"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/media?parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/categories?post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.inhowe.com\/index.php\/wp-json\/wp\/v2\/tags?post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}