nixos: Use BBR for TCP sent from colony and home #2
No files matched your search
@@ -379,6 +379,8 @@ in
|
||||
|
||||
my = {
|
||||
#deploy.generate.system.mode = "boot";
|
||||
network.bbr = true;
|
||||
|
||||
secrets = {
|
||||
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIijqzAWF6OxKr4aeCa1TAc5xGn4rdIjVTt0wAPU6uY";
|
||||
files = {
|
||||
|
||||
@@ -180,6 +180,8 @@ in
|
||||
};
|
||||
|
||||
my = {
|
||||
network.bbr = true;
|
||||
|
||||
secrets = {
|
||||
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+KINpHLMduBuW96JzfSRDLUzkI+XaCBghu5/wHiW5R";
|
||||
files = {
|
||||
|
||||
@@ -36,6 +36,7 @@ in
|
||||
my = {
|
||||
deploy.enable = false;
|
||||
server.enable = true;
|
||||
network.bbr = true;
|
||||
|
||||
secrets = {
|
||||
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAQM9U1e/XcUCyMJITrpAHjAGahpqkZCmtX6pJkYzuks";
|
||||
|
||||
@@ -166,6 +166,7 @@ in
|
||||
my = {
|
||||
secrets.key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6bc1pQCYalLXdB4X+7kFXtkTdFalbH5rchjuYj2ceU";
|
||||
server.enable = true;
|
||||
network.bbr = true;
|
||||
|
||||
firewall = {
|
||||
tcp.allowed = [ 19999 ];
|
||||
|
||||
@@ -162,6 +162,7 @@ in
|
||||
my = {
|
||||
secrets.key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBTIj1jVdknXLNNroMJfgy7S2cSUC/qgFdnaUopEUzZ";
|
||||
server.enable = true;
|
||||
network.bbr = true;
|
||||
|
||||
firewall = {
|
||||
tcp.allowed = [ 19999 ];
|
||||
|
||||
@@ -221,6 +221,7 @@ in
|
||||
|
||||
my = {
|
||||
tmproot.size = "24G";
|
||||
network.bbr = true;
|
||||
|
||||
user = {
|
||||
config.extraGroups = [ "input" ];
|
||||
|
||||
@@ -317,6 +317,7 @@ in
|
||||
as211024 = config.age.secrets."l2mesh/as211024.key".path;
|
||||
};
|
||||
};
|
||||
network.bbr = true;
|
||||
firewall = {
|
||||
trustedInterfaces = [ "lan-hi" "lan-lo" ];
|
||||
udp.allowed = [ 5353 ];
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
inherit (lib) flatten optional mkIf mkDefault mkMerge versionAtLeast;
|
||||
inherit (lib.my) mkBoolOpt';
|
||||
|
||||
cfg = config.my.network;
|
||||
in
|
||||
{
|
||||
options.my.network.bbr = mkBoolOpt' false
|
||||
("Whether to use BBR congestion control for TCP connections this box sends. Unlike the default " +
|
||||
"(CUBIC), BBR doesn't treat packet loss as congestion, so it keeps throughput up on lossy paths. " +
|
||||
"It has no effect on traffic the box forwards.");
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
networking = {
|
||||
@@ -22,6 +30,16 @@ in
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.bbr {
|
||||
# BBR paces its own sending, so the default qdisc (fq_codel) stays as it is. A container's
|
||||
# network namespace copies the host's setting only when it's created, so enable this in
|
||||
# containers too for it to apply without a restart.
|
||||
boot = {
|
||||
kernelModules = [ "tcp_bbr" ];
|
||||
kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf config.my.build.isDevVM {
|
||||
networking.interfaces.eth0.useDHCP = mkDefault true;
|
||||
virtualisation = {
|
||||
|
||||
Reference in new issue
Block a user