lazy-luo / smarGate

内网穿透,c++实现,无需公网IP,小巧,易用,快速,安全,最好的多链路聚合(p2p+proxy)模式,不做之一...这才是你真正想要的内网穿透工具!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

P2P速度缓慢

MikuChat opened this issue · comments

服务端(Linux)宽带环境:500M上下对等
客户端(Android)宽带环境:200M下行,30M上行

在P2P成功后使用iperf3进行速度测试,速度大概只有30Mbps左右

服务端结果如下:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-60.03 sec 222 MBytes 31.0 Mbits/sec 5 sender

随后换了另一台手机,依旧30Mbps左右

服务端结果如下:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-60.07 sec 184 MBytes 25.7 Mbits/sec 60 sender

#55 了解到 :和接收缓存有关
请问您是否有计划开放缓存大小自定义呢

P2P速度基本上==Min(两边上、下行带宽)
缓存大小支持100-300m网络没有问题,暂时不调整。
另,移动5G网络测试,实际下载速度可达50MB左右,足够用了

iperf3服务端发送(500M上行)客户端接收(200M下行),理论上200M应该不是问题

iperf3服务端发送(500M上行)客户端接收(200M下行),理论上200M应该不是问题
1、确保P2P
2、不走SG测试一下,做一个对比

image

我把官方代理关闭了,确定走的p2p,如上图所示,速度显示3MB/s

FRP P2P (KCP协议)
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.09 sec 178 MBytes 148 Mbits/sec 17 sender

服务端 公网IP直连
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.04 sec 313 MBytes 261 Mbits/sec 26 sender

SmarGate P2P
[ ID] Interval Transfer Bitrate Retr
[ 6] 0.00-10.09 sec 35.4 MBytes 29.4 Mbits/sec 5 sender

1、电脑连接手机热点,并启动iperf server,手机app到电脑SG服务端为P2P网络,用电脑使用iperf3通过手机代理进行测试:大致100m左右


[ ID] Interval Transfer Bitrate Retr
[ 6] 0.00-10.00 sec 110 MBytes 92.4 Mbits/sec 0 sender
[ 6] 0.00-10.47 sec 98.0 MBytes 78.6 Mbits/sec receiver

2、手机和电脑都连接家中无线路由器(100m),用电脑使用iperf3通过手机代理进行测试


[ ID] Interval Transfer Bitrate Retr
[ 6] 0.00-10.00 sec 64.7 MBytes 54.3 Mbits/sec 1300 sender
[ 6] 0.00-12.97 sec 59.0 MBytes 38.2 Mbits/sec receiver

网速基本还算正常,测试中RTT不太稳定,有可能是无线网络的原因

可以试试使用服务端间映射,不走手机代理

同样2台机器,服务端间映射竟然不能P2P

经过一段时间测试,似乎是ipv6的问题
设置ipv4-only后正常了
[ 5] 10.00-11.00 sec 12.2 MBytes 102 Mbits/sec 1 895 KBytes
[ 5] 11.00-12.00 sec 15.2 MBytes 128 Mbits/sec 1 767 KBytes
[ 5] 12.00-13.00 sec 22.2 MBytes 186 Mbits/sec 1 895 KBytes
[ 5] 13.00-14.00 sec 8.87 MBytes 74.4 Mbits/sec 2 895 KBytes
[ 5] 14.00-15.00 sec 14.2 MBytes 119 Mbits/sec 1 895 KBytes
[ 5] 15.00-16.00 sec 8.74 MBytes 73.3 Mbits/sec 1 767 KBytes
[ 5] 16.00-17.00 sec 15.2 MBytes 127 Mbits/sec 1 767 KBytes
[ 5] 17.00-18.00 sec 19.5 MBytes 163 Mbits/sec 0 895 KBytes
[ 5] 18.00-19.00 sec 15.2 MBytes 127 Mbits/sec 1 895 KBytes
[ 5] 19.00-20.00 sec 11.9 MBytes 100 Mbits/sec 0 895 KBytes
[ 5] 20.00-21.00 sec 14.1 MBytes 118 Mbits/sec 1 895 KBytes
[ 5] 21.00-22.00 sec 18.6 MBytes 156 Mbits/sec 3 895 KBytes
[ 5] 22.00-23.00 sec 3.25 MBytes 27.3 Mbits/sec 0 895 KBytes
[ 5] 23.00-24.00 sec 10.8 MBytes 90.6 Mbits/sec 1 895 KBytes
[ 5] 24.00-25.00 sec 4.37 MBytes 36.7 Mbits/sec 0 895 KBytes
[ 5] 25.00-26.00 sec 14.1 MBytes 118 Mbits/sec 0 895 KBytes
[ 5] 26.00-27.00 sec 13.0 MBytes 109 Mbits/sec 0 895 KBytes
[ 5] 27.00-28.00 sec 12.2 MBytes 102 Mbits/sec 1 767 KBytes
[ 5] 28.00-29.00 sec 3.31 MBytes 27.8 Mbits/sec 0 895 KBytes
[ 5] 29.00-30.00 sec 5.50 MBytes 46.1 Mbits/sec 0 895 KBytes
[ 5] 30.00-30.04 sec 1.06 MBytes 212 Mbits/sec 0 895 KBytes

不过速度忽大忽小,暂时未知原因(FRP P2P 和 公网直连 速度稳定)

另外反馈一个小bug,安卓端设置ipv4-only并不能立马生效,重启APP后UI按钮还原成关闭状态,但实际设置还是保存的,再次按下开关,UI显示状态又和实际状态是相反的?

image
image

1、ipv4状态BUG请更新APP
2、P2P隧道可能被配置为SSL,如果需要吞吐量不在乎安全,可以将配置文件中 ssl-tunnel-required 配置项删掉或配置为“none”

感谢