Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 2.2 KB

File metadata and controls

54 lines (34 loc) · 2.2 KB

Optional host tuning (Linux)

dnsplane UDP latency is usually dominated by the resolver process. These kernel/host tweaks can reduce tail latency or loss under burst on small devices (Pi, router, VPS).

Before changing anything

  1. Baseline: dig @<resolver> example.com +stats many times; note p50/p95 Query time.
  2. Check drops: netstat -s | grep -i drop / ss -u -m (UDP memory pressure).
  3. After changes, re-measure the same workload.

CPU frequency (often the biggest win on SBCs)

  • Set governor to performance while benchmarking or if you care about steady low latency:
    • echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  • Revert to ondemand or schedutil for power saving when not needed.

UDP / socket buffers (Linux)

Example non-persistent sysctl (tune to your RAM; values are illustrative):

sudo sysctl -w net.core.rmem_max=8388608
sudo sysctl -w net.core.wmem_max=8388608

Persist in /etc/sysctl.d/99-dnsplane.conf only after validating. Do not set huge buffers on memory-constrained systems.

File descriptors

Under high concurrency, raise limits for the dnsplane service, e.g. in systemd:

LimitNOFILE=65535

Containers

  • hostNetwork: true (or equivalent) avoids extra NAT/bridge latency for DNS UDP.
  • Avoid hard CPU caps that throttle the resolver process.

Go runtime

Usually leave GOMAXPROCS default. Pinning CPUs rarely helps unless you have measured scheduler contention.

Benchmarking dnsplane (after host or code changes)

  1. POST /stats/perf/reset (or use Tuning → Reset counters in the dashboard) to zero counters.
  2. Run your steady query load (e.g. dig loop or dnsperf) for a few minutes.
  3. GET /stats/perf (JSON) or open Tuning in the dashboard: compare avg_prep_ms, avg_total_ms, and histograms; use by_query_type to see A vs AAAA vs other types.
  4. Repeat with the same workload after sysctl/governor changes so comparisons are fair.

macOS / Windows

This guide targets Linux. On macOS or Windows, sysctl-style UDP buffer tuning differs or is not exposed the same way; typical small deployments rarely need host-level DNS tuning beyond a stable network path.