yggdrasil-go icon indicating copy to clipboard operation
yggdrasil-go copied to clipboard

High CPU usage on OpenWRT

Open mickhaorex opened this issue 2 years ago • 3 comments

Yggdrasil is constantly using the CPU. Because of this, other router functions (DLNA, smb, etc.) are slow to work.

https://user-images.githubusercontent.com/99164289/209582846-88afec66-84c2-4c4e-982e-f912c954a511.mp4

Router Parameters: State CpuINFO

Yggdrasil node status: status

Is this how it should be? Or is the Yggdrasil version for OpenWRT still "raw"?

mickhaorex avatar Dec 26 '22 21:12 mickhaorex

The device likely doesn't have too many resources and may simply be too slow for yggdrasil. Maybe optimizing ygg in the future could solve this (stuff like WPA3 runs flawlessly on it, afterall). But for now you might need a raspberry instead.

mkg20001 avatar Jan 01 '23 22:01 mkg20001

Yggdrasil generally uses more CPU resources than it should. I tested it on a Debian server and a Windows workstation, CPU constantly floated between 0.5-2.0%, which is too much for my taste. To compare, Tor with default settings very rarely displays anything above 0%.

vensko avatar Jun 24 '23 21:06 vensko

Yggdrasil generally uses more CPU resources than it should. I tested it on a Debian server and a Windows workstation, CPU constantly floated between 0.5-2.0%, which is too much for my taste. To compare, Tor with default settings very rarely displays anything above 0%.

There is work ongoing with the upcoming v0.5 version to reduce the amount of idle network traffic and maintenance tasks and there is no doubt a lot of room for optimisation, but you also have to understand that Tor and Yggdrasil are technically very different from each other. There is no fair comparison between the two given they do different things, are written in different languages and have different idle maintenance requirements.

Some of the CPU usage in part may come from the Go GC (which is an implementation-specific detail), some of it from the use of encryption and signature authentication for both protocol messages and traffic, probably an even bigger share of it from forwarding protocol messages, tree announcements and/or general overlay traffic on the path in the case that you have multiple peers.

neilalexander avatar Jun 25 '23 10:06 neilalexander