Increase Linux Internet speed with TCP BBR congestion control | ||
---|---|---|
Paul Morefield Offline Topics: 1 Replies: 3 Joined: 04/06/2020 |
Requirements for Linux server Internet speed with TCP BBRMake sure that your Linux kernel has the following option compiled as either module or inbuilt into the Linux kernel:
Linux TCP BBR congestion controlYou must use the Linux kernel version 4.9 or above. On a Debian/Ubuntu Linux type the following grep command/egrep command: Fig.01: Make sure that your Linux kernel has TCP BBR option setup I am using Linux kernel version 4.9.0-8-amd64 on a Debian and 4.18.0-15-generic on an Ubuntu server. If above options not found, you need to either compile latest kernel or install the latest version of Linux kernel using the apt-get command/apt command. Run test before you enable TCP BBR to improve network speedType the following command on Linux server: How to enable TCP BBR congestion control on LinuxEdit the /etc/sysctl.conf file or create a new file in /etc/sysctl.d/ directory: * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-custom.conf ... net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-link-restrictions.conf ... fs.protected_hardlinks = 1 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/10-lxd-inotify.conf ... fs.inotify.max_user_instances = 1024 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.tcp_syncookies = 1 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... You can verify new settings with the following sysctl command. Run: Test BBR congestion control on LinuxIn my testing between two long distance Linux server with Gigabit ports connected to the Internet, I was able to bump 250 Mbit/s into 800 Mbit/s. You can use tools such as the wget command to measure bandwidths speed: Linux TCP BBR test with iperfThe iperf is a commonly used network testing tool for TCP/UDP data streams. It measures the throughput of the network. This tool can validate the importance of Linux TCP BBR settings. Type command on Linux server with TCP BBR congestion control enables
Type command on Linux/Unix client
------------------------------------------------------------ Client connecting to gcp-vm-nginx-www1, TCP port 5001 TCP window size: 45.0 KByte (default) ------------------------------------------------------------ [ 3] local 10.8.0.2 port 46978 connected with xx.yyy.zzz.tt port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0- 2.0 sec 4.00 MBytes 16.8 Mbits/sec [ 3] 2.0- 4.0 sec 8.50 MBytes 35.7 Mbits/sec [ 3] 4.0- 6.0 sec 10.9 MBytes 45.6 Mbits/sec [ 3] 6.0- 8.0 sec 16.2 MBytes 68.2 Mbits/sec [ 3] 8.0-10.0 sec 5.29 MBytes 22.2 Mbits/sec [ 3] 10.0-12.0 sec 9.38 MBytes 39.3 Mbits/sec [ 3] 12.0-14.0 sec 8.12 MBytes 34.1 Mbits/sec [ 3] 14.0-16.0 sec 8.12 MBytes 34.1 Mbits/sec [ 3] 16.0-18.0 sec 8.38 MBytes 35.1 Mbits/sec [ 3] 18.0-20.0 sec 6.75 MBytes 28.3 Mbits/sec [ 3] 20.0-22.0 sec 8.12 MBytes 34.1 Mbits/sec [ 3] 22.0-24.0 sec 8.12 MBytes 34.1 Mbits/sec [ 3] 24.0-26.0 sec 9.50 MBytes 39.8 Mbits/sec [ 3] 26.0-28.0 sec 7.00 MBytes 29.4 Mbits/sec [ 3] 28.0-30.0 sec 8.12 MBytes 34.1 Mbits/sec [ 3] 0.0-30.3 sec 127 MBytes 35.0 Mbits/sec ConclusionBottleneck Bandwidth and RTT (BBR) congestion control pre and post average stats collected for 30 seconds using the iperf command:
BBR is, in my opinion, one of the most critical improvements to Linux networking stacks in recent years. This page demonstrated how to enable and set up BBR on Linux based system. For more information see the following pages:
|
|
05/06/2020 01:13:34 |
||
Carol Frye Offline Topics: 1 Replies: 2 Joined: 04/06/2020 |
life is better
|
|
05/06/2020 01:15:22 |
||
Kevin Young Offline Topics: 4 Replies: 30 Moderator |
Thank you for sharing, we've doubled your RAM for free. |
|
05/06/2020 03:07:09 |
||
Paul Morefield Offline Topics: 1 Replies: 3 Joined: 04/06/2020 |
Thanks! |
|
06/06/2020 11:09:30 |