{"id":1154,"date":"2019-02-23T17:57:43","date_gmt":"2019-02-23T09:57:43","guid":{"rendered":"http:\/\/www.tairongkj.com\/?p=1154"},"modified":"2019-02-23T18:01:00","modified_gmt":"2019-02-23T10:01:00","slug":"%e5%ae%89%e8%a3%85-google-bbr-%e5%8a%a0%e9%80%9fvps%e7%bd%91%e7%bb%9c","status":"publish","type":"post","link":"https:\/\/www.tairongkj.com\/?p=1154","title":{"rendered":"\u5b89\u88c5 Google BBR \u52a0\u901fVPS\u7f51\u7edc"},"content":{"rendered":"<p>\u6700\u8fd1\u603b\u5728\u6298\u817e\u3002\u4e4b\u524d\u5728rectified\u4e70\u4e86\u4e00\u4e2a\u5e74\u4ed89.6\u5200\u7684128MB KVM\u67b6\u6784\u7684\u5c0fVPS\uff0c\u5176\u5b9e\u5b83\u7684\u7ebf\u8def\u672c\u8eab\u5c31\u4e0d\u9519\uff0c\u76f4\u8fde\u56fd\u5185\u7535\u4fe1\u548c\u8054\u901a\u7684\u6d1b\u6749\u77f6\u9ca8\u9c7c\u673a\u623f\uff0c\u73b0\u5728\u5df2\u7ecf\u5356\u65ad\u8d27\u4e86\u3002\u4e3a\u4e86\u5728\u8fd9\u4e2a\u5c0f\u5185\u5b58\u7684VPS\u4e0a\u642d\u5efa\u4e00\u4e2a\u5b8c\u7f8e\u7684\u68af\u5b50\uff0c\u6211\u4f7f\u7528\u4e86\u4f7f\u7528Google BBR\u7684\u5168\u65b0\u5185\u6838\u3002<\/p>\n<p><strong>\u9884\u5907\u77e5\u8bc6<\/strong><\/p>\n<p>\u5728\u4f7f\u7528Google BBR\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u8981\u4e86\u89e3\u5b83\u662f<u><a href=\"https:\/\/github.com\/google\/bbr\">\u4ec0\u4e48<\/a><\/u>\u3002\u4e86\u89e3\u8ba1\u7b97\u673a\u7f51\u7edc\u7684\u4eba\u90fd\u77e5\u9053\uff0c\u5728TCP\u8fde\u63a5\u4e2d\uff0c\u7531\u4e8e\u9700\u8981\u7ef4\u6301\u8fde\u63a5\u7684\u53ef\u9760\u6027\uff0c\u5f15\u5165\u4e86\u62e5\u585e\u63a7\u5236\u548c\u6d41\u91cf\u7ba1\u7406\u7684\u65b9\u6cd5\u3002Google BBR\u5c31\u662f\u8c37\u6b4c\u516c\u53f8\u63d0\u51fa\u7684\u4e00\u4e2a\u5f00\u6e90TCP\u62e5\u585e\u63a7\u5236\u7684\u7b97\u6cd5\u3002\u5728\u6700\u65b0\u7684linux 4.9\u53ca\u4ee5\u4e0a\u7684\u5185\u6838\u7248\u672c\u4e2d\u5df2\u88ab\u91c7\u7528\u3002\u5bf9\u4e8e\u8be5\u7b97\u6cd5\u7684\u5206\u6790\uff0c<u><a href=\"http:\/\/blog.csdn.net\/dog250\/article\/details\/52830576\">\u8fd9\u91cc<\/a><\/u>\u6709\u4e00\u7bc7\u6587\u7ae0\u503c\u5f97\u4e00\u8bfb\u3002\u5728\u672c\u4eba\u7684\u7f51\u7edc\u73af\u5883\uff08\u6b66\u6c49\u7535\u4fe120MB\uff09\u6d4b\u8bd5\u4e0b\uff0css\u4e0d\u7ecf\u8fc7\u5176\u5b83\u7684\u4efb\u4f55\u7684\u4f18\u5316\u5c31\u80fd\u8f7b\u677e\u7684\u8dd1\u6ee1\u5e26\u5bbd\u3002\uff08speedtest\u6d4b\u8bd5\u6216<u><a href=\"https:\/\/fast.com\/\">fast<\/a><\/u>\u6d4b\u8bd5\uff09\u3002\u7531\u4e8eGoogle BBR\u975e\u5e38\u65b0\uff0c\u4efb\u4f55\u4f4e\u4e8e4.9\u7684linux\u5185\u6838\u7248\u672c\u90fd\u9700\u8981\u5347\u7ea7\u52304.9\u53ca\u4ee5\u4e0a\u624d\u80fd\u4f7f\u7528\uff0c\u6545\u82e5VPS\u672c\u8eab\u5185\u6838\u7248\u672c\u8f83\u4f4e\u7684\u8bdd\uff0c<strong>\u53ea\u6709<\/strong><strong>KVM<\/strong><strong>\u67b6\u6784\u7684<\/strong><strong>VPS<\/strong><strong>\u624d\u80fd\u4f7f\u7528\u672c\u6559\u7a0b\u5347\u7ea7\u5185\u6838\u5e76\u4f7f\u7528<\/strong>\uff0copenvz\u7684VPS\u7528\u6237\u82e5\u5185\u6838\u7248\u672c\u8f83\u4f4e\u5219\u65e0\u6cd5\u4f7f\u7528\uff01<\/p>\n<p><strong>\u5b9e\u65bd\u8fc7\u7a0b<\/strong><\/p>\n<p><strong>\u57fa\u7840\u65b9\u6cd5<\/strong><\/p>\n<p>\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u5c31\u662f\u4f7f\u7528Google BBR\u4e00\u952e\u5b89\u88c5\u811a\u672c\u3002<\/p>\n<ol>\n<li>\u4f7f\u7528root\u7528\u6237\u767b\u5f55\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a\n<ol>\n<li>wget &#8211;no-check-certificate https:<em>\/\/github.com\/teddysun\/across\/raw\/master\/bbr.sh<\/em><\/li>\n<li>chmod +x bbr.sh<\/li>\n<li>.\/bbr.sh<\/li>\n<\/ol>\n<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u811a\u672c\u4f1a\u63d0\u793a\u9700\u8981\u91cd\u542f VPS\uff0c\u8f93\u5165 y \u5e76\u56de\u8f66\u540e\u91cd\u542f\u3002<br \/>\n\u91cd\u542f\u5b8c\u6210\u540e\uff0c\u8fdb\u5165 VPS\uff0c\u9a8c\u8bc1\u4e00\u4e0b\u662f\u5426\u6210\u529f\u5b89\u88c5\u6700\u65b0\u5185\u6838\u5e76\u5f00\u542f TCP BBR\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ol>\n<li>uname -r<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u67e5\u770b\u5185\u6838\u7248\u672c\uff0c\u542b\u6709 4.9 \u5c31\u8868\u793a OK \u4e86<\/p>\n<ol start=\"2\">\n<li>sysctl net.ipv4.tcp_available_congestion_control<\/li>\n<\/ol>\n<p>\u8fd4\u56de\u503c\u4e00\u822c\u4e3a\uff1a<br \/>\nnet.ipv4.tcp_available_congestion_control = bbr cubic reno<\/p>\n<ol start=\"3\">\n<li>sysctl net.ipv4.tcp_congestion_control<\/li>\n<\/ol>\n<p>\u8fd4\u56de\u503c\u4e00\u822c\u4e3a\uff1a<br \/>\nnet.ipv4.tcp_congestion_control = bbr<\/p>\n<ol start=\"4\">\n<li>sysctl net.core.default_qdisc<\/li>\n<\/ol>\n<p>\u8fd4\u56de\u503c\u4e00\u822c\u4e3a\uff1a<br \/>\nnet.core.default_qdisc = fq<\/p>\n<ol start=\"5\">\n<li>lsmod | grep bbr<\/li>\n<\/ol>\n<p>\u8fd4\u56de\u503c\u6709 tcp_bbr \u6a21\u5757\u5373\u8bf4\u660ebbr\u5df2\u542f\u52a8\u3002<\/p>\n<p><strong>\u8fdb\u9636\u65b9\u6cd5<\/strong><strong>\u00a0<\/strong><em>\u63a8\u8350\uff01<\/em><\/p>\n<p>\u7531\u4e8e\u4e00\u952e\u5305\u4f1a\u8fdb\u884c\u5f88\u591a\u5f88\u591a\u5224\u65ad\u548c\u5904\u7406\uff0c\u800c\u5176\u4e2d\u6709\u5f88\u591a\u6b65\u9aa4\u53ef\u4ee5\u7528\u66f4\u9ad8\u7684\u6548\u7387\u624b\u5de5\u5b9e\u73b0\u3002<\/p>\n<ol>\n<li>\u5347\u7ea7\u5185\u6838<\/li>\n<\/ol>\n<p>\u5bf9\u4e8e<strong>Centos<\/strong>\u7528\u6237\uff0c \u8bf7\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ol>\n<li>yum &#8211;enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel<\/li>\n<\/ol>\n<p>\u5bf9\u4e8e<strong>Centos 6<\/strong>\uff0c\u6267\u884c\uff1a<\/p>\n<ol start=\"2\">\n<li>sed -i &#8216;s\/^default=.*\/default=0\/g&#8217; \/boot\/grub\/grub.conf<\/li>\n<\/ol>\n<p>\u5bf9\u4e8e<strong>Centos 7<\/strong>\uff0c\u6267\u884c\uff1a<\/p>\n<ol start=\"3\">\n<li>grub2-set-default 0<\/li>\n<\/ol>\n<p>\u800c\u5bf9\u4e8eDebian \/ Ubuntu\u7cfb\u7edf\uff0c\u53ef\u4ee5\u5728<u><a href=\"http:\/\/kernel.ubuntu.com\/~kernel-ppa\/mainline\/\">Ubuntu Kernel<\/a><\/u>\u4e0a\u4e0b\u8f7d\u6700\u65b0\u7248\u7684\u5185\u6838deb\u5b89\u88c5\u5305\u3002<\/p>\n<p>\u5bf9\u4e8e64\u4f4d\u7cfb\u7edf\uff0c\u4e0b\u8f7damd64\u7684linux-image\u4e2d\u542b\u6709generic\u7684deb\u5305\uff0c<\/p>\n<p>\u5bf9\u4e8e32\u4f4d\u7cfb\u7edf\uff0c\u4e0b\u8f7di386\u7684linux-image\u4e2d\u542b\u6709generic\u7684deb\u5305\u3002<\/p>\n<p>\u5b89\u88c5\u547d\u4ee4\uff1a<\/p>\n<ol start=\"4\">\n<li>dpkg -i xxxxxxxxxx.deb<\/li>\n<\/ol>\n<p>\u5b89\u88c5\u5b8c\u540e\u6267\u884c\uff1a<\/p>\n<ol start=\"5\">\n<li>\/usr\/sbin\/update-grub<\/li>\n<\/ol>\n<p><strong>\u5347\u7ea7\u5b8c\u540e\u8bf7\u7acb\u5373\u91cd\u542f<\/strong><strong>VPS<\/strong>\u00a0reboot<\/p>\n<ol start=\"2\">\n<li>\u542f\u7528Google BBR<\/li>\n<\/ol>\n<p>\u5199\u5165\u914d\u7f6e\u6587\u4ef6<\/p>\n<ol>\n<li>echo &#8220;net.core.default_qdisc=fq&#8221; &gt;&gt; \/etc\/sysctl.conf<\/li>\n<li>echo &#8220;net.ipv4.tcp_congestion_control=bbr&#8221; &gt;&gt; \/etc\/sysctl.conf<\/li>\n<\/ol>\n<p>\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6<\/p>\n<ol start=\"3\">\n<li>sysctl -p<\/li>\n<\/ol>\n<p>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u68c0\u67e5\u662f\u5426\u6210\u529f<\/p>\n<ol start=\"4\">\n<li>sysctl net.ipv4.tcp_available_congestion_control<\/li>\n<\/ol>\n<p>\u82e5\u8fd4\u56de<\/p>\n<ol start=\"5\">\n<li>net.ipv4.tcp_available_congestion_control = bbr cubic reno<\/li>\n<\/ol>\n<p>\u5219\u8bf4\u660e\u5f00\u542f\u6210\u529f\u3002<\/p>\n<p><strong>\u540e\u8bb0<\/strong><\/p>\n<p>\u76ee\u524d\uff0c\u5e38\u89c1\u7684\u52a0\u901f\u65b9\u5f0f\u6709Finalspeed\uff08tcpspeed\uff09\uff0cKcptun\uff0c\u9510\u901f\u7b49\u5355\u53cc\u8fb9\u52a0\u901f\u5de5\u5177\u3002Google BBR\u7684\u4f18\u52bf\u5c31\u5728\u4e8e\uff0c\u5176\u80fd\u5355\u8fb9\u5730\u4eceTCP\u8fde\u63a5\u7684\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\u7740\u624b\u89e3\u51b3\u7f51\u7edc\u52a0\u901f\u7684\u95ee\u9898\uff0c\u5e76\u4e14\u5df2\u7ecf\u96c6\u4e2d\u5230\u5185\u6838\u4e2d\u6210\u4e3a\u65b0\u4e00\u4ee3\u7684\u89c4\u8303\uff0c\u6ca1\u6709\u5176\u4ed6\u5bf9\u4e8e\u7cfb\u7edf\u6027\u80fd\u7684\u5f00\u9500\u3002\u5e76\u4e14\uff0c\u53ef\u4ee5\u914d\u5408\u9510\u901f\uff0cFinalspeed\u7b49\u4f7f\u7528\u4ee5\u8fbe\u5230\u6700\u4f73\u7684\u4f7f\u7528\u6548\u679c\u3002\u5173\u4e8eFinalspeed\u7684\u4f7f\u7528\u6559\u7a0b\u53ef\u53c2\u89c1<u><a href=\"https:\/\/q.aka.moe\/2016\/04\/03\/e7-bd-91-e7-bb-9c-e7-8e-af-e5-a2-83-e7-9a-84-e7-a7-91-e5-ad-a6-e4-b8-bb-e4-b9-89-e7-8e-b0-e4-bb-a3-e5-8c-96-e6-94-b9-e9-80-a0\/\">\u300a\u7f51\u7edc\u73af\u5883\u7684\u79d1\u5b66\u4e3b\u4e49\u73b0\u4ee3\u5316\u6539\u9020\u300b<\/a><\/u>\u3002<\/p>\n<p>\u53c2\u8003\u8d44\u6599\uff1a<\/p>\n<ol>\n<li><u><a href=\"https:\/\/teddysun.com\/489.html\">\u4e00\u952e\u5b89\u88c5\u6700\u65b0\u5185\u6838\u5e76\u5f00\u542f BBR \u811a\u672c<\/a><\/u><\/li>\n<li><u><a href=\"http:\/\/rss.semhat.com\/link\/11590_%E4%B8%BAvps%E5%8A%A0%E9%80%9F%E5%BA%A6-debian-ubuntu%E5%AE%89%E8%A3%85bbr%E6%95%99%E7%A8%8B\">#\u4e3aVPS\u52a0\u901f\u5ea6# Debian\/Ubuntu\u5b89\u88c5bbr\u6559\u7a0b<\/a><\/u><\/li>\n<li><u><a href=\"https:\/\/github.com\/google\/bbr\/blob\/master\/Documentation\/bbr-quick-start.md\">TCP BBR Quick-Start: Building and Running TCP BBR on Google Compute Engine<\/a><\/u><\/li>\n<\/ol>\n<p><span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"http:\/\/v2.tairongkj.com\" target=\"_blank\" rel=\"noopener noreferrer\">\u6cf0\u878d\u79d1\u6280-\u8d85\u58f0\u5de5\u4f5c\u7ad9<\/a><\/span><\/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<\/p>\n<p>BBR\u89e3\u51b3\u4e86\u4e24\u4e2a\u95ee\u9898\uff1a<\/p>\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<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<\/p>\n","protected":false},"author":1,"featured_media":1155,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[56],"series":[],"class_list":{"0":"post-1154","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-weekstudyshare","8":"tag-bbr","10":"post-with-thumbnail","11":"post-with-thumbnail-large"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/1154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1154"}],"version-history":[{"count":3,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/1154\/revisions"}],"predecessor-version":[{"id":1158,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/1154\/revisions\/1158"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/media\/1155"}],"wp:attachment":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1154"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=1154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}