0
votes

I've set up a TCP network load balancer, as described here: https://cloud.google.com/load-balancing/docs/network. I need to balance traffic from anywhere on the internet to my backend VMs, running a custom application listening to a non-standard TCP port.

Everything seems to work initially, but after about 10 seconds the connected clients are disconnected, reporting the error "An existing connection was forcibly closed by the remote host.". For debugging I allow my backend VMs to have public IPs and when connecting to any of them directly, bypassing the load balancer, everything works and there's no disconnect.

As I understand it, this load balancer setup I'm using should be pass through: Once the backend VM is selected, the TCP connection should essentially be with the back end VM and the load balancer no longer involved. The backend VMs are certainly not terminating the connection forcibly - as far as the backends are concerned, the connection persists after the client disconnect and time out later. The timeout settings described for other google cloud load balancers don't seem to apply to External TCP/UDP Network Load Balancing.

What am I missing?

1
Have you checked the answer provided by RarrRarrRarrGagandeepT
I have, thank you. I don't understand how any of those conditions would cause the load balancer to terminate my connection so consistently, especially when the backend VM under identical conditions doesn't close the connection.andreasp79

1 Answers

0
votes

TCP/UDP network load balancers are pass-through load balancers and do not proxy connections to your backend instances, so your backends receive the original client request. The network load balancer doesn't do any Transport Layer Security (TLS) offloading or proxying. Traffic is directly routed to your VMs.

  • Confirm that your network load balancer is set up correctly using these steps.
  • Ensure that server software running on your backend VMs is listening on the IP address of the load balancer's forwarding rule.
  • Make sure you’ve configured firewall rules using source IP ranges for Network load balancing health checks.

Additionally, you can capture tcpdump to narrow down your issue, which may provide information to specific resource.