Description
Describe the problem
chosen home Relay server is random and not based on latency.
To Reproduce
Steps to reproduce the behavior:
- Deploy multiple relay servers (new relay) to different geographic regions.
- Run client in same region as one of relay servers.
- Observe chosen home relay server.
In my case specifically:
- Deploy relay servers to AWS regions:
a. us-east-1
b. eu-central-1
c. ap-south-1 - Run client in us-east-1
Expected behavior
Expected client to chose home relay server to be closest server in latency.
Are you using NetBird Cloud?
Self-hosted
NetBird version
0.33.0
NetBird status -dA output:
N/A
Do you face any (non-mobile) client issues?
N/A
Screenshots
N/A
Additional context
I noticed in the code in relay/client/picker.go
in processConnResults()
it takes the first item with a successful connection from the resultChan chan
, this is highly dependent on Golang scheduling and channel ordering rather than latency.
Might be relevant: tested client has only 1 core (so only 1 thread can run at a time, which would highly affect the ordering to be only based on the Go scheduling), another client which has 8 cores chose the nearest relay server consistently.