hev
hev
The [v2.6.9](https://github.com/heiher/hev-socks5-tunnel/releases/tag/2.6.9) allocates TCP buffers on the stack and optimizes the memory footprint, which helps reduce physical memory usage.
> > The [v2.6.9](https://github.com/heiher/hev-socks5-tunnel/releases/tag/2.6.9) allocates TCP buffers on the stack and optimizes the memory footprint, which helps reduce physical memory usage. > > it seems would crash in my macOS...
> 我看了下 您的库 和 go-tun2socks 的库 都是用的lwip 这个基础库 但是 为什么您这个上下行上限却比 go-tun2socks高很多 是因为c语言 和 go 性能层次上的差距 还是说因为go-tun2socks 本身实现的问题 具体我也没有仔细剖析过,主要是不太懂Go。我想将lwip的zero-copy利用起来可能是因素之一吧。 > 还有就是 我看了下 xjasonlyu/tun2socks 他的benchmark 他的评测下载速度是达到raw speed的80%的 你的benchmark 没有写raw speed是多少 就安装100%算(毫无损耗) xjasonlyu/tun2socks...
> 我自己也在windows 下测试过 (linux没测) windows下 因为gvisor stack tcp sack的问题 导致下载速度 甚至不如go-tun2socks 但是稳定性 确实是比 go-tun2socks 好 而且 go-tun2socks 的上行 是确实很慢。 受限于 hev-socks5-tunnel 的底层协程框架,目前只能工作在 Unix 平台上。如果你有兴趣做更多的对比测试,目前建议使用 Linux 平台。
> > 主要是没有万兆网卡来做这个测试,不过有在低CPU性能的设备上对比过 > > 网卡我看了下 xjasonlyu/tun2socks 测试的网卡是10G 你这边测试的是100G 但是他的测试结果 单并发和多并发下的下载速度差距不大 您这边 单线程下载是25G/s 多线程下载是 82G/s 也就是说 单线程25G/s 已经达到程序的上限了 我这么理解对么 您测试过raw speed 单线程下载是什么网速没 我看没有公布raw speed的测试结果 不是100G物理网卡,而是veth的虚拟网卡。raw speed我还没跑过,如果性质与loopback类似的话,根据hev-socks5-server的结果,估计至少也有300Gbps以上吧。
如果server也跑在部署了tunnel的系统上,需要让server的outgoing连接绕过tunnel。简单的方法是把server跑在一个特别的用户上,比如nobody或daemon,然后增加一个pref 10的rule: ```bash sudo ip rule add uidrange x-x lookup main pref 10 sudo ip -6 rule add uidrange x-x lookup main pref 10 ```
我这边没注意到有HTTP请求特别慢的情况,检查一下是不是DNS的问题,浏览器里开发者工具里好像可以看到请求各个阶段花的时间。 tun2socks目前只处理TCP和UDP,其它协议不处理。
初始连接也没遇到过,感观上是正常的。会不会是环境没有IPv6?hev-socks5-tunnel关掉IPv6试试。
tunnel里关,注释掉这行: https://github.com/heiher/hev-socks5-tunnel/blob/master/conf/main.yml#L13 晚点我测测chrome
可能是有IPv6地址会优先尝试一下,超时再fallback到IPv4,socks5服务端没有IPv6就不要在tunnel里开。