Dynamic Port Assignment for WebSocket High Availability
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing network systems face challenges with High Availability (HA) scenarios due to static port assignment, leading to system failures and restarts when port changes occur, especially in load-balanced environments with multiple WebSocket applications, where dynamic port assignment is critical but often results in traffic redirection issues.
Innovation Solution
Implementing a dynamic port assignment system through configuration rewrite, where a listener application notifies and updates reverse proxies across nodes to redirect traffic to active ports, ensuring seamless communication even when ports change due to node failures, using a network-level listener to manage port reassignments and maintain system stability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If static port assignment is used, then system stability is maintained, but High Availability is compromised when node failures occur
Solution Approach 1:
The system implements dynamic port assignment where ports are not statically bound to specific nodes but are dynamically allocated from an available pool. When a node fails, the load balancer automatically reassigns its ports to remaining healthy nodes without requiring system restarts, thereby maintaining High Availability while managing complexity through automated orchestration
Solution Approach 2:
The system changes the port assignment parameter from static to dynamic. Ports are drawn from an available port pool and assigned to nodes based on current system state. When node failures occur, the port assignment parameter is automatically updated to redirect traffic to healthy nodes, eliminating the need for manual intervention and system restarts
2Adaptability or versatility
If ports are dynamically assigned, then adaptability to node failures is improved, but traffic redirection issues arise
Solution Approach 1:
The load balancer continuously monitors node health status and receives feedback about node failures. When a node is detected as unhealthy, the system automatically triggers port reassignment and traffic redirection to healthy nodes. This closed-loop feedback mechanism ensures seamless adaptability while maintaining ease of operation through automated response
Solution Approach 2:
The load balancer acts as an intermediary between clients and backend nodes. It absorbs the complexity of port management and traffic redirection, presenting a stable interface to clients while dynamically routing requests to appropriate healthy nodes. This intermediary role simplifies operation by shielding clients from port changes while maintaining high adaptability
3Reliability
If multiple web servers are implemented to combat failures, then system reliability is improved, but the number of ports in use increases causing management issues
Solution Approach 1:
The available port pool serves multiple functions: it provides ports for initial node assignment, supports dynamic reassignment during failures, and enables load distribution across multiple nodes. This universal port management mechanism handles all port allocation needs across the expanded server infrastructure, maintaining reliability while managing complexity through a unified approach
Solution Approach 2:
The system manages the increasing number of ports by changing from static assignment to dynamic assignment with an available port pool. This parameter change enables efficient allocation and reuse of ports across multiple web servers, reducing the total number of simultaneously active ports while maintaining system reliability through automated failover capabilities
Data Source
AI summary
A system provides a listener application which can be notified about specific ports used by specific instances of a WebSocket application. A WebSocket application opens multiple dynamic ports in certain scenarios with a dynamic context. When an application is executed, a listener application is made aware of the context and port information. A system rewrites a reverse proxy configuration on the fly so that any request coming into the reverse proxy will read the change and assign the correct port. A notification to the listener is received across multiple nodes, and the configuration can be updated on all nodes based on the data provided in the configuration.


