When you get a new dedicated server or virtual server (VPS), the first thing to do is to optimize the server's network, especially the speed from overseas servers to China, which will greatly improve.
I will integrate all the things I need to do into a script, which can be executed using the following command.
wget https://gist.githubusercontent.com/taurusxin/a9fc3ad039c44ab66fca0320045719b0/raw/3906efed227ee14fc5b4ac8eb4eea8855021ef19/optimize.sh && sudo bash optimize.sh
Specifically, the following points will be addressed:
- Update software sources and packages.
- Install haveged to optimize the Linux random number generator, which can solve the problem of low system entropy in some cases.
- Most importantly, optimize kernel network parameters, specifically adjusting some IPv4 TCP parameters, and enabling the original Linux BBR congestion control algorithm developed by Google, which can significantly improve network speed.