TCP Keep Alive Limit for incoming connections

Hi there,

I’m wondering if there is an env var I can set on the Ingress deployment limit keepalive of incoming TCP connections.

My LB shows 5000 open connections, but kong is processing only 300 per second. For these APIs, I don’t really need long lived connections.

Is there another way to do this?

Thank you.

The standard NGINX keepalive timeout directive will work for this. You can inject those directives, e.g. with KONG_NGINX_PROXY=60s.

Thank you @traines.

I have specified KONG_NGINX_HTTP_KEEPALIVE_TIMEOUT and will let you know if if produces the desired effect.

Just to close the loop, this setting works but my specific problem here was the timeout server directive on the load balancer being set to 600s. So the load balancer kept the connection open for 10 mins, whether it is used or not.

Solution? Scrap the cloud managed load balancer and deploy your own instance of HA proxy, and everything looks much better now.