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

Roar nginx-forum at forum.nginx.org
Tue Jan 22 03:43:01 UTC 2019


Grpc server is sitting at my backends, I use nginx as the proxy to transfer
http1.1 to http2(grpc) protocol,  I set parameter like below:

upstream ID_PUMPER {  
    server 127.0.0.1:58548;
}

server {
    listen 8080 http2;
    grpc_read_timeout 120s;
    grpc_send_timeout 120s;
    grpc_socket_keepalive on;
    keepalive_timeout 100s;
    
    location /utoProto.idProduce.IdProduce {
        grpc_pass grpc://ID_PUMPER;
    }
}

It will establish connection between nginx and grpc server, but it can not
hold the connection and the collection will be closed after one minute even
though I set keepalive_timeout parameter, I found that nginx will send FIN
packet to grpc server by monitoring the network packets through wireshark.
How can I hold the connection but not close it by every minute?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,282769,282769#msg-282769



More information about the nginx mailing list