Jump to content
Not connected, Your IP: 18.220.75.97
paprika555

Wireguard: Switch server when current server has high utilization

Recommended Posts

Posted ... (edited)

Hello,

i'm using airvpn to open my plex server for friends (ds-lite double-nat issue) with wireguard which works really well.
The issue i'm facing is that sometimes, when the current server has a very high utilization (maxed out network speed), the vpn speed goes down and nobody is able to stream.
After switchting the server (e.g. wg-quick down/up), everything works fine again.

My question is, is there an solution possible with wireguard? If not, i'm thinking about querying the current server with the API and restart wireguard when the current server reaches near 100%, but that would drop the connection if a movie is played.

Thanks, happy to hear some ideas.

paprika

Edited ... by paprika555

Share this post


Link to post

To switch to less loaded server, you could add to cron something like this: https://github.com/WireGuard/wireguard-tools/blob/master/contrib/reresolve-dns/reresolve-dns.sh. As long as you're using peers with FQDN, for example us3.vpn.airdns.org, this script will ask wireguard to reresolve this domain. This domain resolves to the "best" server in a given country. "best", I believe, means least loaded and without connectivity issues.

However, this often will change your AirVPN server, so this means dropped connections and some time until DDNS entry updates or some other means to tell your friends the new IP.

Share this post


Link to post

Thanks for the response @benfitita. I've now tracked the utilization of the current server i'm connected to, and the plex clients are still not able to play the videos even when the utilization is only 5%.
A reconnect does not solve the issue. There seems some kind of throttling going on, but only sporadically. Very strange.

Share this post


Link to post

It might be your ISP messing with your internet connection. To verify this, try OpenVPN on port 443. It is a common port used for HTTPS, so ISPs usually don't bother with throttling it.

Share this post


Link to post

sounds like a MTU issue to me.
Staff has said if using us3.vpn.airdns.org:1637. as the connected server.  it will automatically connect and reconnect if there is an issue.
I've noticed when I used wireguard that was true.   I would be on one server, then check the IP then be on a different one.
the entire point of WG was to be a connectionless protocol.  if its disconnecting its on your configuration end 

Share this post


Link to post
Posted ... (edited)

Sure, that could be an MTU issues as well. Worth trying 1280.

However, I'm not entirely sure that WireGuard automatically re-resolves the peer FQDN when connectivity issues happen. I think you need to actively nudge it to re-resolve and therefore pick up a new server. Otherwise scripts like I linked above wouldn't be needed.

Edited ... by benfitita
Add MTU comment

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...