go请求Nginx的Grpc反向代理后,出现 code = Unavailable desc = the connection is draining
I'm running some high volume gRPC requests through nginx and see a lot of this error: 'there is no connection available' and 'the connection is draining' when using nginx
(linked issue grpc/grpc-go#2205)
The suggested workaround is When we set http2_max_requests 1000000, the possibility became very low.
There are similar suggestions in the linked nginx ticket. https://trac.nginx.org/nginx/ticket/1250
The ConfigMap already supports http2-max-field-size
and http2-max-header-size
, so it should be relatively trivial to add support for http2-max-requests
.
http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests
Honestly it'd probably be helpful for people to change the default when gRPC is enabled, but I understand that deviating from nginx defaults probably isn't the best choice for this repo. It'd be worth documenting with the gRPC example.
以上是网络上的找到,后来自己解决了:
只要把go grpc更新到最新的库版本,就可以解决这问题