question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebSocket keepalive/pings

See original GitHub issue

@jan-law Try adding these annotations to each Ingress:

nginx.ingress.kubernetes.io/proxy-read-timeout: 3600
nginx.ingress.kubernetes.io/proxy-send-timeout: 3600

This seems to be the recommended solution from the NGINX Ingress documentation: https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/#websockets

_Originally posted by @ebaron in https://github.com/cryostatio/cryostat-operator/issues/279#issuecomment-983039470_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ebaroncommented, Jan 10, 2022

Since these annotations apply only to Kubernetes, what would be the OpenShift equivalent of setting the nginx timeouts?

I found this in the OpenShift documentation: https://docs.openshift.com/container-platform/4.9/networking/routes/route-configuration.html Variable Default Description ROUTER_DEFAULT_TUNNEL_TIMEOUT 1h Length of time for TCP or WebSocket connections to remain open. This timeout period resets whenever HAProxy reloads.

So it would be an hour by default, but I don’t see an annotation to modify it when creating the Route.

For future reference: there does appear to be annotation for OpenShift routes: haproxy.router.openshift.io/timeout-tunnel [1]

[1] https://docs.openshift.com/container-platform/4.9/networking/routes/route-configuration.html#nw-route-specific-annotations_route-configuration

0reactions
andrewazorescommented, Nov 30, 2021

Since these annotations apply only to Kubernetes, what would be the OpenShift equivalent of setting the nginx timeouts?

I found this in the OpenShift documentation: https://docs.openshift.com/container-platform/4.9/networking/routes/route-configuration.html Variable Default Description ROUTER_DEFAULT_TUNNEL_TIMEOUT 1h Length of time for TCP or WebSocket connections to remain open. This timeout period resets whenever HAProxy reloads.

So it would be an hour by default, but I don’t see an annotation to modify it when creating the Route.

That would definitely explain why this behaviour shows up so easily in minikube and not in CRC!

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSockets ping/pong, why not TCP keepalive?
The websocket ping/pong will be forwarded by through web proxies. TCP keepalive is designed to supervise a connection between TCP endpoints. Web ......
Read more >
how to keep your websocket session alive | Shanhe Yi
NOTE: A Ping frame may serve either as a keepalive or as a means to verify that the remote endpoint is still responsive....
Read more >
Timeouts - websockets 10.4 documentation
To avoid these problems, websockets runs a keepalive and heartbeat mechanism based on WebSocket Ping and Pong frames, which are designed for this...
Read more >
Keepalive ping() possibly causing connection to die · Issue #922
Hello, I think we are seeing an issue where the ping frame trying to keep the connection alive, might be possibly causing the...
Read more >
Websocket connection closed automatically - keepalive Ping ...
The above method will start a timer task to send ping message for every 5 seconds to the server to keep the websocket...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found