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