{"id":352,"date":"2023-02-16T01:08:23","date_gmt":"2023-02-15T17:08:23","guid":{"rendered":"https:\/\/blog.nhl520.cn\/?p=352"},"modified":"2023-02-16T01:08:23","modified_gmt":"2023-02-15T17:08:23","slug":"centos7-%e6%9b%b4%e6%8d%a2linux%e5%86%85%e6%a0%b8%e5%bc%80%e5%90%afbbr%e5%8a%a0%e9%80%9f","status":"publish","type":"post","link":"https:\/\/blog.nhl520.cn\/index.php\/2023\/02\/16\/centos7-%e6%9b%b4%e6%8d%a2linux%e5%86%85%e6%a0%b8%e5%bc%80%e5%90%afbbr%e5%8a%a0%e9%80%9f\/","title":{"rendered":"Centos7 \u66f4\u6362linux\u5185\u6838\u5f00\u542fbbr\u52a0\u901f"},"content":{"rendered":"\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\u4ece 4.9 \u5f00\u59cb\uff0cLinux \u5185\u6838\u5df2\u7ecf\u7528\u4e0a\u4e86\u8be5\u7b97\u6cd5\u3002\u8fd9\u4e9b\u5bf9\u6bd4\u56fe\u6765\u6e90\u4e8e\u7f51\u7edc\uff0c\u6d4b\u8bd5\u4e86\u540c\u4e00\u53f0VPS\u5728\u6ca1\u6709\u5f00\u542f\u52a0\u901f\uff0c\u4ee5\u53ca\u5728\u4f7f\u7528\u4e0d\u540c\u7684\u52a0\u901f\u65b9\u6cd5\u65f6\u7684\u4e0a\u4f20\u4e0e\u4e0b\u8f7d\u901f\u5ea6\uff0c\u5927\u5bb6\u53ef\u4ee5\u81ea\u884c\u5bf9\u6bd4\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"446\" src=\"https:\/\/blog.nhl520.cn\/wp-content\/uploads\/2023\/02\/e81e8d998b06c07c07563a426544ffc1_no-speedup.gif\" alt=\"\" class=\"wp-image-359\"\/><figcaption class=\"wp-element-caption\">\u4ee5\u4e0a\u662f\u672a\u5f00bbr<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"430\" src=\"https:\/\/blog.nhl520.cn\/wp-content\/uploads\/2023\/02\/9d487cda5f8abee3daf641efcf062944_bbr.gif\" alt=\"\" class=\"wp-image-360\"\/><figcaption class=\"wp-element-caption\">\u4ee5\u4e0a\u662fbbr\u52a0\u901f\u540e<\/figcaption><\/figure>\n\n\n\n<p>\u9996\u5148\u67e5\u770b\u5185\u6838\uff0c\u5982\u679c\u4f4e\u4e8e4.9\u5c31\u8981\u66f4\u6362\u5185\u5bb9\uff0c\u5982\u679c4.9\u4ee5\u4e0a\u53ef\u4ee5\u8df3\u8fc7\u66f4\u6362\u5185\u6838\u6b65\u9aa4\uff08\u4e0b\u9762\u4e00\u81f3\u4e5d\u7684\u6b65\u9aa4\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">&#91;root@hostlocal ~] uname -r\n3.10.0-1160.el7.x86_64<\/code><\/code><\/pre>\n\n\n\n<p><strong>\u66f4\u6362\u5185\u6838<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">\/\/\u4e00.\u5bfc\u5165\u516c\u94a5\n\n&#91;root@hostlocal ~]# rpm --import https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org\n\n\/\/\u5982\u679c\u6b63\u5e38\u7684\u8bdd\u662f\u7a7a\u767d\u65e0\u4fe1\u606f\u56de\u5e94\u7684\n\n\/\/\u53ef\u80fd\u9047\u5230\u7684\u9519\u8bef\u4fe1\u606f\n\n\/\/curl: (35) Peer reports incompatible or unsupported protocol version.\n\n\/\/\u4e0a\u65b9\u95ee\u9898\u89e3\u51b3\uff0cyum update -y nss curl libcurl\n\n\u4e8c.Centos 7\u7248\u672c\n\n&#91;root@hostlocal ~]# yum install https:\/\/www.elrepo.org\/elrepo-release-7.el7.elrepo.noarch.rpm\n\n\u4e09.\u5b89\u88c5\u5185\u6838\n\n&#91;root@hostlocal ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y\n\n\u56db.\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u5185\u6838\u5217\u8868\n\n&#91;root@hostlocal ~]# rpm -qa | grep kernel\n\n\u4e94.\u67e5\u770b\u9ed8\u8ba4\u542f\u52a8\u5185\u6838\n\n&#91;root@hostlocal ~]# grub2-editenv list\n\nsaved_entry=CentOS Linux (3.10.0-1160.49.1.el7.x86_64) 7 (Core) \/\/ps\uff1a\u4f4e\u4e8e4.9\u662f\u8981\u6362\u7684\n\n\u516d.\u67e5\u770b\u6240\u6709\u5185\u6838\n\n&#91;root@hostlocal ~]# cat \/boot\/grub2\/grub.cfg | grep menuentry\n\nif &#91; x\"${feature_menuentry_id}\" = xy ]; then\n\n\u00a0\u00a0menuentry_id_option=\"--id\"\n\n\u00a0\u00a0menuentry_id_option=\"\"\n\nexport menuentry_id_option\n\nmenuentry 'CentOS Linux (5.15.11-1.el7.elrepo.x86_64) 7 (Core)' --class ... \/\/\u4e3b\u8981\u524d\u9762\u540e\u9762\u7684\u7701\u7565\n\nmenuentry 'CentOS Linux (3.10.0-1160.49.1.el7.x86_64) 7 (Core)' --class ...\/\/\u4e3b\u8981\u524d\u9762\u540e\u9762\u7684\u7701\u7565\n\nmenuentry 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)' --class ...\n\nmenuentry 'CentOS Linux (0-rescue-8508293106917c25a979808779d9e8a1) 7 (Core)' --class ...\/\/\u4e3b\u8981\u524d\u9762\u540e\u9762\u7684\u7701\u7565\n\n\u4e03.\u4fee\u6539\u9ed8\u8ba4\u542f\u52a8\u5185\u6838\n\n&#91;root@hostlocal ~]# grub2-set-default 'CentOS Linux (5.7.0-1.el7.elrepo.x86_64) 7 (Core)'\n\n\u516b.\u91cd\u542f\u7cfb\u7edf\n\n&#91;root@hostlocal ~]# reboot\n\n\u4e5d.\u91cd\u542f\u7cfb\u7edf\u5f00\u673a\u540e\u68c0\u67e5\u542f\u52a8\u5185\u6838\n\n&#91;root@hostlocal ~]# grub2-editenv list\n\n\/\/\u5185\u6838\u5927\u4e8e4.9\u4ee5\u4e0a\u4e86\uff0c\u5c31\u53ef\u4ee5\u7ee7\u7eed\u5b89\u88c5BBR<\/code><\/code><\/pre>\n\n\n\n<p><strong>\u5f00\u542fbbr<\/strong><\/p>\n\n\n\n<p>\u52a0\u5165\u547d\u4ee4\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"c\" class=\"EnlighterJSRAW\">&#91;root@hostlocal ~]# echo \"net.core.default_qdisc=fq\" >> \/etc\/sysctl.conf\n\n&#91;root@hostlocal ~]# echo \"net.ipv4.tcp_congestion_control=bbr\" >> \/etc\/sysctl.conf\n\n\u4e8c.\u52a0\u8f7d\u53c2\u6570\n\n&#91;root@hostlocal ~]# sysctl -p\n\n\u4e09.\u67e5\u770b\u662f\u5426\u5f00\u542f\u6210\u529f-1\n\n&#91;root@hostlocal ~]# sysctl net.ipv4.tcp_available_congestion_control\n\n\/\/\u663e\u793a\n\nnet.ipv4.tcp_available_congestion_control = reno cubic bbr\n\n\/\/\u6216\u8005\n\nnet.ipv4.tcp_available_congestion_control = bbr cubic reno\n\n\u56db.\u67e5\u770b\u662f\u5426\u5f00\u542f\u6210\u529f-2\n\n&#91;root@hostlocal ~]# sysctl net.ipv4.tcp_congestion_control\n\nnet.ipv4.tcp_congestion_control = bbr\n\n\u00a0\n\n\u68c0\u67e5BBR\u662f\u5426\u6b63\u5e38\u8fd0\u884c\n\n&#91;root@hostlocal ~]# lsmod | grep bbr\n\ntcp_bbr\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 20480\u00a0 7<\/code><\/code><\/pre>\n\n\n\n<p>\u5230\u8fd9\u91cc\u65e2Centos7 \u5f00\u542f\u4e86bbr\u52a0\u901f<\/p>\n","protected":false},"excerpt":{"rendered":"<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\u4ece 4.9 \u5f00\u59cb\uff0cLinux \u5185\u6838\u5df2\u7ecf\u7528\u4e0a\u4e86\u8be5\u7b97\u6cd5\u3002\u8fd9\u4e9b\u5bf9\u6bd4\u56fe\u6765\u6e90\u4e8e\u7f51\u7edc\uff0c\u6d4b\u8bd5\u4e86\u540c\u4e00\u53f0VPS\u5728\u6ca1\u6709\u5f00\u542f\u52a0\u901f\uff0c\u4ee5\u53ca\u5728\u4f7f\u7528\u4e0d\u540c\u7684\u52a0\u901f\u65b9\u6cd5\u65f6\u7684\u4e0a\u4f20\u4e0e\u4e0b\u8f7d\u901f\u5ea6\uff0c\u5927\u5bb6\u53ef\u4ee5\u81ea\u884c\u5bf9\u6bd4\u3002 \u9996\u5148\u67e5\u770b\u5185\u6838\uff0c\u5982\u679c\u4f4e\u4e8e4.9\u5c31\u8981\u66f4\u6362\u5185\u5bb9\uff0c\u5982\u679c4.9\u4ee5\u4e0a\u53ef\u4ee5\u8df3\u8fc7\u66f4\u6362\u5185\u6838\u6b65\u9aa4\uff08\u4e0b\u9762\u4e00\u81f3\u4e5d\u7684\u6b65\u9aa4\uff09 \u66f4\u6362\u5185 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":360,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[20],"class_list":["post-352","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/posts\/352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/comments?post=352"}],"version-history":[{"count":9,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/posts\/352\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/posts\/352\/revisions\/363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/media\/360"}],"wp:attachment":[{"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/media?parent=352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/categories?post=352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nhl520.cn\/index.php\/wp-json\/wp\/v2\/tags?post=352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}