Increase statsd UDP buffer size to localhost MTU (#21822)
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
kiwixz committed
Feb 26, 2026 at 20:21 UTC
f0aec326b841457cb08293549f9f8ae0483e15a3
2 files changed
+2
-2
src/collectors/statsd.plugin/README.md
+1
-1
@@ -250,7 +250,7 @@ When sending multiple metrics in a UDP message, keep the total size under the ne
250
251
:::important
252
253
-Netdata will accept UDP packets up to 9000 bytes, but your network equipment may fragment any packets exceeding the MTU.
253
+Netdata can accept UDP datagrams up to the maximum UDP payload size (65,507 bytes for IPv4), but packets larger than the network MTU will be fragmented at the IP layer (or dropped if fragmentation is not allowed).
254
255
:::
256
src/collectors/statsd.plugin/statsd.c
+1
-1
@@ -841,7 +841,7 @@ static inline size_t statsd_process(char *buffer, size_t size, int require_newli
841
// statsd pollfd interface
842
843
#define STATSD_TCP_BUFFER_SIZE 65536 // minimize tcp reads
844
-#define STATSD_UDP_BUFFER_SIZE 9000 // this should be up to MTU
844
+#define STATSD_UDP_BUFFER_SIZE 65536 // 65535 max IPv4 packet + 1 for null terminator
845
846
typedef enum {
847
STATSD_SOCKET_DATA_TYPE_TCP,