From 0ad384e9082da1090e814cac22148bc6202853de Mon Sep 17 00:00:00 2001 From: Mauro Morales Date: Sat, 28 Sep 2024 00:43:04 +0200 Subject: [PATCH] Increase UDP buffer sizes (#1024) * Increase UDP buffer sizes The new size is 7.5M as recommended by quic-go [1] [1]: https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes/a3327deff89d2428d48596ce0e643531f9944f99 Signed-off-by: Mauro Morales * Bump version Signed-off-by: Mauro Morales * Add source of the rmem_max * Bump version --------- Signed-off-by: Mauro Morales --- packages/static/kairos-overlay-files/collection.yaml | 2 +- .../files/etc/systemd/system/kairos-recovery.service | 6 ++++-- .../files/system/oem/09_systemd_services.yaml | 4 +++- packages/utils/edgevpn-systemd/definition.yaml | 2 +- packages/utils/edgevpn-systemd/edgevpn.service | 5 ++++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/static/kairos-overlay-files/collection.yaml b/packages/static/kairos-overlay-files/collection.yaml index 77fa6fe33..39579863d 100644 --- a/packages/static/kairos-overlay-files/collection.yaml +++ b/packages/static/kairos-overlay-files/collection.yaml @@ -1,4 +1,4 @@ packages: - name: "kairos-overlay-files" category: "static" - version: "1.1.52" + version: "1.1.53" diff --git a/packages/static/kairos-overlay-files/files/etc/systemd/system/kairos-recovery.service b/packages/static/kairos-overlay-files/files/etc/systemd/system/kairos-recovery.service index 7ba639175..135ea8fb7 100644 --- a/packages/static/kairos-overlay-files/files/etc/systemd/system/kairos-recovery.service +++ b/packages/static/kairos-overlay-files/files/etc/systemd/system/kairos-recovery.service @@ -7,7 +7,9 @@ StandardInput=tty StandardOutput=tty LimitNOFILE=49152 ExecStartPre=-/bin/sh -c "dmesg -D" -ExecStartPre=-/bin/sh -c "sysctl -w net.core.rmem_max=2500000" +# This source explains why we are using this number +# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes/a3327deff89d2428d48596ce0e643531f9944f99 +ExecStartPre=-/bin/sh -c "sysctl -w net.core.rmem_max=7500000" # Stop systemd messages on tty ExecStartPre=-/usr/bin/kill -SIGRTMIN+21 1 TTYPath=/dev/tty1 @@ -16,4 +18,4 @@ ExecStart=/usr/bin/kairos-agent recovery # Start systemd messages on tty ExecStartPost=-/usr/bin/kill -SIGRTMIN+20 1 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/packages/static/kairos-overlay-files/files/system/oem/09_systemd_services.yaml b/packages/static/kairos-overlay-files/files/system/oem/09_systemd_services.yaml index 2cffa98c7..9591039ae 100644 --- a/packages/static/kairos-overlay-files/files/system/oem/09_systemd_services.yaml +++ b/packages/static/kairos-overlay-files/files/system/oem/09_systemd_services.yaml @@ -7,7 +7,9 @@ stages: boot: - name: "Default sysctl settings" sysctl: - net.core.rmem_max: 2500000 + # This source explains why we are using this number + # https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes/a3327deff89d2428d48596ce0e643531f9944f99 + net.core.rmem_max: 7500000 vm.max_map_count: 262144 fs.inotify.max_user_instances: 8192 fs.inotify.max_user_watches: 524288 diff --git a/packages/utils/edgevpn-systemd/definition.yaml b/packages/utils/edgevpn-systemd/definition.yaml index f67cb27f9..00b633288 100644 --- a/packages/utils/edgevpn-systemd/definition.yaml +++ b/packages/utils/edgevpn-systemd/definition.yaml @@ -1,6 +1,6 @@ name: edgevpn category: systemd-service -version: "20211216" +version: "20240830" requires: - name: edgevpn category: utils diff --git a/packages/utils/edgevpn-systemd/edgevpn.service b/packages/utils/edgevpn-systemd/edgevpn.service index 426e323f7..55ddf3567 100644 --- a/packages/utils/edgevpn-systemd/edgevpn.service +++ b/packages/utils/edgevpn-systemd/edgevpn.service @@ -5,7 +5,10 @@ After=network.target [Service] EnvironmentFile=/etc/systemd/system.conf.d/edgevpn.env LimitNOFILE=49152 -ExecStartPre=-/bin/sh -c "sysctl -w net.core.rmem_max=2500000" +# This source explains why we are using this number +# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes/a3327deff89d2428d48596ce0e643531f9944f99 +ExecStartPre=-/bin/sh -c "sysctl -w net.core.rmem_max=7500000" +ExecStartPre=-/bin/sh -c "sysctl -w net.core.wmem_max=7500000" ExecStart=/usr/bin/edgevpn Restart=always