GRPC: Spring boot: How to warm up a grpc client. Especially to make it resolve domain names

Viewed 44

The issue is: A grpc client is taking too much time on its first call. And after debugging, it was the domain name resolution that is taking that amount of time.

Is there any way to warm up the grpc clients just after the application starts?

Update: The request eventually succeeds, but the first call takes so much time, the consecutive calls are much faster.

And Im using this library https://github.com/yidongnan/grpc-spring-boot-starter

1 Answers

When created, the ManagedChannel has not performed any I/O. It will lazily initialize itself on the first RPC or if you call managedChannel.getState(true).

Related