Repository navigation
System defaults: sysctl hardening, proxy-path tuning, MGLRU, per-node TFO (#39) - #57
Merged
Merged
Conversation
…min_ttl, per-node TCP Fast Open - sysctl: kptr_restrict=2, dmesg_restrict=1, bpf_jit_harden=2; rmem_max / wmem_max 7500000 (QUIC: hysteria2, tuic), tcp_notsent_lowat=131072, tcp_slow_start_after_idle=0. - mr-zram: MGLRU min_ttl_ms=1000 — OOM kill instead of thrashing. - Go daemons already had GOMEMLIMIT / GOGC: unchanged. - proxy nodes: `tfo: true` -> sing-box tcp_fast_open (TCP protocols; the server must enable TFO); web UI switch; one lab node uses it (real sing-box check + traffic in CI). Closes #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Hardening (
/etc/sysctl.d/90-mini-router.conf):kernel.kptr_restrict=2,kernel.dmesg_restrict=1(mr reads the kernel log as root, unaffected),net.core.bpf_jit_harden=2(nothing on the router uses BPF).kexec_load_disabledstays off (sysupgrade needs kexec); Spectre/Meltdown switches make no difference on Cortex-A53.Proxy path — the one bulk path through the CPU:
net.core.rmem_max/wmem_max= 7500000 (what quic-go asks for; hysteria2 and tuic),net.ipv4.tcp_notsent_lowat=131072(less data parked in send buffers → lower latency through the proxy),net.ipv4.tcp_slow_start_after_idle=0.Memory:
mr-zramsets MGLRUmin_ttl_ms=1000when the kernel has it: the working set of the last second is never evicted; when memory cannot hold it the OOM killer acts instead of the system thrashing. The Go daemons (tailscaled, lucky, dstatus-agent, sing-box) already run withGOMEMLIMIT/GOGCfrom their init scripts — unchanged.TCP Fast Open per node:
tfo: trueon shadowsocks / vless / vmess / trojan / anytls / socks / http nodes renders sing-boxtcp_fast_open— one round trip less per connection to a server that enables TFO too (own servers). Refused for QUIC types and custom nodes; switch in the web UI node editor; documented.Verification
min_ttl_ms=0; the Go daemons' environments showGOMEMLIMIT/GOGC.tcp_fast_openrendered exactly for the nodes that settfo;tforefused for hysteria2, tuic and custom.tfoon for one Shadowsocks node: CI's real sing-box 1.14.1 accepts the config and carries TCP and UDP end to end through that node.tools/ci.shpasses (private and public trees).Closes #39
https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr