基本
bash
# 单/多流 iperf3 对比
iperf3 -c <VPS_IP> -t 60 -P 1
iperf3 -c <VPS_IP> -t 60 -P 8
# 在下载时测延迟抖动
ping -i 0.2 <VPS_IP> > ping.log &
# 查看 TCP 状态(Linux)
ss -tin state established '( sport = :http or dport = :http )'
# 检查网卡瞬时速率(实时)
watch -n 1 "cat /sys/class/net/eth0/statistics/tx_bytes; sleep 1; cat /sys/class/net/eth0/statistics/tx_bytes"
# 若可控,启用 fq_codel(路由器/中间节点)
tc qdisc replace dev eth0 root fq_codel
动态
bash
# 标准显示
watch -n 1 'ss -tin state established'
# 高亮显示
watch -d -n 1 'ss -tin state established'
# 只看TCP UCP
watch -n 1 "ss -tin state established | grep ucp"
# 同时监控且输出到日志
watch -n 1 -p 'ss -tin state established' | tee -a ss_watch.log