Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Connecting secondary wireguard VPN causes very high latency

+2
−0

Why would adding a secondary VPN massively increase latency?

Suppose I have two Wireguard VPNs, wgA and wgB. Both are from the same provider, used to access the internet in general, so allowed IPs is 0.0.0.0/0 on both. wgA is the default route, wgB is only used for traffic from a specific source subnet (implemented via routing tables).

I test latency by pinging a known commercial server.

  • With both VPNs disconnected, I get 40 ms.
  • With only wgA connected, I get 170 ms. wgA is on a different continent, so this is reasonable.
  • With only wgB connected, I get 70 ms. wgB is one town over.
  • With both connected, through wgA I still get 170 ms. Through wgB (using ping -I 10.0.0.1) get 370 ms.

The routing is quite simple:

  • Connections from subnet go to table 100: ip rule add from 10.0.0.0/24 table 100 priority 1000
  • Routing table sends everything to wgB: ip route add default dev wgB table 100
  • There's a few straightforward NAT rules.

How could this cause a latency spike? I've noticed the 370 ms is in the first hop, which shows as the internal IP of wgB.

Also, if I ping the public IP, that takes 350 ms both through wgA and wgB. I would expect it to be fast to at least ping the VPN's own server through itself.

I get that adding more routing introduces overhead but it surely isn't 200 ms of overhead. And no the CPU is not overloaded on the server. I feel like I'm missing something obvious.

History

0 comment threads

Sign up to answer this question »

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant