Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ipvsadm

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "use of ipvsadm", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "the use of ipvsadm" bar!

For more technical details on LVS, please refer to the LVS home page:

Http://www.LinuxVirtualServer.org/

Http://www.linux-vs.org/

Here is a brief introduction to three forwarding methods and eight scheduling algorithms

Three packet forwarding methods of LVS--

LVS provides three packet forwarding methods: NAT (Network address Mapping), IP Tunneling (IP Tunnel), and Direct Routing (Direct routing). Different forwarding modes determine the network structure of different cluster. Here are three forwarding methods:

NAT (Network address Mapping)

NAT can support any operating system, as well as private networks, and only one Internet IP address is needed, but the performance of the whole system is limited. Because every time you need to rewrite the package in the execution of NAT, there is a certain delay; in addition, 80% of the data in most applications flows from the server to the client, that is, the user's request is very short, and the response of the server is very large, which creates a lot of pressure on the load balancer and becomes a new bottleneck.

IP Tunneling (IP Tunnel)

Director assigns requests to different real server. The real server responds directly to the user after processing the request, so the director load balancer handles only half of the connection between the client and the server. IP Tunneling technology not only greatly improves the scheduling capacity of director, but also greatly increases the maximum number of nodes that the system can hold, which can be more than 100nodes. Real server can run on any LAN or WAN, which means allowing geographical distribution, which is important in disaster recovery. The server must have a formal IP address for direct communication with the client, and all servers must support the IP tunneling protocol.

Direct Routing (direct routing)

Similar to IP Tunneling, the load balancer handles only half of the connections, avoiding new performance bottlenecks and increasing the scalability of the system. Compared with IP Tunneling, Direct Routing does not have the overhead of IP encapsulation, but due to the use of physical layer (modify MAC address) technology, all servers must be on a physical network segment.

Eight scheduling algorithms for LVS

LVS has implemented the following eight scheduling algorithms:

* rr polling (Round Robin)

Through the "round call" scheduling algorithm, the scheduler distributes external requests sequentially to the real servers in the cluster, and it treats each server equally, regardless of the actual number of connections and system load on the server.

* wrr weighted polling (Weighted Round Robin)

The scheduler schedules access requests according to the different processing capacity of the real server through the "weighted round call" scheduling algorithm. This ensures that powerful servers handle more access traffic. The scheduler can automatically inquire about the load of the real server and adjust its weight dynamically.

* minimum lc links (Least Connections)

The scheduler dynamically schedules network requests to the server with the least number of established links through the least connection scheduling algorithm. If the real server of the cluster system has similar system performance, the load can be better balanced by using the "minimum connection" scheduling algorithm.

* wlc weighted minimum links (Weighted Least Connections)

When the performance of the servers in the cluster system varies greatly, the scheduler uses the "weighted least link" scheduling algorithm to optimize the load balancing performance, and the servers with higher weights will bear a larger proportion of the active connection load. The scheduler can automatically inquire about the load of the real server and adjust its weight dynamically.

* lblc locality-based minimum links (Locality-Based Least Connections)

The "locality-based least link" scheduling algorithm is a load balancing for target IP addresses, which is mainly used in Cache cluster systems at present. The algorithm finds out the server recently used by the target IP address according to the requested target IP address, and sends the request to the server if the server is available and not overloaded; if the server does not exist, or if the server is overloaded and has half of the workload, then use the principle of "least links" to select an available server and send the request to the server.

* locality-based minimum links (Locality-Based Least Connections with Replication) for lblcr with replication

The "locality-based least link with replication" scheduling algorithm is also a load balancing for target IP addresses, and is currently mainly used in Cache cluster systems. It differs from the LBLC algorithm in that it maintains a mapping from a destination IP address to a set of servers, while the LBLC algorithm maintains a mapping from a destination IP address to a server. The algorithm finds the server group corresponding to the target IP address according to the requested target IP address, and selects a server from the server group according to the principle of "minimum connection". If the server is not overloaded, the request is sent to the server. If the server is overloaded, a server is selected from the cluster according to the "minimum connection" principle, the server is added to the server group, and the request is sent to the server. At the same time, when the server group has not been modified for some time, the busiest server is removed from the server group to reduce the degree of replication.

* dh destination address hash (Destination Hashing)

The "destination address hash" scheduling algorithm finds the corresponding server from the statically assigned hash table as a hash key (Hash Key) according to the target IP address of the request, and sends the request to the server if the server is available and not overloaded, otherwise it returns empty.

* sh source address hash (Source Hashing)

The "source address hash" scheduling algorithm finds the corresponding server from the statically assigned hash table as a hash key (Hash Key) according to the requested source IP address, and sends the request to the server if the server is available and not overloaded, otherwise it returns empty.

Thank you for your reading, the above is the content of "the use of ipvsadm", after the study of this article, I believe you have a deeper understanding of the use of ipvsadm, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report