From: Charles-Henri Bruyand Date: Fri, 22 Sep 2023 12:23:48 +0000 (+0200) Subject: doq: really configure idleTimeout X-Git-Tag: rec-5.0.0-alpha2~6^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0f66c590013840dc95b83a7e8d240c0dcf6ac85;p=thirdparty%2Fpdns.git doq: really configure idleTimeout --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index e04f3ca20d..eccb9a9363 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2512,6 +2512,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections); getOptionalValue(vars, "internalPipeBufferSize", frontend->d_internalPipeBufferSize); + getOptionalValue(vars, "idleTimeout", frontend->d_idleTimeout); parseTLSConfig(frontend->d_tlsConfig, "addDOQLocal", vars); diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index fbb8e73f77..c0a3287f41 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -188,7 +188,7 @@ Listen Sockets * ``reusePort=false``: bool - Set the ``SO_REUSEPORT`` socket option. * ``interface=""``: str - Set the network interface to use. * ``cpus={}``: table - Set the CPU affinity for this listener thread, asking the scheduler to run it on a single CPU id, or a set of CPU ids. This parameter is only available if the OS provides the pthread_setaffinity_np() function. - * ``idleTimeout=30``: int - Set the idle timeout, in seconds. + * ``idleTimeout=5``: int - Set the idle timeout, in seconds. * ``internalPipeBufferSize=0``: int - Set the size in bytes of the internal buffer of the pipes used internally to pass queries and responses between threads. Requires support for ``F_SETPIPE_SZ`` which is present in Linux since 2.6.35. The actual size might be rounded up to a multiple of a page size. 0 means that the OS default size is used. The default value is 0, except on Linux where it is 1048576 since 1.6.0. .. function:: addTLSLocal(address, certFile(s), keyFile(s) [, options]) diff --git a/pdns/dnsdistdist/doq.cc b/pdns/dnsdistdist/doq.cc index a1ce4c6478..6f6d0496ee 100644 --- a/pdns/dnsdistdist/doq.cc +++ b/pdns/dnsdistdist/doq.cc @@ -287,7 +287,7 @@ void DOQFrontend::setup() } } - quiche_config_set_max_idle_timeout(config.get(), 5000); + quiche_config_set_max_idle_timeout(config.get(), d_idleTimeout * 1000); quiche_config_set_max_recv_udp_payload_size(config.get(), MAX_DATAGRAM_SIZE); quiche_config_set_max_send_udp_payload_size(config.get(), MAX_DATAGRAM_SIZE); quiche_config_set_initial_max_data(config.get(), 10000000); diff --git a/pdns/dnsdistdist/doq.hh b/pdns/dnsdistdist/doq.hh index c2ebb685e3..9cd69fe928 100644 --- a/pdns/dnsdistdist/doq.hh +++ b/pdns/dnsdistdist/doq.hh @@ -52,6 +52,7 @@ struct DOQFrontend #else uint32_t d_internalPipeBufferSize{0}; #endif + uint64_t d_idleTimeout{5}; }; struct DOQUnit