Connection to linode hosts from within China can be poor from time to time. Choosing a suitable TCP congestion algorithm may alleviate that from insignificant to a great deal, your mileage may vary. Trying it out is always the best way to find out. Here I will show you how to do that step by step.
-
Login to your VPS and find out the version of the running kernel
[code gutter=”false”]
# uname -a
Linux jhelom 3.12.6-x86_64-linode36 #2 SMP Mon Jan 13 18:54:10 EST 2014 x86_64 GNU/Linux
[/code]
That is 3.12.6. - Go get the 3.12.6 from kernel.org at https://www.kernel.org/pub/linux/kernel/v3.x/
-
Extract it and copy the kernel config over from the current one.
[code gutter=”false”]
# tar xf linux-3.12.6.tar.xz
# zcat /proc/config.gz > .config
# make oldconfig
[/code] -
Now, edit
.configwith an editor such as vi, look for the lineCONFIG_TCP_CONG_ADVANCED, remove the line, and add the following lines there:
[code gutter=”false”]
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_WESTWOOD=m
CONFIG_TCP_CONG_HTCP=m
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
[/code] -
Now compile the kernel and the modules.
[code gutter=”false”]
# make -j4
# make modules SUBDIRS=net/ipv4
[/code] -
If everything goes well, you will be able to load the module.
[code gutter=”false”]
# sudo insmod net/ipv4/tcp_hybla.ko
[/code]Check with
lsmodand make sure the kernel module is loaded successfully. If not, checkdmesgfor any errors.
That’s it!