What is the maximum number of connections that an IP can establish?

Source: Internet
Author: User
Tags netscaler

Before discussing this issue, let's assume a classic connection model:
Client-> Load balancer-> RealServer pool

In addition, we assume that the NAT mode is used for load balancing. In this mode:

1. The Server Load balancer only leaves the client with one public IP address (VIP );
2. Requests sent from the client are intercepted by the Server Load balancer and then forwarded to a server in the RealServer pool through the scheduling algorithm;
3. These realservers are in a private network and are invisible to the outside world;
4. when the Server Load balancer forwards requests to the Real Server (RealServer), it performs Nat at the same time. The connections seen by the Real Server are all from the Server Load balancer (with the real server in a private network IP address ).

First, we analyze the following from the client side (client-> Load balancer:
All connections at this end are uniquely identified by sourceip: souceport-> desip: desport, so for us, the number of connections supported is limited by the memory size of the Server Load balancer (the number of connections can be more than 65000), because desip and desport are known to be unique (such as IP: 80 ).

Then, analyze the data from server side (Load balancer-> RealServer:
The number of connections at this end is the opposite. Each connection is identified by the IP address (MIP: mapped IP) of the Server Load balancer and a random port. That is, MIP: randomport-> realserverip: 80
In this way, because the Server Load balancer port is also limited by the maximum number of TCP/IP Ports 64 K (65536), you can only establish a server connection (server connnections) of up to 64 K ).

Due to the bottleneck, server connections may occur. In this case, how do Server Load balancer manufacturers solve this problem?
1. NetScaler
First, let's look at the NetScaler solution. The NetScaler solution is very simple. by increasing the number of MIP, the maximum number of server connections will change:
Maxserverconnections = 65536 * MIP count

2. F5
F5 actually uses the same method, but F5 first creates a source-Nat pool, and then adds multiple IP addresses to the SNAT pool. The maximum number of connections is exactly the same as that of NetScaler:
Sa: sP-> da: DP
10.1.1.1: 1024-> 10.1.1.100: 80
10.1.1.2: 1024-> 10.1.1.100: 80
PS: Both 10.1.1.1 and 10.1.1.2 are in an SNAT pool.

The above are all theoretical values. The maximum number of connections in the real environment is also limited by various factors:
1. Each connection consumes a certain amount of resources, such as CPU and mem. Therefore, the actual value is often difficult to reach the theoretical value;
2. the maximum number of connections that can be reached varies according to the protocol. For example, the creation and closure of HTTP/1.0 connections are fast, and the browser limits the number of concurrent connections, it is difficult to reach the maximum theoretical value. HTTP/1.1 supports streamline technology. Multiple requests can reuse one connection, which greatly reduces the number of concurrent connections. FTP or Telnet connections are persistent connections, which can easily reach the maximum value;
3. many devices (such as NetScaler) support connection pools (connection multiplexing) on the server side, and the connections in it are persistent connections, which also implement the streamline Technology in HTTP/1.1, one connection can process multiple client connections. This not only reduces connection resources, but also reduces other resource overhead of the Server Load balancer and Intranet bandwidth;
4. some devices (such as NetScaler's TCP-OFFLOAD) support TCP uninstallation and only send established connections to the server side, while TCP's three handshakes are completely taken over by the Load balancer, server connections are multiplied.

 

Transferred from: http://www.tektea.com/archives/4140.html, Tea session

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.