This article from: http://www.cnblogs.com/heartstill/archive/2011/09/28/2194601.html
This content involves development tools development methods development process Architecture Application layering examples of common web functions and precautions
Performance bottleneck expansion and some solutions are proposed. Finally, performance monitoring methods are also involved.
Extended Web Applications
I. Concepts
Simply put, if a system is scalable, You can provide system performance through expansion. This means that the system can accommodate a higher load, a larger number of episodes, and the system is maintainable. Extensions are irrelevant to languages and specific technologies. There are two types of extensions:
1. Vertical Scaling (stade up), generally speaking, improves the performance of a single machine, such as adding memory and replacing a stronger processor.
2. horizontal scaling (out), generally speaking, is to add new machines.
Comparison shows that horizontal scaling has more powerful scalability than vertical scaling, which can be said to be "unlimited". After all, the performance of a single machine is always limited, the development of hardware technology cannot keep up with the development of Web. However, horizontal scaling also brings higher maintenance costs. In reality, it is necessary to seek a balance point based on the specific circumstances of the root play.
Ii. Redundancy
The machine may always fail, and the only way to ensure that the service is still available under the fault is to back up multiple hardware. Backup can be divided into hot backup and cold backup. The difference between hot backup and cold backup is whether the service is online or not. For example, shutting down the MySQL server and copying a number of drama files to the backup location is a typical cold backup behavior.
Iii. Server Load balancer
After we used horizontal scaling, we began to consider new issues. How can we "balance" a large number of requests to our scaling machines?
Two Load Balancing modes: stateful (if session is carried) and stateless
Two Load Balancing Methods: hardware balancing and software balancing
Hardware balancing is relatively simple. Generally, a device can be connected, and subsequent balancing and fault detection are automatically completed by the hardware. High cost.
Software balancing forwards various requests through software, which makes it easier to define forwarding rules and has many open-source product options.
Layer 4 and Layer 7
The terms Layer 4 and Layer 7 are often seen in Server Load balancer. They actually refer to the number of layers (using the ISO model) of the network protocols they process when they work ).
The fourth layer is the data transmission layer, including TCP and UDP, and the seventh layer is the application layer, which is usually an HTTP application on the web. For example, Apache and nginx support layer-7 Server Load balancer, which is highly configurable and can be used for complex applications. For example, you can simply share the traffic to each of the load machines, you can also define a set of business rules, the application is divided into different pools, each pool handles some fixed rules
URL.
Compared with software and hardware balancing, We can find their respective advantages and disadvantages:
1. Hardware balancing costs are relatively high. Most software balancing systems can be implemented using free open-source software.
2. Hardware balancing is much larger and faster than software balancing in fault detection. When using hardware balancing, once a machine fails, it can be detected immediately and immediately blocked.
3. Hardware balancing allows you to quickly add machines (access the hardware interface). In addition to adding machines, software balancing also adds configuration information to import certain traffic to new machines.
4. Software balancing can define very complex business rules, while hardware balancing is relatively weak in this respect.
5. Most hardware balancing solutions are bundled with some additional services, such as HTTPS acceleration and DOS firewall.
There is also a popular solution: DNS resolution. This method has a good effect on the distribution of users in different geographical locations and networks. Each user can get a fast IP address through their own network. The disadvantage is also obvious: the DNS update is slow, which has little effect on real-time balancing, because the DNS update usually takes one or two hours or even one or two days.
Iv. Use Cache
Using Cache to cache some service results that do not have high real-time requirements is a consensus of the Solutions for large applications. The rational use of cache will greatly improve the application experience and performance.
Common cache types:
Cache number drama: memcached memcachedb
Cache HTTP Request: squid
User browser cache
This content involves development tools development methods development process Architecture Application layering examples of common web functions and precautions
Performance bottleneck expansion and some solutions are proposed. Finally, performance monitoring methods are also involved.
Extended Web Applications
I. Concepts
Simply put, if a system is scalable, You can provide system performance through expansion. This means that the system can accommodate a higher load, a larger number of episodes, and the system is maintainable. Extensions are irrelevant to languages and specific technologies. There are two types of extensions:
1. Vertical Scaling (stade up), generally speaking, improves the performance of a single machine, such as adding memory and replacing a stronger processor.
2. horizontal scaling (out), generally speaking, is to add new machines.
Comparison shows that horizontal scaling has more powerful scalability than vertical scaling, which can be said to be "unlimited". After all, the performance of a single machine is always limited, the development of hardware technology cannot keep up with the development of Web. However, horizontal scaling also brings higher maintenance costs. In reality, it is necessary to seek a balance point based on the specific circumstances of the root play.
Ii. Redundancy
The machine may always fail, and the only way to ensure that the service is still available under the fault is to back up multiple hardware. Backup can be divided into hot backup and cold backup. The difference between hot backup and cold backup is whether the service is online or not. For example, shutting down the MySQL server and copying a number of drama files to the backup location is a typical cold backup behavior.
Iii. Server Load balancer
After we used horizontal scaling, we began to consider new issues. How can we "balance" a large number of requests to our scaling machines?
Two Load Balancing modes: stateful (if session is carried) and stateless
Two Load Balancing Methods: hardware balancing and software balancing
Hardware balancing is relatively simple. Generally, a device can be connected, and subsequent balancing and fault detection are automatically completed by the hardware. High cost.
Software balancing forwards various requests through software, which makes it easier to define forwarding rules and has many open-source product options.
Layer 4 and Layer 7
The terms Layer 4 and Layer 7 are often seen in Server Load balancer. They actually refer to the number of layers (using the ISO model) of the network protocols they process when they work ).
The fourth layer is the data transmission layer, including TCP and UDP, and the seventh layer is the application layer, which is usually an HTTP application on the web. For example, Apache and nginx support layer-7 Server Load balancer, which is highly configurable and can be used for complex applications. For example, you can simply share the traffic to each of the load machines, you can also define a set of business rules, the application is divided into different pools, each pool handles some fixed rules
URL.
Compared with software and hardware balancing, We can find their respective advantages and disadvantages:
1. Hardware balancing costs are relatively high. Most software balancing systems can be implemented using free open-source software.
2. Hardware balancing is much larger and faster than software balancing in fault detection. When using hardware balancing, once a machine fails, it can be detected immediately and immediately blocked.
3. Hardware balancing allows you to quickly add machines (access the hardware interface). In addition to adding machines, software balancing also adds configuration information to import certain traffic to new machines.
4. Software balancing can define very complex business rules, while hardware balancing is relatively weak in this respect.
5. Most hardware balancing solutions are bundled with some additional services, such as HTTPS acceleration and DOS firewall.
There is also a popular solution: DNS resolution. This method has a good effect on the distribution of users in different geographical locations and networks. Each user can get a fast IP address through their own network. The disadvantage is also obvious: the DNS update is slow, which has little effect on real-time balancing, because the DNS update usually takes one or two hours or even one or two days.
Iv. Use Cache
Using Cache to cache some service results that do not have high real-time requirements is a consensus of the Solutions for large applications. The rational use of cache will greatly improve the application experience and performance.
Common cache types:
Cache number drama: memcached memcachedb
Cache HTTP Request: squid
User browser cache