ServerUpdate

服務器更新

今天把Debian滾到 9.5 內核升到 4.9, 因為Linux 4.9內核內建了tcp_bbr 算法。

這算法對高延遲,高掉包的網絡有較大的提升

不過香港的掉包和延遲不算嚴重,更新後提升不大

配置kernal 參數

1
2
3
4
$ vim /etc/sysctl.conf
# 增加以下兩條配置
# net.core.default_qdisc=fq
# net.ipv4.tcp_congestion_control=bbr

刷新內核配置

1
$ sysctl -p

重啟和測試配置

1
2
3
4
$ reboot
$ sysctl net.ipv4.tcp_available_congestion_control
# 顯示結果中有bbr
# net.ipv4.tcp_available_congestion_control = bbr cubic reno

測試用指令 wget -qO- bench.sh | bash

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
----------------------------------------------------------------------
CPU model : AMD Phenom(tm) II X6 1055T Processor
Number of cores : 6
CPU frequency : 2812.247 MHz
Total size of Disk : 95.0 GB (38.0 GB Used)
Total amount of Mem : 491 MB (84 MB Used)
Total amount of Swap : 4090 MB (0 MB Used)
System uptime : 0 days, 0 hour 5 min
Load average : 0.06, 0.08, 0.04
OS : Debian GNU/Linux 9
Arch : x86_64 (64 Bit)
Kernel : 4.9.0-6-amd64
----------------------------------------------------------------------
I/O speed(1st run) : 93.1 MB/s
I/O speed(2nd run) : 93.5 MB/s
I/O speed(3rd run) : 97.0 MB/s
Average I/O speed : 94.5 MB/s
----------------------------------------------------------------------
Node Name IPv4 address Download Speed
CacheFly 204.93.150.152 5.14MB/s
Linode, Tokyo, JP 106.187.96.148 1.12MB/s
Linode, Singapore, SG 139.162.23.4 1.29MB/s
Linode, London, UK 176.58.107.39 578KB/s
Linode, Frankfurt, DE 139.162.130.8 546KB/s
Linode, Fremont, CA 50.116.14.9 634KB/s
Softlayer, Dallas, TX 173.192.68.18 1.70MB/s
Softlayer, Seattle, WA 67.228.112.250 2.06MB/s
Softlayer, Frankfurt, DE 159.122.69.4 237KB/s
Softlayer, Singapore, SG 119.81.28.170 1.45MB/s
Softlayer, HongKong, CN 119.81.130.170 8.97MB/s
----------------------------------------------------------------------
SpeedTest
Hosted by STC (Hong Kong) : 5.976 ms
Testing download
Download: 289.92 Mbit/s
Testing upload
Upload: 52.48 Mbit/s