mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-01 14:05:39 +00:00
2a67beaacf
tailscaled was using 100% CPU on a machine with ~1M lines, 100MB+ of /proc/net/route data. Two problems: in likelyHomeRouterIPLinux, we didn't stop reading the file once we found the default route (which is on the first non-header line when present). Which meant it was finding the answer and then parsing 100MB over 1M lines unnecessarily. Second was that if the default route isn't present, it'd read to the end of the file looking for it. If it's not in the first 1,000 lines, it ain't coming, or at least isn't worth having. (it's only used for discovering a potential UPnP/PMP/PCP server, which is very unlikely to be present in the environment of a machine with a ton of routes) Change-Id: I2c4a291ab7f26aedc13885d79237b8f05c2fd8e4 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> |
||
---|---|---|
.. | ||
interfaces_darwin_test.go | ||
interfaces_darwin.go | ||
interfaces_default_route_test.go | ||
interfaces_defaultrouteif_todo.go | ||
interfaces_linux_test.go | ||
interfaces_linux.go | ||
interfaces_test.go | ||
interfaces_windows_test.go | ||
interfaces_windows.go | ||
interfaces.go |