From dd0ad26ea9824b75accced2b56328cbb222c4c6d Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Wed, 28 Oct 2026 19:40:34 +0100 Subject: Default udp workers to 1, as it is the most sane choice everywhere, also reflect the new udp parallelism in the man pages --- man4/opentracker.conf.4 | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'man4/opentracker.conf.4') diff --git a/man4/opentracker.conf.4 b/man4/opentracker.conf.4 index 2bc1389..b28879f 100644 --- a/man4/opentracker.conf.4 +++ b/man4/opentracker.conf.4 @@ -1,5 +1,5 @@ -.Dd 2024-04-18 -.Dt opentracker.conf 5 +.Dd 2026-10-28 +.Dt opentracker.conf 4 .Os Unix .Sh NAME .Nm opentracker.conf @@ -25,8 +25,29 @@ Specifies the address opentracker will listen on for TCP connections. Can be add .It listen.udp Ar address Specifies the address opentracker will listen on for UDP connections. Can be added more than once. .Pp +A listen statement may carry options after the address, as in +.Dl listen.udp 10.0.0.5:6969 workers=4 shared +where +.Cm workers Ns = Ns Ar count +sets the worker count for that socket alone and is ignored for TCP, and +.Cm shared +permits another process to bind the same address. +.Pp .It listen.udp.workers Ar threads -Specifies how many threads will be spawned to handle UDP connections. Defaults to 4. +Specifies how many threads will be spawned to handle UDP requests, for every +listen statement that does not carry a +.Cm workers +option of its own. Defaults to 1. A count of 0 serves UDP from the event loop, +in the thread that also serves TCP. See +.Sx TUNING +before raising it. +.Pp +.It listen.shared Ar boolean +Permits another process to bind the same address, for every listen statement +that does not carry a +.Cm shared +option of its own. Defaults to 0, and is useful only where a second tracker is +deliberately run on the same address. .Pp .It access.whitelist Ar path/to/whitelist Specifies the path to the whitelist file containing all torrent hashes that opentracker will serve. Use this option if opentracker runs in a non-open mode. @@ -67,6 +88,18 @@ Specifies the user opentracker will setuid to after binding to potentially privi .It tracker.redirect_url Ar URL Specifies the URL opentracker will redirect to in response to a "GET / HTTP" request. .El +.Sh TUNING +A worker is a thread that blocks in a read until a datagram arrives. Where the +kernel spreads arriving datagrams over a group of sockets bound to one address, +opentracker binds one socket per worker and throughput rises with the worker +count. Linux does so, and FreeBSD since 12.0. Where a kernel does not, every +worker reads the same socket and they contend for its receive queue, so more +than one worker costs throughput. opentracker asks at start up and binds a +group only where the answer is yes. +.Pp +.Pa tests/udp_scaling.py +in the source distribution sweeps the setting against a running tracker. +Measure on the machine that will carry the traffic. .Sh EXAMPLES To specify the address opentracker will listen on for both TCP and UDP connections: .Dl listen.tcp_udp 0.0.0.0:6969 -- cgit v1.3