tun: default pin_threads off

Thread pinning trades scheduler freedom for TX-ring ordering; that's the
right trade on dedicated forwarders but not as a surprise default on
hosts sharing cores with other workloads. Make it opt-in and document
the default in the example config.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
JackDoan
2026-07-27 15:39:14 -05:00
parent 6c0305c7ae
commit 56d2a3841d
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -264,8 +264,9 @@ tun:
# Linux only. pin_threads pins each tun reader/encrypt OS thread to a single CPU. This keeps every goroutine's
# batched sends flowing through one XPS-selected NIC TX ring, so packets within a flow stay ordered on the wire
# instead of being sprayed across multiple TX rings and reordered. Not reloadable.
#pin_threads: true
# instead of being sprayed across multiple TX rings and reordered. Off by default; pinning takes CPUs away from
# the scheduler, which can hurt hosts that share cores with other workloads. Not reloadable.
#pin_threads: false
# Linux only. cpu_affinity overrides which CPUs the tun reader threads pin to: a list of CPU IDs, one per routine
# (see the top-level `routines` setting). Lists shorter than `routines` are modulo-cycled across the queues; extra