
因为出国线路拥堵,用 openvpn 单线转发性能捉急,楼主调研发现了 openvpn bonding 这个玩意,可以做到多线程多链路转发。
在参考了 github 上 onemarcfifty/openvpn-bondng 这个项目后也算折腾起来了,使用 bond 模式 0 和 2 都可以做到网络提速,通过 iperf3 和服务端连接多线程测速,可以达到 50 多 mbps 的下行速度,可是用 speedtest 进行测速就只有 4mbps 。
有热心的 v2er 知道原因吗。。。 help
[ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 3.95 MBytes 3.31 Mbits/sec 169 sender [ 5] 0.00-10.00 sec 3.15 MBytes 2.64 Mbits/sec receiver [ 7] 0.00-10.00 sec 4.47 MBytes 3.75 Mbits/sec 171 sender [ 7] 0.00-10.00 sec 3.52 MBytes 2.95 Mbits/sec receiver [ 9] 0.00-10.00 sec 10.6 MBytes 8.91 Mbits/sec 377 sender [ 9] 0.00-10.00 sec 9.03 MBytes 7.58 Mbits/sec receiver [ 11] 0.00-10.00 sec 7.89 MBytes 6.62 Mbits/sec 453 sender [ 11] 0.00-10.00 sec 5.93 MBytes 4.97 Mbits/sec receiver [ 13] 0.00-10.00 sec 7.93 MBytes 6.65 Mbits/sec 356 sender [ 13] 0.00-10.00 sec 6.91 MBytes 5.80 Mbits/sec receiver [ 15] 0.00-10.00 sec 9.75 MBytes 8.18 Mbits/sec 226 sender [ 15] 0.00-10.00 sec 8.24 MBytes 6.91 Mbits/sec receiver [ 17] 0.00-10.00 sec 7.96 MBytes 6.67 Mbits/sec 224 sender [ 17] 0.00-10.00 sec 7.02 MBytes 5.89 Mbits/sec receiver [ 19] 0.00-10.00 sec 11.1 MBytes 9.33 Mbits/sec 462 sender [ 19] 0.00-10.00 sec 10.4 MBytes 8.70 Mbits/sec receiver [SUM] 0.00-10.00 sec 63.7 MBytes 53.4 Mbits/sec 2438 sender [SUM] 0.00-10.00 sec 54.2 MBytes 45.4 Mbits/sec receiver [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 8.72 MBytes 7.31 Mbits/sec 246 sender [ 5] 0.00-10.00 sec 7.97 MBytes 6.68 Mbits/sec receiver [ 7] 0.00-10.00 sec 8.95 MBytes 7.50 Mbits/sec 150 sender [ 7] 0.00-10.00 sec 8.35 MBytes 7.01 Mbits/sec receiver [ 9] 0.00-10.00 sec 9.33 MBytes 7.83 Mbits/sec 110 sender [ 9] 0.00-10.00 sec 8.76 MBytes 7.35 Mbits/sec receiver [ 11] 0.00-10.00 sec 9.44 MBytes 7.92 Mbits/sec 138 sender [ 11] 0.00-10.00 sec 8.83 MBytes 7.40 Mbits/sec receiver [ 13] 0.00-10.00 sec 8.62 MBytes 7.23 Mbits/sec 165 sender [ 13] 0.00-10.00 sec 8.00 MBytes 6.71 Mbits/sec receiver [ 15] 0.00-10.00 sec 9.82 MBytes 8.24 Mbits/sec 137 sender [ 15] 0.00-10.00 sec 9.20 MBytes 7.72 Mbits/sec receiver [ 17] 0.00-10.00 sec 8.98 MBytes 7.53 Mbits/sec 186 sender [ 17] 0.00-10.00 sec 8.31 MBytes 6.97 Mbits/sec receiver [ 19] 0.00-10.00 sec 8.35 MBytes 7.00 Mbits/sec 131 sender [ 19] 0.00-10.00 sec 7.84 MBytes 6.57 Mbits/sec receiver [SUM] 0.00-10.00 sec 72.2 MBytes 60.6 Mbits/sec 1263 sender [SUM] 0.00-10.00 sec 67.3 MBytes 56.4 Mbits/sec receiver Connecting to host 10.100.0.254, port 5201 Reverse mode, remote host 10.100.0.254 is sending [ 5] local 10.100.0.253 port 50882 connected to 10.100.0.254 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 141 KBytes 1.16 Mbits/sec [ 5] 1.00-2.00 sec 374 KBytes 3.06 Mbits/sec [ 5] 2.00-3.00 sec 912 KBytes 7.47 Mbits/sec [ 5] 3.00-4.00 sec 1.22 MBytes 10.2 Mbits/sec [ 5] 4.00-5.00 sec 1.42 MBytes 12.0 Mbits/sec [ 5] 5.00-6.00 sec 1.60 MBytes 13.4 Mbits/sec [ 5] 6.00-7.00 sec 1.81 MBytes 15.2 Mbits/sec [ 5] 7.00-8.00 sec 1.78 MBytes 14.9 Mbits/sec [ 5] 8.00-9.00 sec 1.80 MBytes 15.1 Mbits/sec [ 5] 9.00-10.00 sec 1.69 MBytes 14.2 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 13.6 MBytes 11.4 Mbits/sec 30 sender [ 5] 0.00-10.00 sec 12.7 MBytes 10.7 Mbits/sec receiver 一共 8 个 tap,单个 tap 显示 10Mbps,但查询了一些论坛,有些人表示被限速到 10mbps 但有些人说只是展示问题 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: load balancing (round-robin) MII Status: up MII Polling Interval (ms): 0 Up Delay (ms): 0 Down Delay (ms): 0 Peer Notification Delay (ms): 0 Slave Interface: tap1 MII Status: up Speed: 10 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: f6:8b:a1:db:0a:c9 Slave queue ID: 0 Slave Interface: tap2 MII Status: up Speed: 10 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 92:99:a7:28:58:ac Slave queue ID: 0 Slave Interface: tap3 MII Status: up Speed: 10 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 9e:8b:2f:83:42:a8 Slave queue ID: 0 Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default _gateway 0.0.0.0 UG 1 0 0 bond0 10.100.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0 link-local 0.0.0.0 255.255.0.0 U 1000 0 0 ens33 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 192.168.122.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33 这个命令行测速工具应该是多线程测速,通过浏览器访问 speedtest 也是这个速度 Retrieving speedtest.net configuration... Testing from FranTech Solutions (x.x.x.x)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Razzolink Inc (San Jose, CA) [0.45 km]: 305.063 ms Testing download speed................................................................................ Download: 4.37 Mbit/s Testing upload speed.................................................................................. Upload: 3.08 Mbit/s 1 tia 2020-09-29 13:44:41 +08:00 测国内节点 |
2 whyorwhynot OP @tia 通过 vpn 测 speedtest 国内节点?选择了一个靠近本地的节点,浙江宁波移动, 延迟 440ms Download 2.25Mbps,Upload 1.41 Mbps |
3 huangya 2020-09-29 19:14:43 +08:00 你确定 speedtest-cli 是多线程测速? speedtest-cli -h 看看有没有更多的 option 可以打开更多的 log, 一般是-vv(两个 vv 看下详细的 log,或者用 tcpdump 抓下包看看) |
4 JimmyTinsley 2020-09-29 19:38:05 +08:00 试试 speedtest 官方的 cli https://www.speedtest.net/zh-Hans/apps/cli |
5 whyorwhynot OP @huangya 是多线程的,看了一下代码,默认 8 线程,有一个 single 参数可以修改为单线程测速,测出来是多线程速度的差不多 1/8 (0.52 Mbit/s) |
6 whyorwhynot OP @JimmyTinsley 官方的 speedtest 默认线程数比 speedtest-cli 少了一半,是 4 个连接,测出来 download 2.3mbps 。。 |
7 dsnap5 2020-09-30 03:21:44 +08:00 via iPhone 内网中转鸡场,IPLC 流量转发,哪个不比你折腾的这玩艺要强 |
8 whyorwhynot OP @dsnap5 机场之类的也在用,流量有限,带宽给他们占满了也不好。折腾这个主要是因为用自己的 vps 可以无限流量,中转一下长期挂着 BT 下载,也有些图拉丁思想。这个 bonding 可能效果就是这么差吧。。。。逃 |
9 harwck 2020-10-01 16:53:47 +08:00 via Android 换成 speedtest-cli 仓库里的 speedtest-cli.py 即可解 |
10 fvladlpa 2020-10-02 14:04:37 +08:00 @whyorwhynot 讲真,你这种如果不走一些特殊的优化的线路,跟着公网挤,用啥都一样的。 |
11 luyunpsyduck 2020-10-14 07:45:09 +08:00 openvpn 的单线程性能瓶颈应该是在跑大流量,200mbps 以上一个核心的 CPU 占用会飙升到 90%之后回落,伴随传输掉速。 如果你公网路线垃圾的话,多线程也救不了你。 |
12 lin559671 2020-10-14 23:48:12 +08:00 via Android 是 openVPN udp ? udp 的话,换 wireguard 试试。tcp 的话,也可以试试 pptp bonding 。 公网线路差的话什么都救不了你。 |
13 whyorwhynot OP @luyunpsyduck @lin559671 公网线路垃圾。其实这 bonding 的多个线路还是走的 cloudflare cdn 通过 v2ray 任意门转发出来的 |