Which algorithm is recommended for SSE or WebSocket workloads?

Test your Systems Design Concepts knowledge with our comprehensive quiz. Utilize flashcards and multiple choice questions to enhance your study session. Prepare thoroughly with detailed explanations for each answer and ace your examination!

Multiple Choice

Which algorithm is recommended for SSE or WebSocket workloads?

Explanation:
When dealing with SSE or WebSocket, connections stay open for long periods, so the load a backend bears depends on how many active connections it currently handles, not just how many requests it has seen. A load balancer that uses the Least Connections strategy routes each new connection to the backend with the fewest active connections, keeping the overall load balanced as connections persist and new ones arrive. This dynamic awareness is crucial for long-lived connections, preventing a server that already has many active ties from becoming a bottleneck. Other approaches have drawbacks in this scenario. Round Robin distributes connections evenly without regard to real-time load, which can lead to some servers becoming overloaded while others are underutilized. Hash-based routing fixes a client to a specific backend, causing potential imbalance if traffic patterns are skewed. Weighted Round Robin uses fixed weights and doesn’t adapt to current server load, so it can miss sudden changes in how many long-lived connections each server is actually handling. Least Connections directly targets the real-time burden on each server, making it the best fit for SSE and WebSocket workloads.

When dealing with SSE or WebSocket, connections stay open for long periods, so the load a backend bears depends on how many active connections it currently handles, not just how many requests it has seen. A load balancer that uses the Least Connections strategy routes each new connection to the backend with the fewest active connections, keeping the overall load balanced as connections persist and new ones arrive. This dynamic awareness is crucial for long-lived connections, preventing a server that already has many active ties from becoming a bottleneck.

Other approaches have drawbacks in this scenario. Round Robin distributes connections evenly without regard to real-time load, which can lead to some servers becoming overloaded while others are underutilized. Hash-based routing fixes a client to a specific backend, causing potential imbalance if traffic patterns are skewed. Weighted Round Robin uses fixed weights and doesn’t adapt to current server load, so it can miss sudden changes in how many long-lived connections each server is actually handling. Least Connections directly targets the real-time burden on each server, making it the best fit for SSE and WebSocket workloads.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy