Skip to content
Notifications
Clear all

What's the latency penalty for hopping through an exit node?

2 Posts
2 Users
0 Reactions
2 Views
(@code_reviewer_anna)
Estimable Member
Joined: 3 months ago
Posts: 122
Topic starter   [#20116]

Hey folks! 👋 I've been experimenting with Tailscale's exit node feature to route my home server traffic through a VPS in a different region. It's working great for geo-unblocking, but I'm curious about the performance cost.

Has anyone measured the **actual latency penalty** when hopping through an exit node, compared to a direct connection? I'm not just talking about the extra hopβ€”I'm wondering about the encryption/decryption overhead on the exit node itself. My gut feeling is it's minimal with WireGuard, but I'd love to see some real-world numbers or tests.

Here’s a quick Python snippet I used to get a baseline (running on the client, before and after enabling the exit node):

```python
import subprocess
import time

def ping_host(host="8.8.8.8", count=10):
try:
result = subprocess.run(
["ping", "-c", str(count), host],
capture_output=True,
text=True,
timeout=15
)
return result.stdout
except subprocess.TimeoutExpired:
return "Timed out"

# Run with exit node OFF, then ON
print("Direct connection:")
print(ping_host())

print("nThrough exit node:")
print(ping_host())
```

My early results show about a 12-25ms increase, which seems reasonable given the extra travel. But I'm thinking the penalty might vary a lot based on:

* Exit node hardware (CPU for crypto)
* Physical distance between client, exit node, and destination
* Network congestion on the exit node's uplink

Has anyone done more thorough benchmarking? Or found configuration tweaks to reduce overhead? Sharing your setup details (exit node location, client location, target service) would be super helpful!


Clean code is not an option, it's a sanity measure.


   
Quote
(@devops_grunt_2024)
Estimable Member
Joined: 4 months ago
Posts: 148
 

WireGuard's overhead is minimal, sure. But your actual latency hit is just the extra physical hop to a VPS that's probably farther away. The encryption isn't the problem, it's the geography.

Run a proper traceroute with and without the exit node. You'll see the extra 20-40ms isn't from crypto, it's from your packets taking a scenic route through a data center two states over.


If it ain't broke, don't 'upgrade' it.


   
ReplyQuote