I'd like to alter the parameter GRPC_ARG_HTTP2_MAX_PING_STRIKES as documented here (https://github.com/grpc/grpc/blob/master/doc/keepalive.md). with a default value of 2. Want to change it to tolerate 0 pings before the connection is closed with a go-away (without any debug data, e.g too_many_pings).
And why i need to change this?
I have a kotlin microservices architecture with coroutines that uses only unary calls from gRPC. And I'm simulating a productive environment with several threads per second through a load test. After several calls between the communication of two client and server microservices for 1/3 minutes I am returned:
"INVALID_ARGUMENT: RESOURCE_EXHAUSTED: Connection closed after GOAWAY. HTTP/2 error code: ENHANCE_YOUR_CALM (Bandwidth exhausted)."
I've found that if i set that parameter I said above to 0 the error would stop existing. I imagine this must be some gRPC protection to avoid DDOs.
This is our client/server config:
@Bean
fun keepAliveClientConfigurer(): GrpcChannelConfigurer {
return GrpcChannelConfigurer { channelBuilder, _ ->
if (channelBuilder is io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder) {
channelBuilder
.keepAliveTime(30, SECONDS)
.keepAliveTimeout(5, SECONDS)
}
}
}
@Bean
fun keepAliveServerConfigurer(): GrpcServerConfigurer? {
return GrpcServerConfigurer { serverBuilder: ServerBuilder<*> ->
if (serverBuilder is NettyServerBuilder) {
serverBuilder
.permitKeepAliveTime(0, TimeUnit.NANOSECONDS)
.permitKeepAliveWithoutCalls(true)
}
}
}
Any pointers on how to change this parameter? Appreciate any responses.