背景
最近看到 v2fly 上面多了蛮多新玩法。综合个人隐蔽性需求,将对以下搭配使用 iperf, speedtest mini, v2ray, clash premium 和 speedtest-cli 进行测速。
测速方式来自:https://steemit.com/cn/@v2ray/3cjiux
只考虑这两种隐蔽性强和兼容相对广泛的搭配。
比如 VLESS+WEB 通过分流器的操作,识别起来比较方便,WireShark就可以很简单的区分,故不考虑。
| HTTP 协议 | TLS | v2ray inbound协议 | 加密 | 
|---|---|---|---|
| HTTP/2 | YES | H2C | none | 
| HTTP/2 | YES | H2C | AES-128-GCM | 
| HTTP 1.x | YES | WS | none | 
| HTTP 1.x | YES | WS | AES-128-GCM | 
本次测试的目的
测试 VMess 基于 HTTP 隐藏的各种加密方式,在常规传输过程中的参考速度。
测试方法
- 在两台 2c4h16g 4Gbps 的 Oracle VM.Standard.E4.Flex 虚拟机上面分别搭建 基于 HTTP 1.x 和 HTTP/2 v2ray 服务端以及 speedtest mini服务端,并在一台2c4h16g 4Gbps 的 Oracle VM.Standard3.Flex 虚拟机搭建服务端,使用 speedtest-cli 通过代理进行测速。
 - 如何判断真的走了代理?查看服务端和客户端的 网卡流量信息 和 v2ray 日志信息
 
测试环境
V2Ray Core 版本 v4.44.0
Clash 版本:
Clash 2022.01.27 linux amd64 with go1.18beta1 Thu Jan 27 13:02:53 UTC 2022
speedtest-cli
2.1.2 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
系统均使用 Ubuntu 20.04,并开启 BBR
VM 都设置为 CPU 可突发,突发基线为 50%
- 2 x Oracle VM.Standard.E4.Flex 2c4h16g 4Gbps
 
1  | Architecture: x86_64  | 
- 1 x Oracle VM.Standard3.Flex 2c4h16g 4Gbps
 
1  | Architecture: x86_64  | 
测速工具
- 使用 iperf3 进行服务器之间裸连测速
 - 使用 speedtest-cli 进行代理测速
 - 测速节点搭建见 → https://iitii.github.io/2022/02/27/1/
 
基本信息
| Host | v2ray | speedtest-mini | 
|---|---|---|
| n3kr.google.com | server | server | 
| n4kr.google.com | server | server | 
| n5kr.google.com | client | client | 
- iperf3 可以查看客户端和服务端为 4Gbps 的带宽
 - speedtest-cli 的测速结果也基本如此
 
| 序号 | 上传 | 下载 | 
|---|---|---|
| 0 | 3695.28 | 2651.07 | 
| 1 | 3743 | 2528.95 | 
| 2 | 3737.46 | 2526.12 | 
| 3 | 3720.5 | 2518.34 | 
| 4 | 3707.66 | 2169.3 | 
| 5 | 3696.48 | 2668.12 | 
| 6 | 3740.51 | 2534.96 | 
| 7 | 3623.87 | 2178.24 | 
| 8 | 3651.62 | 2278.35 | 
| 9 | 3681.29 | 2627.53 | 

Vmess 测速
- 测速命令
 
1  | three (){  | 
- 测速节点使用 speedtest mini 搭建,详见 →
 
h2 测速的过程中原版客户端出了点奇奇怪怪的问题,后续都换成了 clash premium 进行测试
HTTP/2+TLS+H2C+AUTO+WEB
测试过程中 此种测试模式出现过服务端被打挂的情况
https://github.com/Dreamacro/clash/releases/tag/premium
three 20 "speedtest-cli --mini http://n4kr.google.com --csv"
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1076.26 | 2231.14 | 
| 1 | 1078.07 | 1844.21 | 
| 2 | 1065.16 | 2322.42 | 
| 3 | 1091.96 | 2508.72 | 
| 4 | 1066.28 | 1718.2 | 
| 5 | 1087.6 | 1513 | 
| 6 | 1047.8 | 1628.8 | 
| 7 | 1091.55 | 1880.86 | 
| 8 | 1076.29 | 1597.85 | 
| 9 | 1088.29 | 2505.67 | 
| 10 | 1080.98 | 2045.66 | 
| 11 | 1061.3 | 2531.48 | 
| 12 | 1071.67 | 1211.68 | 
| 13 | 1061.07 | 2367.3 | 
| 14 | 1080.41 | 1783.14 | 
| 15 | 1068.84 | 1295.37 | 
| 16 | 1084.67 | 1853.48 | 
| 17 | 1070.99 | 2470.81 | 
| 18 | 1056.12 | 1826.57 | 
| 19 | 1075.17 | 1855.11 | 

HTTP/2+TLS+H2C+NONE+WEB
测试过程中 此种测试模式出现过服务端被打挂的情况
https://github.com/Dreamacro/clash/releases/tag/premium
three 20 "speedtest-cli --mini http://n4kr.google.com --csv"
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 963.34 | 2111.67 | 
| 1 | 977.8 | 1724.18 | 
| 2 | 945.92 | 1629.36 | 
| 3 | 963.28 | 1378.45 | 
| 4 | 954.78 | 1723.26 | 
| 5 | 972.52 | 1910.12 | 
| 6 | 962.8 | 2213.12 | 
| 7 | 961 | 2104.75 | 
| 8 | 953.15 | 2176.02 | 
| 9 | 961.77 | 1243.26 | 
| 10 | 996.41 | 1521.64 | 
| 11 | 975.14 | 2414.55 | 
| 12 | 972.16 | 1720.12 | 
| 13 | 972.96 | 1478.24 | 
| 14 | 996.41 | 1649.12 | 
| 15 | 970.1 | 1860 | 
| 16 | 978.04 | 1719 | 
| 17 | 962.62 | 2077.84 | 
| 18 | 959.15 | 1891.93 | 
| 19 | 959.18 | 1909.39 | 

HTTP/2+TLS+H2C+AES-128-GCM+WEB
three 20 "speedtest-cli --mini http://n4kr.google.com --csv"
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1072.17 | 1728.56 | 
| 1 | 1077.94 | 1688.53 | 
| 2 | 1090.05 | 2240.06 | 
| 3 | 1081.83 | 1629.94 | 
| 4 | 1090.17 | 2013.98 | 
| 5 | 1063.47 | 1975.27 | 
| 6 | 246.05 | 1874.91 | 
| 7 | 1063.88 | 2011.35 | 
| 8 | 1074.73 | 1903.28 | 
| 9 | 1105.14 | 2267.92 | 
| 10 | 1073.03 | 2054.66 | 
| 11 | 1078.88 | 1472.24 | 
| 12 | 1078.27 | 1920.74 | 
| 13 | 1070.27 | 1822.1 | 
| 14 | 1068.5 | 1832.75 | 
| 15 | 1077.01 | 1870.06 | 
| 16 | 1094.16 | 1855.11 | 
| 17 | 1073.3 | 1972.83 | 
| 18 | 1061.9 | 1856.69 | 
| 19 | 1004.17 | 2513.06 | 

HTTP1.x+TLS+WS+NONE+WEB
three 20 "speedtest-cli --mini http://n4kr.google.com --csv"- clash
 - Clash HTTP1.x+TLS+WS+NONE+WEB
 
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1882.92 | 1267.29 | 
| 1 | 1883.45 | 934.95 | 
| 2 | 1886.13 | 492.51 | 
| 3 | 1901.5 | 383.79 | 
| 4 | 1874.9 | 414.77 | 
| 5 | 1874.42 | 370.57 | 
| 6 | 1910.24 | 307.24 | 
| 7 | 1877.43 | 637.83 | 
| 8 | 1869.76 | 361.3 | 
| 9 | 1897.93 | 2059.06 | 
| 10 | 1889.59 | 1005.95 | 
| 11 | 1873.72 | 276.55 | 
| 12 | 1893.87 | 372.17 | 
| 13 | 1879.64 | 226.87 | 
| 14 | 1896.9 | 1142.58 | 
| 15 | 1882.13 | 1007.48 | 
| 16 | 1874.78 | 366.35 | 
| 17 | 1880.32 | 2021.74 | 
| 18 | 1901.97 | 1766.16 | 
| 19 | 1877.77 | 950.76 | 

- Clash HTTP1.x+TLS+WS+AUTO+WEB
 
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1887.99 | 1871.85 | 
| 1 | 1868.47 | 380.05 | 
| 2 | 1876.47 | 2409.5 | 
| 3 | 1882.28 | 2029.39 | 
| 4 | 1865.41 | 1821.91 | 
| 5 | 1868.34 | 1157.13 | 
| 6 | 1871.73 | 489.02 | 
| 7 | 1885.19 | 1850.75 | 
| 8 | 1859.45 | 2485.44 | 
| 9 | 1876.98 | 1934.64 | 
| 10 | 1685.45 | 364.68 | 
| 11 | 1873.05 | 78.48 | 
| 12 | 1857 | 1973.31 | 
| 13 | 1870.48 | 1829.71 | 
| 14 | 1736.28 | 1656.51 | 
| 15 | 1874.78 | 1971.4 | 
| 16 | 1856.34 | 675.46 | 
| 17 | 1869.51 | 2069.49 | 
| 18 | 1856.84 | 515.95 | 
| 19 | 1879.48 | 2031.77 | 

- v2ray client
 
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1870.21 | 706.89 | 
| 1 | 1910.88 | 438.43 | 
| 2 | 1891.06 | 677.95 | 
| 3 | 1884.05 | 756.88 | 
| 4 | 1920.39 | 172.93 | 
| 5 | 1921.31 | 619.55 | 
| 6 | 1882.68 | 697.71 | 
| 7 | 1920.67 | 154.28 | 
| 8 | 1828.46 | 196.31 | 
| 9 | 1926.01 | 468.58 | 
| 10 | 1901.83 | 647.56 | 
| 11 | 1889.04 | 617.24 | 
| 12 | 1921.46 | 1630.4 | 
| 13 | 1905.12 | 62.38 | 
| 14 | 1899.19 | 204.08 | 
| 15 | 1914.48 | 600.8 | 
| 16 | 1924.44 | 462.51 | 
| 17 | 1890.84 | 429.16 | 
| 18 | 1923.15 | 110.51 | 
| 19 | 1861.36 | 660.72 | 


HTTP1.x+TLS+WS+AES-128-GCM+WEB
three 20 "speedtest-cli --mini [http://n3kr.google.com](http://n3kr.google.com/) --csv"- clash
 
| 0 | 1829.87 | 1848.88 | 
|---|---|---|
| 1 | 1856.46 | 1862.17 | 
| 2 | 1883.04 | 962.03 | 
| 3 | 1880.82 | 85.32 | 
| 4 | 1874.22 | 1843.67 | 
| 5 | 1886.13 | 452.37 | 
| 6 | 1884.27 | 1679.2 | 
| 7 | 1877.98 | 2068.18 | 
| 8 | 1866.52 | 438.04 | 
| 9 | 1861.99 | 1761.73 | 
| 10 | 1881.63 | 1622.57 | 
| 11 | 1890.39 | 543.63 | 
| 12 | 280.41 | 2282.18 | 
| 13 | 1843.48 | 1100.14 | 
| 14 | 1867.55 | 94.3 | 
| 15 | 1884.06 | 233.99 | 
| 16 | 1849.24 | 2343.5 | 
| 17 | 1885.6 | 128.86 | 
| 18 | 1841.05 | 344.33 | 
| 19 | 1868.43 | 421.24 | 

- v2ray client
 
| 序号 | 下载 | 上传 | 
|---|---|---|
| 0 | 1844.75 | 462.54 | 
| 1 | 1900.02 | 154.19 | 
| 2 | 1866.24 | 71.44 | 
| 3 | 1873.19 | 455.46 | 
| 4 | 1899.42 | 671.59 | 
| 5 | 1868.68 | 102.96 | 
| 6 | 1886.71 | 175.74 | 
| 7 | 1833.61 | 202.97 | 
| 8 | 1852.31 | 331.49 | 
| 9 | 1867.58 | 1285.72 | 
| 10 | 1884.36 | 1376.54 | 
| 11 | 1831.86 | 416.34 | 
| 12 | 1872.34 | 179.22 | 
| 13 | 1867.74 | 1349.64 | 
| 14 | 1830.08 | 718.3 | 
| 15 | 1880.34 | 177.74 | 
| 16 | 1896.96 | 608.69 | 
| 17 | 1908.02 | 18.55 | 
| 18 | 1859.84 | 170.36 | 
| 19 | 1878.93 | 196.64 | 

结论
- 单看 HTTP 1.x 的话,无论是 NONE、AUTO还是 AES-128-GCM,下载都区别不大,上传貌似 AUTO 要好一点,推荐 Clash HTTP1.x+TLS+WS+AUTO+WEB
 - 单看 HTTP/2 的话,AUTO 和 AES-128-GCM 在下载时略优于 NONE,上传貌似 AES-128-GCM略优一点,平均速度三种都差不多,抖动的话AES-128-GCM小点。
 - 不知道是 HTTP/2 目前线程数量有限还是怎么,下载只有 HTTP 1.x 的一半。速度倒是差不多有后者的两倍。
 
推荐配置
- 对于大带宽、延迟一般的机器还是使用传统的 WSS(HTTP1.x+TLS+WS+AUTO+WEB)
 - 对于带宽有限、延迟较低的机器,推荐使用 H2(HTTP/2+TLS+H2C+AES-128-GCM+WEB)
 
其他
- 完整测速结果:https://docs.google.com/spreadsheets/d/1VFJYjQUpd0rIOSmXn8ecEiKWwzEZui5Mo7COdqhKiq8/edit?usp=sharing
 - 配置文件:https://github.com/IITII/v2ray_banchmark
 
