summaryrefslogtreecommitdiff
path: root/man4/opentracker.conf.4
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-31 15:59:41 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-31 15:59:41 +0100
commit4d030871c004c917458b5e1c296edcfc689a2e66 (patch)
treec6c057e47a17d8b03ea28a611ff029d950acfa8c /man4/opentracker.conf.4
parent440cfeee71829308fa1cc9b5aef63beb7ab756dc (diff)
Make tcp worker multithreaded, too
This shamelessly steals the model established in the UDP workers, i.e. if the kernel is able to bind multiple listening sockets to the same endpoint, we will share them across threads. If it can't, all threads will accept on the same socket. The fast path handles most of the connections, only the rare case of no data yet on the socket is offloaded to the slow path (which used to be the mainloop) for completion. This scales nicely, as the higher the load is, the higher chances are that an accept happens only after the network roundtrip to the peer completes, leading to more connections that already have data waiting for us. We also consolidate the workstruct init and deinit code, preparation for later unifying all thread state structs for all protocols (mca, udc and tcp). The config file gains a per tcp connection worker count and some docs explaining what this knob buys and costs, nudging the user to either keep it 0 or dial it up to at least 2.
Diffstat (limited to 'man4/opentracker.conf.4')
-rw-r--r--man4/opentracker.conf.416
1 files changed, 16 insertions, 0 deletions
diff --git a/man4/opentracker.conf.4 b/man4/opentracker.conf.4
index aa82e1d..1bd1c7a 100644
--- a/man4/opentracker.conf.4
+++ b/man4/opentracker.conf.4
@@ -42,6 +42,14 @@ in the thread that also serves TCP. See
42.Sx TUNING 42.Sx TUNING
43before raising it. 43before raising it.
44.Pp 44.Pp
45.It listen.tcp.workers Ar threads
46Specifies how many threads accept and answer HTTP connections, for every
47listen statement that does not carry a
48.Cm workers
49option of its own. Defaults to 0, which serves them from the event loop. See
50.Sx TUNING
51before raising it.
52.Pp
45.It listen.shared Ar boolean 53.It listen.shared Ar boolean
46Permits another process to bind the same address, for every listen statement 54Permits another process to bind the same address, for every listen statement
47that does not carry a 55that does not carry a
@@ -101,6 +109,14 @@ group only where the answer is yes.
101in the source distribution sweeps the setting against a running tracker. 109in the source distribution sweeps the setting against a running tracker.
102Measure on the machine that will carry the traffic. 110Measure on the machine that will carry the traffic.
103.Pp 111.Pp
112A TCP worker accepts a connection and answers it on its own stack, without
113the event loop seeing it at all; only a connection it cannot finish is handed
114over. One worker serves less than none, because accepting leaves the event
115loop's thread without anything gained in return, so the setting is worth
116either 0 or at least 2.
117.Pa tests/http_load.c
118in the source distribution drives the tracker over HTTP to measure it.
119.Pp
104On FreeBSD the 120On FreeBSD the
105.Xr accf_data 9 121.Xr accf_data 9
106filter has the kernel hold a new connection until data arrives on it, so the 122filter has the kernel hold a new connection until data arrives on it, so the