Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

grpc - concurrent requests through nginx's grpc_pass failed

When sending grpc requests through nginx concurrently, I received at client:

Caused by: io.netty.handler.codec.http2.Http2Exception$StreamException: Cannot create stream 2015 greater than Last-Stream-ID 2001 from GOAWAY.
    at io.netty.handler.codec.http2.Http2Exception.streamError(Http2Exception.java:147)
    at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.checkNewStreamAllowed(DefaultHttp2Connection.java:874)
    at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:748)
    at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:668)
    at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders0(DefaultHttp2ConnectionEncoder.java:201)
    at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders(DefaultHttp2ConnectionEncoder.java:167)
    at io.netty.handler.codec.http2.DecoratingHttp2FrameWriter.writeHeaders(DecoratingHttp2FrameWriter.java:53)
    at io.netty.handler.codec.http2.StreamBufferingEncoder.writeHeaders(StreamBufferingEncoder.java:153)
    at io.netty.handler.codec.http2.StreamBufferingEncoder.writeHeaders(StreamBufferingEncoder.java:141)
    at io.grpc.netty.NettyClientHandler.createStreamTraced(NettyClientHandler.java:579)
    at io.grpc.netty.NettyClientHandler.createStream(NettyClientHandler.java:562)
    at io.grpc.netty.NettyClientHandler.write(NettyClientHandler.java:323)

When requesting grpc server directly without nginx, there is no error.

question from:https://stackoverflow.com/questions/65881809/concurrent-requests-through-nginxs-grpc-pass-failed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

http://nginx.org/en/docs/http/ngx_http_v2_module.html

The behavior is controlled by http2 module, not grpc module:

    http2_recv_buffer_size 1024k;
    http2_max_requests 2147483647;
    http2_max_concurrent_streams 200;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...