diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 15:59:41 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 15:59:41 +0100 |
| commit | 4d030871c004c917458b5e1c296edcfc689a2e66 (patch) | |
| tree | c6c057e47a17d8b03ea28a611ff029d950acfa8c /opentracker.conf.sample | |
| parent | 440cfeee71829308fa1cc9b5aef63beb7ab756dc (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 'opentracker.conf.sample')
| -rw-r--r-- | opentracker.conf.sample | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/opentracker.conf.sample b/opentracker.conf.sample index 1d535e8..f075703 100644 --- a/opentracker.conf.sample +++ b/opentracker.conf.sample | |||
| @@ -21,9 +21,9 @@ | |||
| 21 | # | 21 | # |
| 22 | # A listen statement takes options after the address: | 22 | # A listen statement takes options after the address: |
| 23 | # | 23 | # |
| 24 | # workers=<count> handle this udp socket in blocking reads in that | 24 | # workers=<count> handle this socket in that many dedicated worker |
| 25 | # many dedicated worker threads instead of in the | 25 | # threads instead of in the event loop. Defaults to 1 |
| 26 | # event loop. Defaults to 1. Ignored for tcp. | 26 | # for udp and 0 for tcp. |
| 27 | # shared allow another process to bind the same address and | 27 | # shared allow another process to bind the same address and |
| 28 | # let the kernel share the traffic. Only useful if you | 28 | # let the kernel share the traffic. Only useful if you |
| 29 | # deliberately run a second tracker there. | 29 | # deliberately run a second tracker there. |
| @@ -35,6 +35,7 @@ | |||
| 35 | # anywhere. | 35 | # anywhere. |
| 36 | # | 36 | # |
| 37 | # listen.udp.workers 4 | 37 | # listen.udp.workers 4 |
| 38 | # listen.tcp.workers 4 | ||
| 38 | # listen.shared 1 | 39 | # listen.shared 1 |
| 39 | # | 40 | # |
| 40 | # Raising the worker count pays off where the kernel spreads arriving | 41 | # Raising the worker count pays off where the kernel spreads arriving |
