Use kcptun to speed up shadowsocks
I bought HostUS’s $16 annual OpenVZ architecture VPS. I chose LA and connected directly to the US via Shanghai. There is nothing to blame on the line. The delay is about 200ms, which is also within the acceptable range. However, the speed is only 100+Kb/S, and it is better to make a refund or change the machine room.
Effect
After the acceleration, YouTuBe peaks at 1.7Mb/s, which almost reaches the upper limit of the dormitory bandwidth, occasionally 700Kb/s, and daily about 1.5Mb/s.
Process
Not using net-speeder, multiple times the package is too violent. It is not using finalspeed, because it is said that hostus will be sealed. Sharp speed also suspended registration. So I used kcptun.
Kcptun is a high-speed remote port forwarding made by KCP protocol, which wastes part of the bandwidth, in exchange for lower latency and higher speed. The working flow chart is as follows:
The method of use is simple:
The client and server respectively download the binary compression package of the corresponding platform and decompress it. Start the port forwarding with the following command.
Server: ./server_linux_amd64 -t “服务器IP地址:8388” -l “:4000” -mode fast2
Client: ./client_linux_amd64 -r “服务器IP地址:4000” -l “:8388” -mode fast2
The above command can achieve forwarding of the 8388/tcp port (through the 4000/udp port).
It should be noted that although aes encryption is enabled by default, the encryption method can also be modified by adjusting the parameters, but the protocol layer is not responsible for security, so Shadowsocks can not be omitted, the server-side kcptun listens to the ss port, and the client ss listens to this. Machine kcptun port, you can use.
Kcptun has a lot of adjustable parameters, and you can adjust it slowly if you are interested.
—————————update—————————-
Client command change to
./client_linux_amd64 -r “127.0.0.1:4000” -l “:4000” -sndwnd 25 -rcvwnd 204 -mode fast2
YouTuBe video loading speed has increased to 2.2Mb/s. The reference mode refers to the bandwidth. The client side 100M bandwidth corresponds to -sndwnd 256 -rcvwnd 2048, and the dormitory 10M bandwidth, so it is adjusted to one tenth.
—————————update—————————-
Kcptun does not support multiple users, only multiple processes can be used to allow multiple terminals to use at the same time.
The stability of Kcptun on Windows is also ok, just have to write batch processing to start up, slightly more troublesome than *nix.