Four common methods for server load balancing in enterprises
In order to improve the performance and workload of the server, enterprises usually use the technology of DNS server, network address translation and so on to realize multi-server load balancing, especially the Internet web sites of enterprises outside, many of which are through several servers to complete server access load balance.
At present, the so-called "load balancer Server" used by enterprises, it is a kind of control server of application system, the request of all users is first to this server, then this server assigns the request to an actual processing server according to the state of each actual processing server. The domain name and IP address that are publicly available are this server. Load balancing control and management software installed on this server, this server is generally only load balancing task allocation, but not the actual server processing network requests.
First, the enterprise to achieve Web server load Balancing
In order to distribute the load evenly to multiple servers on the inside, a certain load balancing policy needs to be applied. The server load Balancer device realizes the dynamic load balancing of each server group and provides redundant backup for each other. and requires a certain degree of scalability of the new system, such as data traffic continues to increase, you can add new servers to join the load balancer system.
For Web service applications, several machines are available, and the state of each machine can be set to either regular (normal operation) or backup (backup state), or to regular state at the same time. The load balancer device determines the server to which the next user's request will be redirected, based on the load algorithm that the administrator has set beforehand and the actual dynamic load on the current network. And all this is completely transparent to the user, the user completes the request to the Web service, and does not care about the specific server to complete.
Second, using network address translation to achieve multi-server load Balancing
Address translation gateways that support load balancing can map an external IP address to multiple internal IP addresses, and dynamically use one of the internal addresses for each TCP connection request for load balancing purposes. Many hardware vendors integrate this technology into their switches as a function of their fourth exchange, typically using random selection, load balancing policies based on the number of connections or response times of the server to distribute the load. However, hardware-implemented load controller flexibility is not strong, can not support a more optimized load balancing strategy and more complex application protocols.
The load balancer based on network address translation can effectively solve the CPU and disk I/O load on the server side, however, the performance of the load balancer is limited by network I/O and has certain bandwidth limitation under certain hardware conditions, but it can improve the algorithm and improve the hardware performance of the Load Balancer program. To increase this bandwidth limit. Different service types occupy different server resources, and the load measurement policy we use is evaluated using the same load, which is appropriate for most conditions, but the best approach is to monitor the server load separately for different resources, such as CPU, disk I/O, or network I/O, etc. The most appropriate server is selected by the central controller to distribute customer requests.
Third, using DNS server to achieve load balancing
Access to the Enterprise network server users sharply increased, a server is difficult to meet the needs of users access, then how to ensure that the user's normal access? There are a number of workarounds, such as using Windows 2000 or Windows Server 2003 to provide Network Load balancing services, However, the settings for this service are very complex. The Network Load balancing through DNS server is a relatively simple method.
The enterprise network is usually made up of many subnets, in order to reduce the data traffic in the network, the client should be able to access the Web server in the same subnet. Although Network Load Balancing is implemented, it is not guaranteed that the client is accessing the Web server of the subnet. In fact, this problem is also very good to solve, as long as the DNS server to enable the "Enable netmask sorting" feature. In the DNS Manager window, right-click on the DNS server, select "Properties" in the pop-up menu, then switch to the "Advanced" tab in the Properties dialog box, and tick the "Enable netmask sorting" option in the "Server Options" list box. This allows the client to access the Web server in the subnet every time. After completing the above setup, the DNS server realizes the Network Load Balancing function, the customer's access is shared to each Web server, and the network traffic across the subnets is reduced, which greatly reduces the communication burden of the enterprise network.
IV. Enterprise Implementation of SQL Server database server load Balancing
MS SQL Server database server can be said to be the most widely used database product, and increasingly in large and more critical applications to provide services. When the enterprise application is more and more complex, the data volume is more and more big, the SQL Server database should keep processing, storing, querying, this time the enterprise should consider the SQL Server database server performance and speed and security. However, for a long time, the SQL Server database server has only a "hot standby" solution and no "load balancing" and "cluster" solutions.
With the advent of the database router software icx, a better clustering solution is provided for the MS SQL Server based database system. It can really realize the dynamic load balance of SQL Server database server, improve performance and speed, it can really guarantee the SQL Server database server uninterrupted service, in the event of a server failure in real-time switch to other servers to continue to provide services, switching time is "0". The database router is a real-time concurrent database transaction that synchronizes XXX and the load balancer.
All database clients access the database through ICX. When accessing and querying the SQL Server database, ICX can allocate servers according to the actual situation to provide services, greatly improve service speed and optimize performance, complete load balancing. ICx can connect multiple databases at the same time, and the content of several databases is fully consistent with the ICX guarantee at any time. That is, ICx uses a new way of concurrent transactions to replicate transactions to a connected n-database, allowing the system to have multiple, consistent, up-to-date logical database datasets at any point in time. When one of the database servers fails, the ICX can move on to the other servers in real time and in the first place to continue serving. Real implementation of zero-time server switchover, greatly improve security, the real meaning of the implementation of server uninterrupted service.
Principle:
Load Balancing distributes each IP packet to a server node according to a certain rule, and different load balancing implementations have different distribution rules. The load-balancing system is transparent to the client. Services that use Network Load Balancing technology respond to a single client request and are faster than a single host, but dense requests to a large number of clients have a great advantage in speed and quality. And when a host fails or goes offline, it does not affect the delivery of the service, resulting in high availability.
Different implementation methods of load balancing
4.1 Load balancing with dynamic network address translation (NAT) capabilities for network devices
Requirements for load Balancing:
A router with dynamic NAT function, multiple servers running the same service, all servers are required to be in the same LAN.
Load balancing design and configuration process:
Internal multiple servers, have their own private IP, provide the same service, but the external mapping through the network address translation (NAT) become a unified public IP address, to the outside, more than one server is bundled together a virtual server, external access to this virtual server, in turn point to each server, Thus achieving load balancing.
For example, the following network
The router dynamic NAT configuration process is as follows: (with Cisco routers as an example)
Router (config) #int F0/1
Router (config-if) #ip address 192.168.1.1 255.255.255.0
Router (config-if) #ip nat inside
Router (config-if) #int s0/0
Router (config-if) #ip address 133.0.0.1 255.255.255.252
Router (config-if) IP nat outside
Router (config-if) #exit
Router (config) #ip nat pool P2 192.168.1.2 192.168.1.4 netmask 255.255.
255.0 Type rotary
Router (config) #access-list 2 Permit 133.0.0.33
Router (config) #ip nat inside Destination List 2 pool P2
Router (config) #ip Route 0.0.0.0 0.0.0.0 s0/0
Advantages, Disadvantages: Simple configuration, low cost, server is easy to maintain locally, load balancing algorithm is provided by the router, do not need to occupy the server system resources. But generally only support the algorithm of rotation service, can not be based on server performance reasonable load distribution.
4.2 DNS Load-balancing implementation
Requirements for load Balancing:
Requires support for DNS servers, generally supports UNIX-like systems above bind8.2, and installs a cyclic multiplexing DNS software.
Load balancing design and configuration process: Configure the same name for multiple addresses in DNS, so the client querying the name will get one of the addresses, allowing different clients to access different servers to achieve load balancing. The configuration process has different configuration methods in different DNS systems, which are no longer described in this article.
Advantages, Disadvantages: The server can be distributed in different regions, facilitate the failover. The load balancing algorithm runs on the DNS server and does not occupy server resources.
But the domain name server does not know whether the service node is valid, if the service node fails, the domain Name System will still resolve the domain name to the node, resulting in user access failure. In addition, it does not differentiate between server performance and the current running state of the server. As a result, dynamic DNS polling is not ideal for dynamically balancing features.
4.3 Load balancing with the cluster capabilities of the operating system
Requirements for load Balancing:
Requires the use of cluster-enabled operating systems such as: Windows 2000server or more server versions, UNIX or Linux. This article takes windows2003 server as an example to describe the configuration of cluster functionality.
Load balancing design and configuration process: the implementation of a cluster requires intra-cluster communication and data transfer for management and content replication. This part of the communication takes up the available bandwidth of the network. In order to overcome the limitations of the single network card, generally use a dual network card, one for the load client communication, the other for the transmission of internal communications, management and content data.
The choice of cluster operation mode is an important step in the design. Unicast mode refers to the network adapter of each node being re-assigned a virtual Mac (consisting of 02-BF and cluster IP addresses to ensure the uniqueness of this Mac). In multicast mode, the network adapter also assigns a multicast MAC address shared by each node while preserving the original MAC address. Multicast mode is generally selected.
Port rules are a new feature of windows2003. NLB provides 3 filtering modes, which can be used for prohibit, multi-host load balancing, and special handling of single hosts for port rules. The multi-host filtering mode provides a real load balance, and the load allocation can be based on the actual processing capacity of the node.
WINDOWS2003 introduces a Network Load Balancing Manager (Control Panel, management tools) to make load balancing installation and configuration easier. Managers can easily implement cluster creation, deletion, node additions, deletions, modifications, and fault detection.
Run Network Load Balancing Manager, select New from cluster, pop up the cluster Parameters dialog box, and then configure it as needed according to the wizard.
First configure the parameters and click Next, you will be prompted to add additional cluster IP, if you do not need to directly press "next" Port configuration. Take the Web cluster configuration as an example: if session state is not saved on the cluster, the similarity selection is none, otherwise single or Class C is selected.
After that, specify a host connection and select an available network interface for the settings of the host parameters: Click "Finish" and the manager will automatically connect to the host to make the configuration to create a new cluster.
Advantages, Disadvantages: The choice of multi-host filtering mode provides a true sense of load balancing, and can be based on the actual processing capacity of the node load allocation. Compare the implementation for large Web site load balancing. However, when using UNIX, the Windows 2003 Server system is implemented with higher network architecture costs.
Knowledge of how server load balancing is implemented between servers