Skip to content

High CPU and network bandwidth usage at special gateways #5879

@mritd

Description

@mritd

What is the issue?

Operating environment

  • run using the command line
  • tailscale(d) version: v1.30.2
  • golang build version: go1.19.2
  • System version: macOS 12.6 (21G115) / M1 Max(arm64)

What happened

The tailscaled process consumes a lot of CPU and sends a lot of traffic to the derper server.

image

image

Steps to reproduce

Allow me to start with my findings:

When used with some other network proxy tools (such as Surge), if other tools set a proxy gateway (such as Surge enhanced mode will set the default gateway to 198.18.0.1), tailsaled seems to be unable to read the default gateway, which will cause tailscaled Stuck in some infinite loop.

How to reproduce

  • Download Surge App
  • Turn on enhanced mode in the top menu
  • Use the netstat -rn command to confirm that the default gateway is set to 198.18.0.1
  • Restart tailscaled several times with tailscale down && tailscale up command
  • The tailscaled process will continue to consume a lot of CPU and keep sending a lot of traffic to the derper

Log

To describe the problem more clearly, I modified the launchd configuration and generated the log(I submitted a PR #5878 incidentally to enable log files by default):

tailscaled.log

Are there any recent changes that introduced the issue?

I tried looking at the code and it seems that there is a problem in the interfaces_darwin.go code, guessing that the impactful change might start with 04c2c5bd80e86b2113d4e04e840d79ec66981fda.

image

OS

macOS

OS version

12.6 (21G115) / M1 Max(arm64)

Tailscale version

v1.30.2

Bug report

BUG-9f5e02a01c6c13045de0c809a1920718b3a3e585e740cb2555da520c13491e40-20221009030245Z-b4a892d63e1da8c7

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions