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

low speed in speedtest #22

Open
linnuxx opened this issue Apr 20, 2024 · 2 comments
Open

low speed in speedtest #22

linnuxx opened this issue Apr 20, 2024 · 2 comments

Comments

@linnuxx
Copy link

linnuxx commented Apr 20, 2024

No description provided.

@cnbatch
Copy link
Owner

cnbatch commented Apr 20, 2024

First of all, it needs to be explained that kcptube is not specifically designed for high-traffic scenarios, but primarily for reducing latency.

However, the speed you measured is really too low, which suggests that either your ISP is strictly throttling UDP traffic or the kcptube bandwidth settings are incorrect.

I'm not sure how far the discussion and research on KCP has gone in the English world, so I'll quote and use the Chinese explanation in the following part.

KCP本身有一个快速重传机制,用于对抗丢包、降低延迟。中文世界一直流传着这么一个说法:比TCP浪费10%-20%的带宽。kcptube在使用该机制时会相对激进,尤其是fast模式,造成的流量浪费一点都不少,最高可达50%。
为了尽可能减少流量浪费,kcptube提供了带宽设置选项。如果该选项的值高于线路实际带宽,那就会造成kcptube以为当前线路丢包率太高,从而发送更多的冗余数据包,最终恶性循环导致有效流量过低。
所以,请把inbound_bandwidth以及outbound_bandwidth的值设置成低于或等于当前线路的实际带宽数值。

另一方面,由于kcptube激进地尝试降低延迟,会导致高流量时CPU使用率偏高,并且最大的流量值会受到CPU性能的限制。

如果调整过两个bandwidth设置后,流量速率还是不高的话,建议使用另一个工具:udphop,并开启FEC选项。
对于wireguard组网而言,udphop是更好的选择。

The Chinese Text to English:

KCP itself has a fast retransmission mechanism to combat packet loss and reduce latency. There is a saying in the Chinese world that it wastes 10%-20% more bandwidth than TCP. kcptube is relatively aggressive when using this mechanism, especially in ‘fast’ mode, causing a lot of bandwidth waste, up to a maximum of 50%.

In order to minimize bandwidth waste, kcptube provides bandwidth setting options. If the value of these options are higher than the actual bandwidth of the broadband line, they will cause kcptube to believe that the loss rate of current line is too high, and thus send more redundant data packets, which will eventually lead to a vicious cycle of low effective throughput.

Therefore, please set the values of inbound_bandwidth and outbound_bandwidth to be lower than or equal to the actual bandwidth of the current line.

On the other hand, due to kcptube's aggressive attempts to reduce latency, it will lead to high CPU usage under high traffic conditions, and the maximum throughput will be limited by CPU performance.

If the traffic is still not high after adjusting the two bandwidth settings, it is recommended to use another tool: udphop, and enable the FEC option.

udphop is a better choice for wireguard networking.

@cnbatch
Copy link
Owner

cnbatch commented Apr 20, 2024

I've also explained in 低延迟与大流量
English Version is not ready yet. You might need to use AI translation or some other translator.

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

2 participants