Web site Architecture Load Balancer Author: macaque1101 Published: 2010-09-09 21:21 read: 5,041 recommendations: 1 original link [favorites]Summary:As the main way to improve website performance, load Balancing is adopted by most Web sites, and the classification and characteristics of existing load balancing techniques are summarized in this paper.
Dynamic content can be divided into three categories according to the existence pattern.
First Class: Content for a long time do not need to change, this kind of content is generally through the web static technology, to achieve dynamic content conversion to static content, so as to achieve CDN deployment, typical is the content of the site, such as Sina, Sohu, NetEase and other content publishing system CMS, the content of the deletion and modification of the management work is quasi-real-time synchronization
Type II: Content may change over a short period of time, but will eventually stabilize. such as forums, blogs and other applications, such services provide content in accordance with a certain time interval, to achieve batch static, of course, there are real-time static, like a hodgepodge of mop, NetEase community is the use of such strategies.
Category III: Content changes in real time and is very personal. such as mailbox applications, the content provided by such services is not static, can only be optimized by implementing the means of sub-regional deployment and load balancing.
For the vendor that provides CDN service, the CDN of static content is naturally no problem, and for the third kind of service, it can only be optimized from the communication link layer.
For many sites pseudo-static, some out of SEO considerations, and some for security reasons, the means is basically rewrite Url. It is only a form of external expression, and HTML static is two different things, it is still a dynamic content.
1. Classification of Load Balancing
Load balancing technology is widely used in the process of website operation, and the technology is very mature. Load balancing technology is divided into soft balance and hard balance according to hardware and software form. Soft balance is based on the balance of software technology, hard balance is based on the balance of hardware technology;
According to the network Protocol division is divided into four-layer equilibrium and seven-layer equilibrium. Four-layer equalization is based on the OSI Network layer of data equalization, seven-layer equalization is based on the OSI application layer of data equalization.
Various equalization methods are used in large web sites, and in most cases are combinations of multiple equalization methods.
2. DNS Polling equalization
This way, is more independent of a way, not in the above division, but the use of a wide range, generally used in the forefront of the site. You can do an experiment and run the Nslook command on the DOS command line. For example: nslookup www. 163. COM, you'll see the command gives a bunch of parsed IP addresses. These addresses are the multiple A records that www.163.com this domain name binding. Our access request from the browser http://www.163.com/, then you enter the domain name first need to go through the DNS server to resolve, the DNS server parsing process is in accordance with the order of a records, assigned IP address. The DNS polling method to achieve equalization is to use this principle, under a domain name to bind n IP address, access requests are balanced to different devices. The DNS polling method provides an IP address that is often the address of a cluster in a large web site, possibly a balanced switch or a balanced server. For small sites, there is no problem hooking up multiple servers.
The benefits of DNS polling equalization:
1, 0 Cost: Only in the DNS server binding a few A records, domain name registrars are generally provided;
2, deployment is simple: The network topology for device amplification, and then add records on the DNS server.
Disadvantages of DNS polling equalization:
1, traffic distribution uneven: The DNS parsing process is a lot of, and is a layer of caching mechanism, although your DNS server is updated, but the client, and other DNS servers on the network will not be updated in real-time, so traffic is difficult to guarantee 100% average. At present, the DNS server provides a variety of means to adjust the DNS polling allocation policy, but does not guarantee a perfect balance.
2, Health check: DNS server in a record address of a server down, the DNS server is not known, will still assign access to this server. So people or tools need real-time detection, after a machine down, the backup machine into the production line, if you want to remove an address from a record address, this notification process will take several hours or more to spread to all clients. The way DNS polling is pushed to the front of the service is still very efficient, and it maps access users to different service clusters in the most primitive way. For large Web sites, the IP address of the external service is unlikely to change frequently, and once the backend cluster is down, it can quickly push up the redundant cluster. In addition, it is generally a CDN deployment, services are split into various parts, so in the operation of the process will not have too much impact.
3. OSI seven-layer model
We'll talk about the seven-layer equilibrium next. To understand the principle of 47-layer equalization, first recall the network seven-layer model (OSI) that was studied in the university textbooks.
OSI is an open access System Interconnect Reference Model, which is a well defined protocol specification. The OSI model has 7 layers of structure, each of which can have several sub-tiers.
The OSI seven-layer model is a good theoretical model, but it has been cropped in practical applications. Especially the prevalence of TCP/IP, the 7-storey structure was pressed into 4 layers,
So many people have criticized the OSI seven layer model as overly complex, but as a complete and comprehensive network model, it is well recognized by everyone. The OSI layer 7 from top to bottom are application layer, presentation layer, session layer, Transport layer, network layer, data link layer and physical layer respectively.
7-Layer function Description:
(1) Application layer: An application that communicates with other computers, which is the communication service of the corresponding application. For example, a word processor without a communication function would not be able to execute the code of communication, and the programmer working on the word processing did not care about the 7th layer of the OSI. However, if you add an option to transfer files, the programmer of the word processor will need to implement the 7th layer of the OSI. Example: Telnet,http,ftp,www,nfs,smtp and so on.
(2) Presentation layer: The primary function of this layer is to define the data format and encryption. For example, FTP allows you to choose to transfer in either binary or asii format. If binary is selected, the sender and receiver do not change the contents of the file. If you choose the asii format, the sender will send the text from the sender's character set to the standard asii after the data is sent. The receiver converts the standard asii to the character set of the receiver computer. Example: Encryption, Asii, and so on.
(3) Session Layer: He defines how to start, control, and end a session, including control and management of multiple two-way hours, so that the application can be notified when only part of a continuous message is completed, so that the data that the presentation layer sees is continuous, and in some cases, data represents the presentation layer if all the data is received by the presentation layer Example: Rpc,sql and so on.
(4) Transport layer: the function of this layer includes whether to choose the Error recovery protocol or error-Free recovery protocol, and to reuse the input of the data streams of different applications on the same host, and also to reorder the packets that are received in the wrong order. Example: Tcp,udp,spx.
(5) Network layer: This layer defines the end-to-end packet transfer, which defines the logical address that identifies all the nodes, and defines the way in which the routing is implemented and how it will be learned. To accommodate transmission media with a maximum transmission unit length of less than the packet length, the network layer also defines a segmentation method that decomposes a packet into smaller packets. Example: Ip,ipx and so on.
(6) Data Link layer: He defines how data is transferred on a single link. These protocols are related to the medium of the song being discussed. Example: Atm,fddi and so on.
(7) Physical layer: The OSI Physical layer specification is a characteristic standard for transmission media, and these specifications are often referenced by standards developed by other organizations. Connection head, needle, needle use, current, current, encoding and light modulation are all the contents of various physical layer specifications. The physical layer often uses multiple specifications to complete the definition of all the details. Example: rj45,802.3 and so on.