From 1ef7b4a24619f63d551a632673d52dd894e3b85a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 13 May 2025 15:31:05 +0200 Subject: [PATCH] - Adjusted so-sndbuf default to 4m. --- doc/Changelog | 1 + doc/example.conf.in | 4 ++-- doc/unbound.conf.5.in | 4 ++-- util/config_file.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index b7bcabb6d..dac34fd69 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ - Change default for so-sndbuf to 1m, to mitigate a cross-layer issue where the UDP socket send buffers are exhausted waiting for ARP/NDP resolution. Thanks to Reflyable for the report. + - Adjusted so-sndbuf default to 4m. 12 May 2025: Yorgos - Merge #1280: Fix auth nsec3 code. Fixes NSEC3 code to not break on diff --git a/doc/example.conf.in b/doc/example.conf.in index c2bc6e9d8..a85b58de4 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -116,8 +116,8 @@ server: # so-rcvbuf: 0 # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option). - # 0 is system default. Use 4m to handle spikes on very busy servers. - # so-sndbuf: 1m + # 0 is system default. Set larger to handle spikes on very busy servers. + # so-sndbuf: 4m # use SO_REUSEPORT to distribute queries over threads. # at extreme load it could be better to turn it off to distribute even. diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in index 3407b3414..c469c3c66 100644 --- a/doc/unbound.conf.5.in +++ b/doc/unbound.conf.5.in @@ -355,8 +355,8 @@ If not 0, then set the SO_SNDBUF socket option to get more buffer space on UDP port 53 outgoing queries. This for very busy servers handles spikes in answer traffic, otherwise 'send: resource temporarily unavailable' can get logged, the buffer overrun is also visible by netstat \-su. -Default is 1M. If set to 0 it uses the system value. Specify the number -of bytes to ask for, try "4m" on a very busy server. It needs some space +Default is 4m. If set to 0 it uses the system value. Specify the number +of bytes to ask for, try "8m" on a very busy server. It needs some space to be able to deal with packets that wait for local address resolution, from like ARP and NDP discovery, before they are sent out, hence it is elevated above the system default by default. The OS caps it at diff --git a/util/config_file.c b/util/config_file.c index 328b62df8..b1e767b3b 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -210,7 +210,7 @@ config_create(void) cfg->if_automatic = 0; cfg->if_automatic_ports = NULL; cfg->so_rcvbuf = 0; - cfg->so_sndbuf = 1024*1024; + cfg->so_sndbuf = 4*1024*1024; cfg->so_reuseport = REUSEPORT_DEFAULT; cfg->ip_transparent = 0; cfg->ip_freebind = 0; -- 2.47.2