Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTCPTuning ¶
func ApplyTCPTuning()
ApplyTCPTuning applies the socket and TCP settings a tunnel wants, at start.
It used to carry its own table of values, and that table disagreed with the one Optimize writes. The disagreements were not visible from anywhere: Optimize set net.core.rmem_default to 16 MB and the next tunnel start put it back to 1 MB, the same for wmem_default, and tcp_notsent_lowat went from 128 KB to 32 KB the same way. An operator who had deliberately optimized the machine had three of those settings quietly undone by a restart.
ip_local_port_range was the fourth and the one that was visible, because losing a service's port is a thing people notice. It is the reason this now takes its values from optimize.EngineStartupTuning rather than keeping a second copy of them — one table means the two cannot drift, and which keys a starting tunnel may set is decided there, beside the values.
func Run ¶
Run keeps one tunnel running from a configuration file, restarting it in place whenever the file changes. See reload.go for why the file is watched at all, and for the two rules that keep watching it from being a liability: a file that does not parse is ignored, and a file that means the same thing does not disturb the tunnel.
Types ¶
This section is empty.