-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v20240828非常容易io closed #967
Comments
数据能完整传输么? |
比如实际传送搞一个大文件,有没有问题? |
是不是大约30s后出现 |
1、数据传输是完整的(不排除隧道内TCP完整性校验的结果) |
服务端: 附上测试视频: |
config.zip |
因为某种内部防火墙,被RST了么 |
可以排除这个原因,因为是直联的 |
这不好判断了,可以考虑换成其他的工具来测试,不一定非要iperf3 |
我再研究下 |
嗯嗯,这个问题困扰我很久,您有时间再看看,目前我换回上一个版本了 |
你可以尝试下我最新的提交,自己编译下 |
这个问题大概是这样的:
|
你可以尝试如下:(在最新的版本下,只改kcptun中的std/copy.go)
|
因此,我接下来要做的尝试如下: 区分server端的copy和client端的copy。 client端的copy是需要立即关闭的,不等待。 |
怎么说呢,这个问题可以环节,但因为是复用在一条链路上,因此一定存在 对头阻塞问题,就是Ctrl+C下中断不了已经堆积在kcp发送队列的数据。 https://zh.wikipedia.org/wiki/%E9%98%9F%E5%A4%B4%E9%98%BB%E5%A1%9E |
测试了一下,堆积应该是发生在server端,而不是client端 |
对的,就是这个问题,ctrl+c后,服务端在kcp 队列中的,cancel不掉,那么你可以降低per streambuffer,来缓解这个问题。 |
主要是有些奇葩的服务器,会用TCP HALF CLOSE,只关闭发送,不关闭接收,这种情况下,还得预留一个时间来收(30s) 。当然,对于你们的特定应用,你是可以关闭closeWait的,或者这个作为参数,写入启动config。我考虑下。 |
问题描述:一直使用作者的kcptun用于加速流量,对此非常感谢作者对开源的贡献。但因为水平有限只能将问题反馈出来
1、升级最新版本后,服务端经常出现io close,旧版本不会,具体表现为两次iperf测速后(跑满宽带),立马会出现无法发起任何连接(断流)
2、配置使用作者提供的配置#923
3、怀疑为7月27日的一次提交导致的,并且问题一直存在,链接:4193bb6
-key xxx
至少三遍,—— 检查一致-nocomp, -datashard, -parityshard, -key, -crypt, -smuxver, -QPP -QPPCount
两边一致。—— 检查一致Server 端
2024/08/30 11:36:06 remote address: 192.168.198.235:52815 2024/08/30 11:36:06 smux version: 2 on connection: [::]:39832 -> 192.168.198.235:52815 2024/08/30 11:36:20 remote address: 192.168.198.235:54825 2024/08/30 11:36:20 smux version: 2 on connection: [::]:39842 -> 192.168.198.235:54825 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(3) out: 127.0.0.1:3389 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(5) out: 127.0.0.1:3389 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(7) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(9) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(11) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(13) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(15) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(17) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(19) out: 127.0.0.1:3389 2024/08/30 11:36:29 stream opened in: 192.168.198.235:54825(21) out: 127.0.0.1:3389 2024/08/30 11:36:36 io: read/write on closed pipe 2024/08/30 11:36:53 stream opened in: 192.168.198.235:54825(23) out: 127.0.0.1:3389 2024/08/30 11:36:53 stream opened in: 192.168.198.235:54825(25) out: 127.0.0.1:3389
Client
2024/08/30 11:36:06 remote address: 192.168.198.235:52815 2024/08/30 11:36:06 smux version: 2 on connection: [::]:39832 -> 192.168.198.235:52815 2024/08/30 11:36:20 remote address: 192.168.198.235:54825 2024/08/30 11:36:20 smux version: 2 on connection: [::]:39842 -> 192.168.198.235:54825 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(3) out: 127.0.0.1:3389 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(5) out: 127.0.0.1:3389 2024/08/30 11:36:20 stream opened in: 192.168.198.235:54825(7) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(9) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(11) out: 127.0.0.1:3389 2024/08/30 11:36:23 stream opened in: 192.168.198.235:54825(13) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(15) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(17) out: 127.0.0.1:3389 2024/08/30 11:36:26 stream opened in: 192.168.198.235:54825(19) out: 127.0.0.1:3389 2024/08/30 11:36:29 stream opened in: 192.168.198.235:54825(21) out: 127.0.0.1:3389 2024/08/30 11:36:36 io: read/write on closed pipe 2024/08/30 11:36:53 stream opened in: 192.168.198.235:54825(23) out: 127.0.0.1:3389 2024/08/30 11:36:53 stream opened in: 192.168.198.235:54825(25) out: 127.0.0.1:3389
附上配置:
server:
{ "smuxver": 2, "listen": "[::]:39810-39900", "target": "127.0.0.1:3389", "key": "123456789", "crypt": "aes", "mode": "fast", "mtu": 1400, "sndwnd": 2048, "rcvwnd": 2048, "datashard": 10, "parityshard": 0, "dscp": 46, "nocomp": true, "acknodelay": false, "nodelay": 1, "interval": 20, "resend": 2, "nc": 1, "sockbuf": 16777217, "smuxbuf": 16777217, "streambuf":4194304, "keepalive": 10, "pprof":false, "quiet":false, "tcp":false, "log": "/tmp/kcptun.log" }
客户端:
{ "smuxver": 2, "localaddr": "127.0.0.1:60002", "remoteaddr": "192.168.199.7:39810-39900", "key": "123456789", "crypt": "aes", "mode": "fast", "mtu": 1400, "sndwnd": 256, "rcvwnd": 2048, "datashard": 10, "parityshard": 0, "dscp": 46, "nocomp": true, "acknodelay": false, "nodelay": 1, "interval": 20, "resend": 2, "nc": 1, "conn": 1, "sockbuf": 16777217, "smuxbuf": 16777217, "streambuf":4194304, "keepalive": 10, "autoexpire":600, "quiet":true, "tcp":false, "log": "/tmp/kcptun.log" }
具体表现截图:
The text was updated successfully, but these errors were encountered: