-
I have a blazor server. Blazor Server by default opens a web socket through SignalR for each user, for its functionality to operate. Without a load balancer I have a theoretical limit of 65k concurrent users as the websocket connects to each server port. But having a server that serves as a load balancer, I can increase the theoretical limit by splitting the connections between servers through the server that balances the load with YARP. My question is, does Yarp directly bridge between my client and server in websocket calls, or is it possible to do so? Because if don't, I understand that everyone who connects to the load balancer will consume a port from the load balancer server, which in turn will broker the connection to the backend, tying my application to the server's port limit that does load balancing. So if I have 3 servers, instead of having 65k x3 connections, I will only have 65k. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This is backwards. TCP connections are identified by Client IP + Port + Server IP + Port. A client uses unique client ports for each connection to the server, but the server uses the same port for all incoming connections. As such, a client is limited to 65k outbound connections to the same server IP + Port, but a server is not limited to 65k inbound connections from different clients. Adding a proxy/load balancer actually makes the situation worse because the proxy becomes the client to the server and can only open 65k outbound connections to that server. |
Beta Was this translation helpful? Give feedback.
This is backwards. TCP connections are identified by Client IP + Port + Server IP + Port. A client uses unique client ports for each connection to the server, but the server uses the same port for all incoming connections. As such, a client is limited to 65k outbound connections to the same server IP + Port, but a server is not limited to 65k inbound connections from different clients.
Adding a proxy/load balancer actually makes the situation worse because the proxy becomes the client to the server and can only open 65k outbound connections to that server.