Most websites now use the Server Load balancer technology, which can improve the stability and traffic distribution of websites and speed up access. Is an evolutionary process, from a single server to multiple servers:
There are many Server Load balancer technologies on the Internet. Here is a reference:
Because the data traffic of the network is mostly concentrated at one end of the central server, load balancing is usually used to balance (or share) the load of the accessed server. Server Load balancer is structured into local Server Load balancer and regional Server Load balancer (Global Server Load balancer, the latter type refers to load balancing between different geographic locations and different networks and Server clusters.
Each host runs a required ServerProgramSuch as web, FTP, telnet, or e-mail server programs. For some services (such as those running on Web servers), a copy of the program runs on all hosts in the cluster, network Load Balancing distributes workloads among these hosts. For other services (such as e-mail), only one host processes the workload. For these services, network load balancing allows the network traffic to flow to one host, when the host fails, the communication volume is moved to another host.
Other references: Network Load Balancing Technology Overview
For large commercial websites, Server Load balancer instances are purchased for Hardware load balancing, such as using DNS and proxy servers. However, due to the constraints on the test environment and the cost, hardware is often unavailable. Generally, dual NICs are used, and the network load Banlancing protocol is installed at the same time. Server Load balancer is implemented using software, and a specified IP address is allocated in the attribute, for example:
In host parameters, you can point to the same host, such as xxx.domain.com. In this way, multiple servers deployed can use one host for access at the same time. Take two machines as an example. Generally, at least four IP addresses are required. Each server has two IP addresses, one for internal use and the other for external display.
The following describes how to test the Web Server Load balancer. Here, the platform uses Windows as an example (others are not familiar with Linux), and the Web is deployed in IIS, there are two servers used in combination for load balancing. The web is developed by Asp.net. Of course, Web is not only the previously mentioned website, but also applicable to the popular webapplication.
The procedure is simple:
1. Start both servers
2. You need to develop a page, such as test. aspx, to display which server is used to access the Web at this time, that is, to display the external IP address of the server, similar:
3. Note that the URL of the host is used to access the Web. For example, my blog oscarxie.cnbologs.com does not use an IP address.
4. Enter host/test. aspx constantly accesses the Web, because the server you access is randomly allocated at this time. Take the two different IP addresses as the standard. For example, the two IP addresses are 192.168.0.1, 192.168.0.2, both IP addresses can be accessed.
5. access the Web again and obtain the server on which it is located. For example, if it is 192.168.0.1, disable 192.168.0.1 server or stop IIS on this server. Then, access the Web again, make sure that no exception occurs and access the test page to check whether the server is switched to 192.168.0.2. This ensures smooth switching through Server Load balancer. (This process can be manual or automated)
Of course, if the web uses a session, it also needs to process the program. For example, the session must exist on two servers and the session is stored, whether it is in the State service or in the DB is not covered in the scope of discussion. Many cool people in the blog Park must have introduced it and will not make an axe in this class.
Another advantage of Server Load balancer is that when the web is in the real environment, you do not have to stop the web when deploying a new project online. You can disable the server one by one for deployment without affecting the normal use of the web, you only need to ensure that there is another server running.