Skip to content
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

参数设定参考 #16

Closed
trivita opened this issue May 17, 2016 · 3 comments
Closed

参数设定参考 #16

trivita opened this issue May 17, 2016 · 3 comments

Comments

@trivita
Copy link

trivita commented May 17, 2016

difference between fast2 fast normal and default

@trivita trivita changed the title care to elaborate on mode parameter? thanks care to explain the mode parameter? thanks May 17, 2016
@xtaci
Copy link
Owner

xtaci commented May 17, 2016

        switch mode {
        case MODE_FAST2:
                sess.kcp.NoDelay(1, 10, 2, 1)
        case MODE_FAST:
                sess.kcp.NoDelay(1, 20, 2, 1)
        case MODE_NORMAL:
                sess.kcp.NoDelay(0, 20, 0, 1)
        default:
                sess.kcp.NoDelay(0, 20, 0, 0)
        }

it's defined above in sess.go of kcp-go

@xtaci xtaci changed the title care to explain the mode parameter? thanks 参数设定参考 May 17, 2016
@xtaci
Copy link
Owner

xtaci commented May 17, 2016

sndwnd/rcvwnd 设定参考

  1. sndwnd * mtu 不能超过上行带宽, rcvwnd * mtu 不能超过下行带宽
  2. 对延迟不敏感的情况,比如只用于数据传输,可以用MODE_FAST,20ms的内部时钟,默认值
  3. 对延迟敏感的情况,可以用FAST2模式,但必须严格注意第一条规则

@jannson
Copy link
Contributor

jannson commented May 18, 2016

虽然我是 100M 的,但是实验表明 512 更适合我. 明天我换一台服务器试试.

@xtaci xtaci closed this as completed May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants