akka/akka-grpc

Very slow first request

johanandren opened this issue · 3 comments

Something with the Netty based client process id autodetection done by Netty, and more specifically io.grpc.netty.shaded.io.netty.channel.DefaultChannelId. No clear way to reproduce.

More details: lightbend/kalix-jvm-sdk#1149

I've noticed this too. The easiest work around is to just run a non sla request against the service either internally or from some external test

Seems related to macos hostname vs Java hostname resolution somehow, many people have reported adding the hostname to the localhost entries in /etc/hosts sorts it, so, if your machine is mbpro.local (as reported by hostname), add:

127.0.0.1   localhost mbpro.local
::1         localhost mbpro.local

Reference: https://stackoverflow.com/questions/39636792/jvm-takes-a-long-time-to-resolve-ip-address-for-localhost/39698914#39698914

Doesn't look like something we can easily fix specifically for Akka gRPC, but workaroundable by users, so closing.