{"id":54108,"date":"2025-02-18T10:16:56","date_gmt":"2025-02-18T02:16:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/54108\/"},"modified":"2025-02-18T10:16:56","modified_gmt":"2025-02-18T02:16:56","slug":"%e5%9c%a8gcp%e4%b8%8a%e9%85%8d%e7%bd%aeshadowsocks%e4%b8%8ebbr%ef%bc%9a%e6%8f%90%e5%8d%87%e7%bd%91%e7%bb%9c%e9%80%9f%e5%ba%a6%e4%b8%8e%e7%a8%b3%e5%ae%9a%e6%80%a7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/54108\/","title":{"rendered":"\u5728GCP\u4e0a\u914d\u7f6eShadowsocks\u4e0eBBR\uff1a\u63d0\u5347\u7f51\u7edc\u901f\u5ea6\u4e0e\u7a33\u5b9a\u6027"},"content":{"rendered":"<h2>1. \u5f15\u8a00<\/h2>\n<p>\u5728\u5f53\u4eca\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u7528\u6237\u5bf9\u7f51\u7edc\u901f\u5ea6\u548c\u7a33\u5b9a\u6027\u7684\u8981\u6c42\u8d8a\u6765\u8d8a\u9ad8\u3002\u7279\u522b\u662f\u5728\u8bbf\u95ee\u88ab\u9650\u5236\u7684\u7f51\u7ad9\u65f6\uff0c<em>Shadowsocks<\/em>\u4f5c\u4e3a\u4e00\u79cd\u6709\u6548\u7684\u5de5\u5177\uff0c\u53d7\u5230\u5e7f\u6cdb\u6b22\u8fce\u3002\u4e0e\u6b64\u540c\u65f6\uff0c<em>BBR<\/em>\uff08Bottleneck Bandwidth and Round-trip propagation time\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u63d0\u9ad8TCP\u534f\u8bae\u6027\u80fd\u7684\u6280\u672f\uff0c\u80fd\u591f\u663e\u8457\u63d0\u5347\u7f51\u7edc\u4f20\u8f93\u6548\u7387\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u5982\u4f55\u5728<em>GCP<\/em>\uff08Google Cloud Platform\uff09\u4e0a\u914d\u7f6e<em>Shadowsocks<\/em>\u4e0e<em>BBR<\/em>\uff0c\u4ee5\u8fbe\u5230\u63d0\u9ad8\u7f51\u7edc\u901f\u5ea6\u4e0e\u7a33\u5b9a\u6027\u7684\u76ee\u7684\u3002<\/p>\n<h2>2. \u4ec0\u4e48\u662fGCP\uff1f<\/h2>\n<p><em>GCP<\/em>\u662f\u8c37\u6b4c\u63d0\u4f9b\u7684\u4e91\u8ba1\u7b97\u5e73\u53f0\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4e00\u7cfb\u5217\u57fa\u7840\u8bbe\u65bd\u670d\u52a1\u548c\u5f00\u53d1\u5de5\u5177\u3002\u5176\u7279\u70b9\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5168\u7403\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\uff0c\u4fdd\u8bc1\u4f4e\u5ef6\u8fdf<\/li>\n<li>\u53ef\u9760\u7684\u7f51\u7edc\u5b89\u5168\u6027<\/li>\n<li>\u4e30\u5bcc\u7684API\u548c\u5de5\u5177\uff0c\u65b9\u4fbf\u5f00\u53d1\u8005\u4f7f\u7528<\/li>\n<\/ul>\n<h2>3. Shadowsocks\u7684\u6982\u5ff5<\/h2>\n<p><em>Shadowsocks<\/em>\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u7ed5\u8fc7\u7f51\u7edc\u9650\u5236\u3002\u5176\u4f18\u70b9\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5b89\u5168\u6027\u9ad8\uff0c\u6570\u636e\u52a0\u5bc6<\/li>\n<li>\u8bbe\u7f6e\u7b80\u5355\uff0c\u652f\u6301\u591a\u79cd\u5e73\u53f0<\/li>\n<li>\u7075\u6d3b\u6027\u5f3a\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f<\/li>\n<\/ul>\n<h2>4. BBR\u7684\u4f18\u52bf<\/h2>\n<p><em>BBR<\/em>\u4f5c\u4e3a\u4e00\u79cd\u7f51\u7edc\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u5177\u6709\u4ee5\u4e0b\u4f18\u52bf\uff1a<\/p>\n<ul>\n<li>\u6539\u5584\u5e26\u5bbd\u5229\u7528\u7387<\/li>\n<li>\u964d\u4f4e\u5ef6\u8fdf\uff0c\u63d0\u9ad8\u54cd\u5e94\u901f\u5ea6<\/li>\n<li>\u81ea\u9002\u5e94\u6027\u5f3a\uff0c\u80fd\u6839\u636e\u7f51\u7edc\u72b6\u51b5\u52a8\u6001\u8c03\u6574<\/li>\n<\/ul>\n<h2>5. \u5728GCP\u4e0a\u914d\u7f6eShadowsocks<\/h2>\n<h3>5.1 \u521b\u5efaGCP\u5b9e\u4f8b<\/h3>\n<ul>\n<li>\u767b\u5f55GCP\u63a7\u5236\u53f0<\/li>\n<li>\u9009\u62e9\u201c\u8ba1\u7b97\u5f15\u64ce\u201d<\/li>\n<li>\u70b9\u51fb\u201c\u521b\u5efa\u5b9e\u4f8b\u201d<\/li>\n<li>\u9009\u62e9\u5408\u9002\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08\u63a8\u8350\u4f7f\u7528<em>Ubuntu<\/em>\uff09<\/li>\n<\/ul>\n<h3>5.2 \u5b89\u88c5Shadowsocks<\/h3>\n<ol>\n<li>\n<p>\u901a\u8fc7SSH\u8fde\u63a5\u5230\u5b9e\u4f8b<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u8f6f\u4ef6\u5305\uff1a bash sudo apt update sudo apt upgrade<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5Shadowsocks\uff1a bash sudo apt install shadowsocks-libev<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6eShadowsocks\uff1a \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5fc5\u8981\u53c2\u6570\uff08\u5982\u670d\u52a1\u5668\u7aef\u53e3\u3001\u5bc6\u7801\u3001\u52a0\u5bc6\u65b9\u5f0f\u7b49\uff09\u3002<\/p>\n<\/li>\n<\/ol>\n<h3>5.3 \u542f\u52a8Shadowsocks<\/h3>\n<ul>\n<li>\n<p>\u542f\u52a8\u670d\u52a1\uff1a bash sudo systemctl start shadowsocks-libev<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u670d\u52a1\u72b6\u6001\uff1a bash sudo systemctl status shadowsocks-libev<\/p>\n<\/li>\n<\/ul>\n<h2>6. \u5728GCP\u4e0a\u542f\u7528BBR<\/h2>\n<h3>6.1 \u68c0\u67e5\u5185\u6838\u7248\u672c<\/h3>\n<p>\u786e\u4fdd\u4f7f\u7528\u7684Linux\u5185\u6838\u7248\u672c\u652f\u6301<em>BBR<\/em>\uff0c\u901a\u5e38\u8981\u6c42\u57284.9\u53ca\u4ee5\u4e0a\u7248\u672c\u3002\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u5185\u6838\u7248\u672c\uff1a bash uname -r<\/p>\n<h3>6.2 \u542f\u7528BBR<\/h3>\n<ol>\n<li>\n<p>\u7f16\u8f91sysctl\u914d\u7f6e\uff1a bash sudo nano \/etc\/sysctl.conf<\/p>\n<\/li>\n<li>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\uff1a bash net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u66f4\u6539\uff1a bash sudo sysctl -p<\/p>\n<\/li>\n<\/ol>\n<h3>6.3 \u9a8c\u8bc1BBR\u662f\u5426\u542f\u7528<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\uff1a bash sysctl net.ipv4.tcp_congestion_control<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c\u5e94\u4e3a\u201cbbr\u201d\u3002<\/p>\n<h2>7. \u6574\u5408Shadowsocks\u4e0eBBR<\/h2>\n<p>\u5728\u5b8c\u6210Shadowsocks\u4e0eBBR\u7684\u914d\u7f6e\u540e\uff0c\u7528\u6237\u5c06\u80fd\u591f\u4f53\u9a8c\u5230\u66f4\u4e3a\u987a\u7545\u7684\u7f51\u7edc\u8fde\u63a5\u3002\u8fd9\u4e00\u7ec4\u5408\u7684\u4f18\u52bf\u5728\u4e8e\uff1a<\/p>\n<ul>\n<li><em>Shadowsocks<\/em>\u786e\u4fdd\u6570\u636e\u7684\u9690\u79c1\u4e0e\u5b89\u5168\u6027<\/li>\n<li><em>BBR<\/em>\u5219\u63d0\u5347\u4e86\u7f51\u7edc\u7684\u4f20\u8f93\u6548\u7387<\/li>\n<\/ul>\n<h2>8. \u5e38\u89c1\u95ee\u9898\u89e3\u7b54\uff08FAQ\uff09<\/h2>\n<h3>8.1 Shadowsocks\u548cBBR\u7684\u7ed3\u5408\u662f\u5426\u4e00\u5b9a\u63d0\u9ad8\u901f\u5ea6\uff1f<\/h3>\n<p>\u4e0d\u4e00\u5b9a\u3002\u867d\u7136\u7ed3\u5408\u4f7f\u7528\u53ef\u4ee5\u4f18\u5316\u7f51\u7edc\u4f53\u9a8c\uff0c\u4f46\u5b9e\u9645\u6548\u679c\u8fd8\u53d7\u5230\u7f51\u7edc\u73af\u5883\u3001\u5730\u7406\u4f4d\u7f6e\u7b49\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\u3002<\/p>\n<h3>8.2 \u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u52a0\u5bc6\u65b9\u5f0f\uff1f<\/h3>\n<p>\u4e00\u822c\u6765\u8bf4\uff0c\u63a8\u8350\u4f7f\u7528<em>aes-256-gcm<\/em>\uff0c\u8fd9\u79cd\u52a0\u5bc6\u65b9\u5f0f\u5728\u5b89\u5168\u6027\u548c\u901f\u5ea6\u4e0a\u90fd\u8868\u73b0\u8f83\u4e3a\u4f18\u8d8a\u3002<\/p>\n<h3>8.3 GCP\u7684\u4f7f\u7528\u662f\u5426\u6536\u8d39\uff1f<\/h3>\n<p>\u662f\u7684\uff0cGCP\u63d0\u4f9b\u7684\u4e91\u670d\u52a1\u662f\u6309\u4f7f\u7528\u91cf\u6536\u8d39\u7684\uff0c\u5efa\u8bae\u5728\u521b\u5efa\u5b9e\u4f8b\u524d\u4e86\u89e3\u76f8\u5173\u8d39\u7528\u3002<\/p>\n<h3>8.4 \u5982\u4f55\u76d1\u63a7Shadowsocks\u7684\u4f7f\u7528\u60c5\u51b5\uff1f<\/h3>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u7f51\u7edc\u76d1\u63a7\u5de5\u5177\uff08\u5982<em>iftop<\/em>\uff09\u6765\u76d1\u6d4b\u6d41\u91cf\u548c\u8fde\u63a5\u72b6\u6001\uff0c\u5e2e\u52a9\u4e86\u89e3\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<h2>9. \u603b\u7ed3<\/h2>\n<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728<em>GCP<\/em>\u4e0a\u914d\u7f6e<em>Shadowsocks<\/em>\u4e0e<em>BBR<\/em>\u3002\u901a\u8fc7\u8fd9\u79cd\u7ec4\u5408\uff0c\u7528\u6237\u4e0d\u4ec5\u80fd\u591f\u4eab\u53d7\u5230\u66f4\u5feb\u7684\u7f51\u7edc\u8fde\u63a5\uff0c\u540c\u65f6\u4e5f\u80fd\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u5b89\u5168\u6027\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u8bfb\u8005\u987a\u5229\u5b8c\u6210\u914d\u7f6e\uff0c\u63d0\u5347\u7f51\u7edc\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5f15\u8a00 \u5728\u5f53\u4eca\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u7528\u6237\u5bf9\u7f51\u7edc\u901f\u5ea6\u548c\u7a33\u5b9a\u6027\u7684\u8981\u6c42\u8d8a\u6765\u8d8a\u9ad8\u3002\u7279\u522b\u662f\u5728\u8bbf\u95ee\u88ab\u9650\u5236\u7684\u7f51\u7ad9\u65f6\uff0cShadowsocks\u4f5c\u4e3a\u4e00\u79cd\u6709\u6548\u7684\u5de5\u5177\uff0c\u53d7\u5230\u5e7f\u6cdb\u6b22\u8fce\u3002\u4e0e\u6b64\u540c\u65f6\uff0cBBR\uff08Bottleneck Bandwidth and Round-trip propagation time\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u63d0\u9ad8TCP\u534f\u8bae\u6027\u80fd\u7684\u6280\u672f\uff0c\u80fd\u591f\u663e\u8457\u63d0\u5347\u7f51\u7edc\u4f20\u8f93\u6548\u7387\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u5982\u4f55\u5728GCP\uff08Google Cloud Platform\uff09\u4e0a\u914d\u7f6eShadowsocks\u4e0eBBR\uff0c\u4ee5\u8fbe\u5230\u63d0\u9ad8\u7f51\u7edc\u901f\u5ea6\u4e0e\u7a33\u5b9a\u6027\u7684\u76ee\u7684\u3002 2. \u4ec0\u4e48\u662fGCP\uff1f GCP\u662f\u8c37\u6b4c\u63d0\u4f9b\u7684\u4e91\u8ba1\u7b97\u5e73\u53f0\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4e00\u7cfb\u5217\u57fa\u7840\u8bbe\u65bd\u670d\u52a1\u548c\u5f00\u53d1\u5de5\u5177\u3002\u5176\u7279\u70b9\u5305\u62ec\uff1a \u5168\u7403\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\uff0c\u4fdd\u8bc1\u4f4e\u5ef6\u8fdf \u53ef\u9760\u7684\u7f51\u7edc\u5b89\u5168\u6027 \u4e30\u5bcc\u7684API\u548c\u5de5\u5177\uff0c\u65b9\u4fbf\u5f00\u53d1\u8005\u4f7f\u7528 3. Shadowsocks\u7684\u6982\u5ff5 Shadowsocks\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u7ed5\u8fc7\u7f51\u7edc\u9650\u5236\u3002\u5176\u4f18\u70b9\u5305\u62ec\uff1a \u5b89\u5168\u6027\u9ad8\uff0c\u6570\u636e\u52a0\u5bc6 \u8bbe\u7f6e\u7b80\u5355\uff0c\u652f\u6301\u591a\u79cd\u5e73\u53f0 \u7075\u6d3b\u6027\u5f3a\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f 4. BBR\u7684\u4f18\u52bf BBR\u4f5c\u4e3a\u4e00\u79cd\u7f51\u7edc\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u5177\u6709\u4ee5\u4e0b\u4f18\u52bf\uff1a \u6539\u5584\u5e26\u5bbd\u5229\u7528\u7387 \u964d\u4f4e\u5ef6\u8fdf\uff0c\u63d0\u9ad8\u54cd\u5e94\u901f\u5ea6 \u81ea\u9002\u5e94\u6027\u5f3a\uff0c\u80fd\u6839\u636e\u7f51\u7edc\u72b6\u51b5\u52a8\u6001\u8c03\u6574 5. \u5728GCP\u4e0a\u914d\u7f6eShadowsocks 5.1 \u521b\u5efaGCP\u5b9e\u4f8b \u767b\u5f55GCP\u63a7\u5236\u53f0 \u9009\u62e9\u201c\u8ba1\u7b97\u5f15\u64ce\u201d \u70b9\u51fb\u201c\u521b\u5efa\u5b9e\u4f8b\u201d \u9009\u62e9\u5408\u9002\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08\u63a8\u8350\u4f7f\u7528Ubuntu\uff09 5.2 \u5b89\u88c5Shadowsocks \u901a\u8fc7SSH\u8fde\u63a5\u5230\u5b9e\u4f8b \u66f4\u65b0\u8f6f\u4ef6\u5305\uff1a bash sudo apt update sudo apt upgrade \u5b89\u88c5Shadowsocks\uff1a bash sudo apt install shadowsocks-libev \u914d\u7f6eShadowsocks\uff1a \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5fc5\u8981\u53c2\u6570\uff08\u5982\u670d\u52a1\u5668\u7aef\u53e3\u3001\u5bc6\u7801\u3001\u52a0\u5bc6\u65b9\u5f0f\u7b49\uff09\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-54108","post","type-post","status-publish","format-standard","hentry","category-vpn"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=54108"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54108\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=54108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=54108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=54108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}