Proxy Server Pre-Connected TCP Connections Reduce Latency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Establishing TCP connections between a proxy server and destination hosts is time-consuming due to the three-way handshake process, leading to latency issues, and pre-connecting to all possible destinations is impractical due to resource constraints and connection expiration.
Innovation Solution
Implementing a mechanism to preemptively establish TCP connections based on historical data, where the proxy server connects only to the most frequently requested destinations, optimizing the number of pre-connected connections and maintaining them for a short duration to reduce resource usage and prevent involuntary disconnects.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If TCP connections are established on-demand between proxy server and destination hosts, then resource usage is minimized, but connection establishment latency increases due to three-way handshake
Solution Approach 1:
The system performs preliminary actions by preemptively establishing TCP connections to frequently accessed destination hosts before actual user requests arrive. The proxy server identifies popular destinations based on historical data and pre-creates connections to them, so when a user requests access to these destinations, the connection is already established and ready for immediate use, eliminating the three-way handshake latency.
Solution Approach 2:
Instead of pre-connecting to all possible destinations (excessive action), the system applies partial action by selectively pre-connecting only to frequently accessed destinations identified through historical analysis. This partial pre-connection approach optimizes the balance between reducing latency for common destinations and conserving proxy server resources by not maintaining connections to rarely accessed destinations.
2Reliability
If pre-computed TCP connections are maintained for extended periods, then connection availability improves, but resource consumption and connection expiration issues increase
Solution Approach 1:
The system implements dynamic connection management where the proxy server continuously monitors connection status, usage patterns, and expiration times. Connections are dynamically maintained only as long as needed based on actual demand, with the system automatically refreshing or terminating connections based on current conditions rather than using static, fixed-duration connection policies.
Solution Approach 2:
The system changes connection parameters such as timeout values, refresh intervals, and maintenance priorities based on destination popularity and usage patterns. Frequently accessed destinations receive longer connection lifetimes and priority refreshes, while less frequently accessed destinations have shorter lifetimes, optimizing the balance between connection availability and resource consumption.
Data Source
Figure 1
Figure 2
Figure 3A
AI summary
In some embodiments, a computer-implemented method comprises: receiving, at a proxy server, a plurality of active communications connection counts of a plurality of active communications connections that were active within a time period; determining a top count of active communications connections selected from the plurality of active communications connection counts; for each count of the top counts of active communications connections: determining a relative percentage of pre-connected communications connections, having a particular connection type and included in the count, to be pre-connected by the proxy server and available; determining whether the relative percentage of the pre-connected communications connections of the particular connection type is already pre-connected by the proxy server and is available; and if not, pre-connecting one or more particular communications connections of the particular connection type until the relative percentage of the pre-connected communications connections of the particular connection type is pre-connected and available.