Large Web site Architecture series: Load Balancing detailed (2)

Source: Internet
Author: User

This article is the first article on load Balancing, which describes IP load balancing, link-layer load balancing, and hybrid p-load balancing. Part of the content is excerpted from reading notes.

1.3 IP Load Balancing

The network layer is load balanced by modifying the request destination address.

After the user requests the packet, arrives at the Load Balancer server, the Load Balancer server obtains the network packet in the operating system kernel process, obtains a real server address according to the load balancing algorithm, then modifies the request destination address to, obtains the real IP address, does not need passes through the user process processing.

After the real server processing is completed, the response packet goes back to the Load Balancer server, the Load Balancer server, and then modifies the packet source address to its own IP address, which is sent to the user's browser. Such as:

IP load Balancing, the real physical server is returned to the Load Balancer server, there are two ways: (1) The Load Balancer server modifies the destination IP address while modifying the source address. Set the packet source address to its own disk, which is the source address translation (Snat). (2) The Load Balancer server acts as a gateway server for the real physical server cluster.

Advantages:

(1) It is better to distribute the data in kernel process than in the application layer;

Disadvantages:

(2) All request responses need to go through the Load Balancer server, the maximum throughput of the cluster is limited by the bandwidth of Load balancer server NIC;

2.4 Link Layer Load Balancing

The data link layer of the communication protocol modifies the MAC address for load balancing.

Data distribution, do not modify the IP address, refers to the modification of the target MAC address, configure the real physical server cluster all machine virtual IP and Load Balancer server IP address consistent, to not modify the source address and destination address of the packet, for data distribution purposes.

The actual processing server IP and data request destination IP consistent, do not need to go through the Load Balancer Server for address translation, the response packet can be directly returned to the user browser, to avoid load Balancing server network card bandwidth becomes a bottleneck. Also known as Direct route mode (DR Mode). Such as:

Advantages: good performance;

Cons: Complex configuration;

Practice Recommendation: Dr Mode is currently the most widely used load balancing method.

2.5 Mixed-load balancing

Due to the differences in hardware devices, sizes, and services provided in multiple server farms, it is possible to consider the most appropriate load balancing method for each server farm. Then again load-balancing or clustering among the multiple server farms to provide services to the outside world (i.e., as a new server farm) for optimal performance. This approach is called hybrid load balancing.

This approach is sometimes used in situations where the performance of a single equalization device does not satisfy a large number of connection requests. is currently a large-scale Internet company, commonly used in the way.

Way one, such as:

The above pattern is suitable for the scene with static and dynamic separation, and the reverse proxy server (cluster) can play the role of caching and dynamically requesting distribution, when the static resource is cached on the proxy server, it is returned directly to the browser. If the dynamic page requests a later application load balancer (application cluster).

Mode two, such as:

Above mode, suitable for dynamic request scene.

Because of the mixed mode, according to the specific scene, flexible collocation of various ways, the above two methods for reference only.

Large Web site Architecture series: Load Balancing detailed (2)

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.