-
Notifications
You must be signed in to change notification settings - Fork 2k
gRPC service keepalive configuration not working #2356
Replies: 1 comment · 6 replies
-
Can you please tell us what version of the NGINX Ingress Controller you are using? |
Beta Was this translation helpful? Give feedback.
All reactions
-
first - exec into the NIC container and try to get a response from the backend service pods. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hey @brianehlert - We managed to get our gRPC services running behind the NIC. However we still see the behaviour of the timeouts not respecting the keep-alive pings. We installed th NIC using the helm chart. Chart Nginx logs below. This is a filtered snapshot of the logs as there is alot of
NIC configuration
Please note we never see any keep alive pings in the NIC logs. Can you confirm the expected behaviour with bi-directional streaming and gRPC. Would you expect nginx to respect the keep-alive pings and not timeout after 60s as configured above? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @manishkulkarni @chris-brown NGINX expected behavior is to not support keepalive pings. Please see this https://trac.nginx.org/nginx/ticket/1887 for further explanation. If you'd like to use TCP keepalives, as mentioned in https://trac.nginx.org/nginx/ticket/1887 , this can be added to the Ingress Controller by adding |
Beta Was this translation helpful? Give feedback.
All reactions
-
Would I may be mis-interpreting what each of these settings do ( |
Beta Was this translation helpful? Give feedback.
All reactions
-
I've also opened #4043 as an idea to add non-snippet configuration option for |
Beta Was this translation helpful? Give feedback.
-
We have a gRPC dotnet core service running on Kubernetes behind Nginx Ingress. The service has bidirectional streaming endpoint.
The ingress is configured with grpc_read_timeout, grpc_send_timeout & client_body_timeout as per documentation to allow the connections to be kept open.
The gRPC service is consumed by a dotnet client app and it uses SocketsHttpHandler so that it can send KeepAlive pings during inactivity period.
From the Nginx debug logs we can see that keepalive pings are being sent from client but Nginx server resets stream when grpc_read_timeout / grpc_send_timeout is reached during period of inactivity. We tried the client with keepalive pings disabled but, the behaviour is still the same, connection remains open until read/send timeout is reached. Therefore keepalive pings seem to be adding no value.
My assumption was that if we keep sending keepalive pings, Nginx server should not reset stream. Not sure if we have some configuration or implementation issue or if we are misinterpreting how keepalive works & this is by design?
Any pointers or help is much appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions