+26 April 2023: Wouter
+ - Merge #882 from vvfedorenko: Features/dropqueuedpackets, with
+ sock-queue-timeout option that drops packets that have been in the
+ socket queue for too long. Added statistics num.queries_timed_out
+ and query.queue_time_us.max that track the socket queue timeouts.
+ - Fix for #882: small changes, date updated in Copyright for
+ util/timeval_func.c and util/timeval_func.h. Man page entries and
+ example entry.
+
19 April 2023: Wouter
- Fix for #878: Invalid IP address in unbound.conf causes Segmentation
Fault on OpenBSD.
# Timeout for EDNS TCP keepalive, in msec.
# edns-tcp-keepalive-timeout: 120000
+ # UDP queries that have waited in the socket buffer for a long time
+ # can be dropped. Default is 0, disabled. In seconds, such as 3.
+ # sock-queue-timeout: 0
+
# Use systemd socket activation for UDP, TCP, and control sockets.
# use-systemd: no
.I threadX.num.expired
number of replies that served an expired cache entry.
.TP
+.I threadX.num.queries_timed_out
+number of queries that are dropped because they waited in the UDP socket buffer
+for too long.
+.TP
+.I threadX.query.queue_time_us.max
+The maximum wait time for packets in the socket buffer, in microseconds. This
+is only reported when sock-queue-timeout is enabled.
+.TP
.I threadX.num.recursivereplies
The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.
.TP
.I total.num.expired
summed over threads.
.TP
+.I total.num.queries_timed_out
+summed over threads.
+.TP
+.I total.query.queue_time_us.max
+the maximum of the thread values.
+.TP
.I total.num.recursivereplies
summed over threads.
.TP
A minimum actual timeout of 200 milliseconds is observed regardless of the
advertised timeout.
.TP
+.B sock\-queue\-timeout: \fI<sec>\fR
+UDP queries that have waited in the socket buffer for a long time can be
+dropped. Default is 0, disabled. The time is set in seconds, 3 could be a
+good value to ignore old queries that likely the client does not need a reply
+for any more. This could happen if the host has not been able to service
+the queries for a while, i.e. Unbound is not running, and then is enabled
+again. It uses timestamp socket options.
+.TP
.B tcp\-upstream: \fI<yes or no>
Enable or disable whether the upstream queries use TCP only for transport.
Default is no. Useful in tunneling scenarios. If set to no you can specify
/*
* util/timeval_func.c - helpers to work with struct timeval values.
*
- * Copyright (c) 2007, NLnet Labs. All rights reserved.
+ * Copyright (c) 2023, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* This file contains helpers to manipulate struct timeval values.
*/
+#include "config.h"
#include "timeval_func.h"
/** subtract timers and the values do not overflow or become negative */
/*
- * util/timeval)func.h - definitions of helpers for strcut timeval values.
+ * util/timeval_func.h - definitions of helpers for struct timeval values.
*
- * Copyright (c) 2007, NLnet Labs. All rights reserved.
+ * Copyright (c) 2023, NLnet Labs. All rights reserved.
*
* This software is open source.
*