From fa929b10ae867a2551ac472c1da31e46e9721bf5 Mon Sep 17 00:00:00 2001 From: Toby Date: Fri, 30 Apr 2021 22:23:37 -0700 Subject: [PATCH] Optimization tips for routers and other embedded devices --- README.md | 12 +++++++++++- README.zh.md | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9edc25..c10f240 100644 --- a/README.md +++ b/README.md @@ -286,7 +286,9 @@ References: - https://www.kernel.org/doc/Documentation/networking/tproxy.txt - https://powerdns.org/tproxydoc/tproxy.md.html -## Optimizing for extreme transfer speeds +## Optimization tips + +### Optimizing for extreme transfer speeds If you want to use Hysteria for very high speed transfers (e.g. 10GE, 1G+ over inter-country long fat pipes), consider increasing your system's UDP receive buffer size. @@ -301,6 +303,14 @@ You may also need to increase `recv_window_conn` and `recv_window` (`recv_window they are at least no less than the bandwidth-delay product. For example, if you want to achieve a transfer speed of 500 MB/s on a line with an RTT of 200 ms, you need a minimum receive window size of 100 MB (500*0.2). +### Routers and other embedded devices + +For devices with very limited computing power and RAM, turning off obfuscation can bring a slight performance boost. + +The default receive window size for both Hysteria server and client is 64 MB. Consider lowering them if it's too large +for your device. Keeping a ratio of one to four between stream receive window and connection receive window is +recommended. + ## ACL [ACL File Format](ACL.md) diff --git a/README.zh.md b/README.zh.md index 79a4946..eb4d369 100644 --- a/README.zh.md +++ b/README.zh.md @@ -273,7 +273,9 @@ TPROXY 模式 (`tproxy_tcp` 和 `tproxy_udp`) 只在 Linux 下可用。 - https://www.kernel.org/doc/Documentation/networking/tproxy.txt - https://powerdns.org/tproxydoc/tproxy.md.html -## 针对超高传速度进行优化 +## 优化建议 + +### 针对超高传速度进行优化 如果要用 Hysteria 进行极高速度的传输 (如内网超过 10G 或高延迟跨国超过 1G),请增加系统的 UDP receive buffer 大小。 @@ -286,6 +288,13 @@ sysctl -w net.core.rmem_max=4000000 你可能还需要提高 `recv_window_conn` 和 `recv_window` (服务器端是 `recv_window_client`) 以确保它们至少不低于带宽-延迟的乘积。 比如如果想在一条 RTT 200ms 的线路上达到 500 MB/s 的速度,receive window 至少需要 100 MB (500*0.2) +### 路由器与其他嵌入式设备 + +对于运算性能和内存十分有限的嵌入式设备,如果不是必须的话建议关闭混淆,可以带来少许性能提升。 + +Hysteria 服务端与客户端默认的 receive window 大小是 64 MB。如果设备内存不够,请考虑通过配置降低。建议保持 stream receive window +和 connection receive window 之间 1:4 的比例关系。 + ## 关于 ACL [ACL 文件格式](ACL.zh.md)