From 9ab70ffecbd782b3e01ee35c44e9c6133e1655f9 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 22 Aug 2024 19:09:54 +0200 Subject: [PATCH] docs: add documentation to enabling BBR (#3812) Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Co-authored-by: Rootul P Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Makefile | 15 +++++++++++++++ README.md | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Makefile b/Makefile index 2f478724e5..d6e8bc2654 100644 --- a/Makefile +++ b/Makefile @@ -207,3 +207,18 @@ prebuilt-binary: ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ release --clean .PHONY: prebuilt-binary + +## enable-bbr: Enable BBR congestion control algorithm. Only works on Linux. +enable-bbr: + @echo "Configuring system to use BBR..." + @if [ "$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}')" != "bbr" ]; then \ + echo "BBR is not enabled. Configuring BBR..."; \ + sudo modprobe tcp_bbr; \ + echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf; \ + echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf; \ + sudo sysctl -p; \ + echo "BBR has been enabled."; \ + else \ + echo "BBR is already enabled."; \ + fi +.PHONY: enable-bbr diff --git a/README.md b/README.md index 2a648d6e7d..2cd72a9535 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,22 @@ See for more information. ## Usage +First, make sure that the [BBR](https://www.ietf.org/archive/id/draft-cardwell-iccrg-bbr-congestion-control-01.html) ("Bottleneck Bandwidth and Round-trip propagation time") congestion control algorithm is enabled in the +system's kernel. The result should contain `bbr`: + +```sh +sysctl net.ipv4.tcp_congestion_control +``` + +If not, enable it on Linux by calling the `make use-bbr` or by running: + +```sh +sudo modprobe tcp_bbr +net.core.default_qdisc=fq +net.ipv4.tcp_congestion_control=bbr +sudo sysctl -p +``` + ```sh # Print help celestia-appd --help