0

I'm running a SSE server on a VPS and it works perfectly, no problems at all, but due to scalability reasons I needed to move it to another server.

I moved the server to Google Cloud Platform/Google Container Engine and Kubernetes/Ingress. But now I've encountered that I can't keep a SSE connection effectively, it's completely unstable and it closes connections by itself.

Is there anything special I have to do to run a SSE server over Kubernetes/Ingress?

I assume my code/software runs perfect and that is not the issue, due it works perfectly in Kubernetes, VPS, on my machine, everywhere, just not when I add the Ingress configuration, and I'm doing this because I want HTTPS over the Kubernetes load-balancer.

Carlos C
  • 101
  • 2
  • What are you running on your client and server side for SSE? Have you tried using a different client like `curl` to confirm if the connection remains open or is getting closed? – Tuxdude Jun 27 '17 at 03:25
  • It wasn't the client. I got it working, for no-closing connections like sockets I've found that you gotta set a really big timeout on Ingress, about 86,400 seconds (a day). – Carlos C Jun 28 '17 at 00:42

1 Answers1

0

Seems that Ingress defaults timeout was 30 seconds for any type of connection, I've set it to 86,400 (a day) and now the socket works good.

You can change the timeout over the Google console like this:

➜ export BACKEND=xxx-xxx-xxxxxx
➜ gcloud compute backend-services update $BACKEND --global --timeout=86400 # seconds
Updated [https://www.googleapis.com/compute/v1/projects/xxxxxxxxx/global/backendServices/xxx-xxx-xxxxxx].
Carlos C
  • 101
  • 2