grpc keepalive does not effect, nginx will close connection by the minute

Sergey Kandaurov pluknet at
Wed Jan 23 10:56:44 UTC 2019

> On 23 Jan 2019, at 05:37, Roar <nginx-forum at> wrote:
> Thanks Sergey Kandaurov. 
> The second problem is that I set grpc_read_timeout and grpc_send_timeout but
> it seems does not take effect. I tested many times and found that if the
> read_timeout less than default 60s, then it works. But it has no effect when
> read_timeout more than 60s, nginx will automatically close the connection
> between nginx and grpc server by every 60s. How to configure parameters to
> fix this issue?

There're different timeouts when communicating with gRPC server,
but only grpc_read_timeout is set when reading a gRPC response.
Please double-check to make sure: 1) there are no external events
that result in connection close; 2) connection is not closed by
another timeout such as keepalive timeout, after a whole response
had been read.  To sort out what's going on, it is useful to have
debug log, see

Sergey Kandaurov

More information about the nginx mailing list