improbable-eng/kedge

winch: Cache kedge DNS resolution to optimize winch

Opened this issue · 3 comments

We resolve all configured kEdges on demand. Even when it is used constantly, we perform DNS resolution every each time.

Let's optimize this. (DNS can be flaky)

Found the same thing with DNS. Especially on mobiles.
I was thinking of doing the DNS resolution in the golang code itself might help because you can then cache it.

@gedw99 one thing is to perform DNS resolution less often (cache it), second is making it independently to the request.

Also, I think it is all in Golang. If you dial to some DNS name, golang client will use net.LookupXXX to find IP. However we can write something before client to poll DNS every X seconds and change current IP that will be used directly in dial to avoid internal Go client lookup on every request.