Open MahdiNazemi opened 1 year ago
The latest version of wireguard-go
has some performance enhancing patches. We ship with a slightly older version. So upgrading that on our side might help with the performance difference compared to the vanilla WireGuard client.
The performance dip you see by just having our app installed might come from us enabling the macOS built in firewall, pf
. But we are not sure yet. That's strange. You could try running sudo pfctl -d
from a terminal to disable it after you have disconnected from Mullvad to see if it brings your performance back up to the expected values.
Thank you for taking the time to read my bug report and provide suggestions.
wireguard-go
version in Mullvad (without compiling from scratch) for an apples-to-apples comparison?pf
did not help. The download speed with the VPN turned off drops from 800-900 Mbps to 600-700 Mbps.Thank you for reporting this.
I can reproduce your findings, but I've eliminated internet noise and ran iperf
on a LAN. After resetting the system, I'm getting speeds above 900MBit/s, and after installing and connecting to a relay, the LAN performance degrades to about 730MBit/s, but not during the first test. We'll try updating to a newer version of wireguard-go
, but I don't believe this will relieve us of this pathological behavior. Even disabling the daemon and the firewall does not help, this can be done via the following command
sudo launchctl unload /Library/LaunchDaemons/net.mullvad.daemon.plist
sudo pfctl -d
I'm not entirely certain what part of our client could lead to horrible performance degradation on interfaces we do not touch, difficult to speculate. We'll see if we can spend more time on this.
Thank you for investigating and reproducing the issue. Please feel free to change the title to something more descriptive.
The latest version of
wireguard-go
has some performance enhancing patches. We ship with a slightly older version. So upgrading that on our side might help with the performance difference compared to the vanilla WireGuard client.We'll try updating to a newer version of
wireguard-go
, but I don't believe this will relieve us of this pathological behavior.
I recently started building Mullvad from source for my Mac devices. @pinkisemils, Can you please let me know how I can update the version of wireguard-go
used in Mullvad?
I suspect I should update wireguard/libwg/go.mod
with a newer version number, but I'm not sure where to get the commit hash (?) of the latest version available on golang.zx2c4.com/wireguard.
Thank you!
Sorry for the radio silence @MahdiNazemi, you should take one of the latest tags from https://git.zx2c4.com/wireguard-go/ and try that. However, I don't believe this has much to do with WireGuard and most everything to do with macOS's internals - I think you'd be able to reproduce the same issues by just creating a utun
device, applying some routes to it and subsequently destroying it. Happy hacking :slightly_smiling_face:
OpenVPN doesn't seem to suffer from this issue. It would be interesting to see if iperf
shows the same behavior when using OpenVPN.
@faern, do you mind sharing if there has been any recent investigation on this issue and if it is likely to be fixed in the near future?
Sadly we have not looked into this. We don't really get reports about this issue from many users at all. Not sure if it only affects a small subset of users, or if most people don't notice/care about the performance drop.
Issue report
Operating system: macOS Ventura (13.3.1) App version: 2023.3 Other software:
Issue description
TL;DR: Merely installing and setting up the Mullvad client reduces my download speed by about 30%, irrespective of whether the app is active or not. Removing the Mullvad client and using
wireguard-tools
does not exhibit the same behavior.I own two M1 Mac machines--one connects to my modem/router via Ethernet cable while the other one connects through WiFi. Unfortunately, the latter has been experiencing slow download speeds for the past few months, and despite tinkering with the modem/router's WiFi settings, I haven't been able to resolve the issue.
M1 Mac with a Wired Connection
The nominal download speed of the ISP is 800 Mbps, but I typically reach a speed of around 900 Mbps when using the Ethernet connection and without VPN. When I connect to a Mullvad server from the terminal using the
wg-quick up
command, my speed usually ranges between 750-800 Mbps.M1 Mac with a Wireless Connection
The download speed without using VPN falls within the range of 550-650 Mbps, whereas with VPN (Mullvad client), it ranges between 450-550 Mbps. The distance between the router and the laptop is approximately 4-5 meters, with a wall separating the two.
However, it is possible to increase the reported download speed numbers to approximately 800 Mbps and 700 Mbps for non-VPN and VPN connections, respectively.
How to Reproduce the Issue (numbers based on my Internet service)
sfltool resetbtm
to reset Login Items and Allow in the Background settings.wireguard-tools
, generate a WireGuard configuration file on https://mullvad.net, and usewg-quick up
to connect to a server.wg-quick down
command.I understand that the Mullvad client utilizes
wireguard-go
, which is also a software dependency ofwireguard-tools
. As such, I am having difficulty comprehending the reason behind the difference in the reported behavior.I repeated the aforementioned steps three times using the same machine, and I was able to reproduce similar results consistently. I would appreciate it if someone else could go through the same steps and observe if they also experience the same behavior. Currently, I have switched to using
wg-quick
.