Hi, I recently updated to CE 21.2 from 21.1.1 and observed a noticeably slower throughput in wireguard tunnels.
So I installed the previous CE version on a second sd card and did some testing both in lan and across the internet with curl and iperf on coreelec comparing it to the latest version and confirmed that performance is very much diminished in 21.2 compared to 21.1.1.
I honestly find this very strange because both versions use the exact same kernel since I’m using amlogic-ng.
I also looked for some meaningful changes in the latest stable update that could be affecting performance so greatly, but couldn’t find anything.
Am I missing something?
Has anyone else experienced this?
Just confirming i think i see the same: I just got a ugoos AM6b+ and installed Wireguard, and also see slow speeds (20mbps downlink, 40mbps uplink from a speedtest on the client device). I did not compare it to older coreelec builds (yet), but my RPi3 does 70/70mbps, so it seems strange that the Ugoos would be slower, as the hw is much much stronger. General network and internet speeds are fine on the AM6b+ (nearing 1gbps in every other scenario)
I actually did more testing afterwards but forgot to report back.
First of all it seems I was mistaken about the coreelec version being the culprit. I was able to reproduce the issue on the old version too and get rid of it on the new one.
In my case, this is caused, as strange as it may sound, by a very specific screen saver which can be enabled only on a certain skin. I can see, as soon as the screensaver starts, that throughput gets heavily reduced, only to get back to normal when the screensaver is stopped.
My guess is that some form of powersave is triggered when screensaver starts but only with that specific one. Default “dim” or black screen don’t seem to cause issues.
Furthermore I suspect this got introduced in an updare of the skin, which one I can’t say (by the way, the skin is arctic fuse 2 and the screen saver is arctic mirage), because I can’t see this behaviour on a remote box with a previous skin version (though I won’t try to upgrade it until I can get to it phisically).
For now I switched back to dim screensaver to avoid the slow down.
(I would point out that in normale usage you would never have noticed this, since to trigger it the screensaver must be active, I noticed it doing file transfer on ssh)
About your speeds, I don’t know about rpi3, though that seems very slow compared to what I would expect from it, but I can tell you am6b hardware can easily achieve multiple gigabit per second throughputs, while being limited to gb ethernet port. My boxes are odroid-n2 which have the same soc of the am6b (apart from dovi certification) and, network allowing it, always reach about 920mbps in wireguard on ethernet. I also own an am6b+ and I can’t see any difference from the odroids.
What is your testing metodology? Are you sure you are not using a userspace implementation on wireguard on your devices client included? Are you sure you are not limited by storage I/O?
Well, the screensaver is not the issue here. And probably not the build either, as you say, as I tried a few random nightly coreelec builds going back to around 1/1, all with the same issue.
Define userspace implementation? I use the wireguard app on my clients (Android phones & tablets + a Win 11 PC, all with the same issue) and serverside it is set up as described here: WireGuard VPN tunnel configuration using wg-quick script
Testing methodology is connecting, and then running a ookla speedtest or copying a file from the storage connected to the box.
Going quite off-topic here…
Android (unless you know exactly what you are doing) uses wireguard-go userspace implementation which has decent enough performance. Windows also uses a variant of that, but for it not to be able to reach gigabit throughput you would have to use a very very slow cpu.
On coreelec you are using a systemd service which sets up wireguard using linux kernel module, you should have no performance problems there on am6b+.
But I don’t understand which peers you are connecting to and between whic ones you are testing. I didn’t understand if you are using a third party vpn provider and if those speeds refer to internet traffic routed through such provider.
Honestly, much can depend of what you are doing and if you are trying to test wireguard across internet it obviously depends of your connection speeds.
What I can tell you is that if you would like to evaluate wireguard performance you should test it avoiding network or storage bottlenecks.
One such way is to use iperf3
between two of the aforementioned peers. Can’t say about windows support, but you can find it on every linux distro and on termux android works quite well too (though you would not necessarily be able to reach gigabit speeds on a phone/tablet because both wifi and wireguard-go depending much on hardware). On coreelec it is available in a package you can intall from kodi, named something like system tools or network tools, but you can find it in the description anyway.
If you want ot give it a try I suggest listening on one peer with iperf3 -s
(it listens on TCP port 5201 and it is configurable) and connecting on another with iperf3 -c ip.of.wg.peer -P 8 -t 15
, adding -R
at the end for reverse connection, which uses 8 parallel streams and tests for 15 seconds. Be sure not to be blocked by firewalls.
All this assumes of course each peer is correctly routed through the tunnel to reach the other.
If you want to test file transfer speed and are serving files through an http server, you should test download speed with curl
which uses, obviously, libcurl which is in turn used also by kodi for network transfers using http, including remote folders (http or webdav) shares and player stream from such shares.