fix(cloudflared): udp buffer sizes

This commit is contained in:
arcnmx 2024-03-01 15:26:15 -08:00
parent 2810d4d54c
commit 565e518427
2 changed files with 13 additions and 2 deletions

View file

@ -3,7 +3,15 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkDefault; inherit (lib.modules) mkIf mkDefault;
cfg = config.services.cloudflared;
in { in {
config.services.cloudflared.enable = mkDefault true; config = {
services.cloudflared.enable = mkDefault true;
boot.kernel.sysctl = mkIf (!config.boot.isContainer && cfg.enable) {
# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes
"net.core.rmem_max" = mkDefault 2500000;
"net.core.wmem_max" = mkDefault 2500000;
};
};
} }

View file

@ -2,3 +2,6 @@ net.ipv6.conf.vmbr0.disable_ipv6=0
net.ipv6.conf.vmbr0.use_tempaddr=1 net.ipv6.conf.vmbr0.use_tempaddr=1
net.ipv6.conf.vmbr0.accept_ra_rt_info_max_plen=128 net.ipv6.conf.vmbr0.accept_ra_rt_info_max_plen=128
net.ipv4.ping_group_range=0 2147483647 net.ipv4.ping_group_range=0 2147483647
# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes
net.core.rmem_max=2500000
net.core.wmem_max=2500000