riok / Kreya

Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
https://kreya.app
280 stars 5 forks source link

Somehow, there is an exact 2s delay from nameserver resolution to connection setup #78

Open buehler opened 2 years ago

buehler commented 2 years ago

Describe the bug I've been experimenting with a local grpc server when I saw that each call needs exactly around 2 seconds. Between "resolution stop" and "connection established" there is a 2s delay for no reason. When I tried the same call in Insomnia gRPC, it was nearly instant.

To Reproduce Steps to reproduce the behavior:

  1. Have a grpc server
  2. Create a call
  3. Send call :)

Expected behavior That it should be blazingly fast

Screenshots image

Environment (if possible, copy the information from the error dialog or the About menu):

buehler commented 2 years ago

{ "kreyaVersion": "1.7.0", "platform": "Win32", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.30" }

CommonGuy commented 2 years ago

I cannot reproduce this: grafik

Could you try calling your API via http://127.0.0.1:8080 and http://[::1]:8080? I suspect IPv6 issues when resolving localhost, where Kreya tries to connect to the "IPv6 IP", but has to fall back to the "IPv4 IP".

buehler commented 2 years ago

Huhu :)

Yep, when I use 127.0.0.1 it is blazingly fast.

CommonGuy commented 2 years ago

Ok, then that's the workaround for now...

As for improving this, we are blocked until https://github.com/dotnet/runtime/issues/26177 has been implemented into the .NET "gRPC infrastructure" (mainly HttpClient/SocketsHttpHandler).