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

低丢包网络可以考虑关闭 FEC #358

Closed
Nlzy opened this Issue Dec 28, 2016 · 11 comments

Comments

Projects
None yet
8 participants
@Nlzy
Copy link

Nlzy commented Dec 28, 2016

Server 是 Bandwagonhost (Phoenix),client 是腾讯云(广州)。
走的是电信线路,丢包较低,白天不超过 1% 。
测试目的:达到尽可能高的传输速度。

保持不动的参数:

  "crypt" : "salsa20",
  "mode" : "fast",
  "nocomp" : true,
  "mtu" : 512,

开启 FEC

  "datashard"   : 10,
  "parityshard" : 10,
  "rcvwnd"      : 1920,
  "sndwnd"      : 1920,

关闭 FEC

  "datashard"   : 0,
  "parityshard" : 0,
  "rcvwnd"      : 4096,
  "sndwnd"      : 4096,

窗口值是经多次测试,取一个最优值。

测试方法:server 开一个 nginx ,kcptun 目标端口直接指向 nginx 的端口。client 用 curl 下载一个 200MB 的文件测速。(文件使用 dd if=/dev/urandom 产生)

项目 直接连接 开启 FEC 关闭 FEC
下载速度 44 KB/s 3976 KB/s 5233 KB/s
消耗流量 N/A 477 MB 277 MB
流量利用率 N/A 41% 72%

在低丢包情况下,关闭 FEC 几乎完胜。

@choicky

This comment has been minimized.

Copy link

choicky commented Dec 28, 2016

dd 以及 curl 的具体命令是啥?我有空也试试我的。
我之前都是通过 fast.com 测速……

@Nlzy

This comment has been minimized.

Copy link

Nlzy commented Dec 29, 2016

另:以上关闭 FEC 的参数,其瓶颈已经不在网络链路上了。而是 bandwagon 的 CPU 已经满载了。
把加密方式改成 none 再提升窗口值,可以跑到 6900 KB/s 了
此外, salsa20 的 CPU 占用率会比 aes-128 略低一点,xor 和 salsa20 相比没有任何优势。

@bettermanbao

This comment has been minimized.

Copy link

bettermanbao commented Dec 29, 2016

帮瓦工这么大流量发包,不会被suspended吗?

@xtaci xtaci added the PARAMS label Dec 29, 2016

@Nlzy

This comment has been minimized.

Copy link

Nlzy commented Dec 29, 2016

@bettermanbao 会的,长时间占用大量 CPU 资源会被限制。本来性能瓶颈就是在 CPU 上面,一限制 CPU 速度就只有几百 K 了。测试数据里的 4096 大窗口值只是短时间测试,长时间用肯定是不行的。我自用也就 1024 的窗口值,不敢开高。

@bettermanbao

This comment has been minimized.

Copy link

bettermanbao commented Dec 30, 2016

@Nlzy 我租的廉价的Sentris,只要长时间大流量发包,就会被suspended,然后完全就不能用了。搬瓦工到还不错,你窗口开4096也没问题。

@Nlzy

This comment has been minimized.

Copy link

Nlzy commented Dec 30, 2016

@bettermanbao 搬瓦工我试过了,窗口开高了长时间使用会被限制的,限制之后速度慢的不行,没法用。

@Nlzy

This comment has been minimized.

Copy link

Nlzy commented Dec 30, 2016

@choicky dd 具体命令忘了,curl 是 curl 127.0.0.1:1111/200M.bin -o /dev/null,1111 是 kcptun-client 的监听端口。

@xmoiduts

This comment has been minimized.

Copy link

xmoiduts commented Dec 30, 2016

国内到国内线路测试有效,开启FEC : 1.6MB/s -- 40mbps ;关闭FEC : 1.9MB/s -- 21mbps

@lvii

This comment has been minimized.

Copy link

lvii commented Jan 9, 2017

@Nlzy 请问 服务端 的 MTU 也要设置为 512 么 ?

@bash99

This comment has been minimized.

Copy link

bash99 commented Jan 11, 2017

我到西海岸的,无论怎么设fec都没啥效果,fecsegs远远低于outsegs。最后还是关掉了。

@xtaci xtaci closed this Jan 13, 2017

@w12928293

This comment has been minimized.

Copy link

w12928293 commented Jan 24, 2017

我的搬瓦工丢包也很低,改天关闭试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment