Total net [/] Load Balancing Load Balancing Overview

A. What is load balancing

Load balancing --load balance, as its name in general, it is to load balancing to the. More simply, it is the original work content to a server, multiple servers to share .

By load balancing, we will be able to expand the bandwidth of our network equipment, will be able to increase our throughput.

(Note that the difference between the bandwidth and throughput: the bandwidth of the link attribute is , throughput is the amount of data transmitted per unit of time within the network device / received, in general we throughput of the network device must be smaller than the bandwidth of our link)

 

II. Load balancing Category

Load balancing There are two main classifications:

· According to using software or hardware load balancing points

  1.  Software : install software load balancing on our server. Common are LVS (Linux Virutal System), Nginx , HAproxy
  2.  Hardware : This looks relatively simple, nothing is krypton gold can not be resolved, it wants us to buy fewer servers.

* According against local or global server to points

  1.  Local : only for the local range of server farms , the advantage is more convenient; for example, you want to add a server on the server farm, just add a server locally on the line.
  2.  Global : global load balancing to address major global users only need a domain name or IP address will be able to access from their nearest server to get the fastest access speed, it has its own multi-server sites in the area.

(Obviously global load balancing to be even better than the local load balancing )

 

III. Load balancing mode

  1.  NAT mode: NAT (Network Address Translation), network address translation, by modifying packets ip, such private ip can access network, so that the user can access the external network ip host private intranet . So we can by nat software (on the switch) to help us select the server to achieve load balancing a.
  2. TUN technology: TUN (ip tunning) ip tunneling. NAT has a big drawback is that the client sends to the server message back to the client and server packets go through my load balancer, so my load balancer can easily become our performance bottleneck . More importantly, our client requests a connection packet size, certainly much smaller than the packet size of our server returned . So we introduced TUN. The advantage of using TUN is only dealing with our client sends a request message to our server connection, as the server to the client to send messages directly through our internet. TUN so we asked our server to connect to our external network.
  3. DR technology: DR technology, i.e., direct routing. This is based TUN technology generated a more good technology. Given that we build ip tunnl is also a great test for the server, so we simply do not build ip tunnl up. Server returned to our users' messages and then forwards it through a router . Note that all of our servers autonomous system (AS) had to use the same VIP (Virtual ip) - reason not to ping your real address in this.

 

IV. Load Balancing Algorithm

  1.  Round robin scheduling algorithm (Round Robin, also called RR) : distribution server in accordance with the polling sequence.
  2. 加权轮询调度(weight round robin,也称wrr):所谓的权重就是当前服务器的性能。这使得我们在轮询的过程中考虑到了服务器的负担,所以比我们普通的轮询更加合理。
  3. 最小连接调度(Least Connections,也称lc):  这里我们也是考虑了服务器的性能,只不过是按照连接数来定,连接少的服务器自然会优先得到任务。
  4. 加权最少连接调度(Weight Least Connections, 也称wlc):凭什么我们需要让连接少的服务器优先连接?万一那个连接数最少的服务器性能本身就最差呢?所以我们引入了一个新的权重。这个权重是由管理员给的,我们负载均衡器在判断的时候还得考虑这个权重。
  5. (To be continued..)

 

发布了137 篇原创文章 · 获赞 19 · 访问量 1万+

Guess you like

Origin blog.csdn.net/qq_43338695/article/details/102964461