The TCP BBR algorithm can improve transmission speed and reduce network latency on networks with a certain packet loss rate. Website owners can try enabling it on their VPS.
Here’s how to manually enable the TCP BBR algorithm in a VPS:
Since the Linux kernel version 4.9, the BBR algorithm has been included, so most Linux systems can directly enable this algorithm.
BBR algorithm was originally proposed by Google and was primarily used to improve network speed within Google’s internal network.
Now Google has submitted it to the Linux kernel, making it available to everyone.
According to Google’s reports, this new algorithm can significantly reduce network latency.
After using this algorithm, the global latency of YouTube has decreased by more than 50% compared to the previous CUBIC algorithm.
Now let’s manually enable this algorithm. If your VPS is based on the KVM architecture, updating the kernel to version 4.9 or above will enable this feature.
1.Execute the echo command to add two configuration lines at the end of the /etc/sysctl.conf file:
The first line, default_qdisc, specifies the default TCP queuing algorithm, fq, which is the recommended algorithm by Google and more suitable for BBR.
The second line enables the congestion control algorithm in the IPv4 protocol.
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
2.Run the following command to load the new configuration parameters:
sysctl -p
If you see the following prompt, it means you need to upgrade the Linux kernel:
sysctl: setting key "net.ipv4.tcp_congestion_control": No such file or directory
3.Run the following two commands. If both results include “bbr,” it means your kernel has enabled TCP BBR!
sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control
4.Finally, use the following command to verify that BBR is in effect.
The result will display “tcp_bbr” followed by a series of numbers, indicating that the BBR algorithm is active.
That’s it!Go ahead and give it a try. Remember to back up your data, especially when upgrading the kernel!