kedge
kedge copied to clipboard
winch: Cache kedge DNS resolution to optimize winch
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.
Thanks for the clarification. I did not know if golang under the hood relied on the OS for final DNS calls.
Poll sounds good to avoid the lookups.
On Wed, 18 Apr 2018 at 11:54 Bartek Plotka [email protected] wrote:
@gedw99 https://github.com/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.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/improbable-eng/kedge/issues/62#issuecomment-382332249, or mute the thread https://github.com/notifications/unsubscribe-auth/ATuCwir-yGbV_kL4pagZ8nHpHQykxryQks5tpw1NgaJpZM4Pm_EW .