Kong / kong-dist-kubernetes

Kubernetes managed Kong cluster
255 stars 137 forks source link

Disconnection after 60s with GRPC connection #103

Open AshuPretlist opened 4 years ago

AshuPretlist commented 4 years ago

I am connecting my GRPC micro-service through kong by a Android client. GRPC connection works fine for 60s after that it disconnects. I have changed read_timeout, write_timeout and connect_timeout to 300s in services. it has no effect. Also I have changed keepalive_timeout 60s; in kong template. It does not have any effect either. It seems there is some issue with GRPC connection.

hbagdi commented 4 years ago

@AshuPretlist Can you make sure that your gRPC service is not closing the connection or any other Load-Balancer between your client and Kong is not closing the connection?

cc @gszr

AshuPretlist commented 4 years ago

@AshuPretlist Can you make sure that your gRPC service is not closing the connection or any other Load-Balancer between your client and Kong is not closing the connection?

cc @gszr

Hi @hbagdi I am not using any LB. I am directly connecting with Kong. When I am running my services out of Kong and connecting it, It works fine, my connection last as long as I want. But when I am running behind kong, it is disconnecting after a min. So it seems there is some problem with kong.

http://nginx.org/en/docs/http/ngx_http_grpc_module.html#grpc_read_timeout

From above link what I can conclude is that if connection is idle for 60s, It will disconnect with my grpc micro service. My GRPC service endpoint is Bi-directional and I assume it is persistent connection. Any help is highly appreciable.

hbagdi commented 4 years ago

Did you try to use Nginx directive injection in Kong to tweak the default?