Ali cloud load balancing SLB Comments

SLB concept of
load balancing (Server Load Balancer) is to distribute traffic to multiple back-end cloud server (Elastic Compute Service, referred to as ECS) to distribute traffic control services based forwarding policy.
Load balancing service by providing the virtual service address, located ECS multiple instances of the same virtual region into a high-performance, high-availability application service pool; and then in the manner specified according to the application, network distribution request from the client to the cloud server pool . ECS-oriented load balancing service is a service supporting multi-machine programs, use requires a combination with ECS.
Load balancing state health services will check ECS example cloud server pool, ECS automatically isolated instance of abnormal state, so as to solve the problem of single-point single ECS instance, improving the overall service capacity applications. In addition to the standard load balancing, load balancing service also has characteristics of TCP and HTTP anti-DDoS attacks, and enhance the defense capabilities of application services.
Part
load balancing service consists of three load balancing instance, monitoring and back-end servers.
Load balancing instance (Server Load Balancer Instance)
If you want to use load-balancing service, you must first create an instance of load balancing. A load balancer instance can add more listeners and back-end servers.
Listener (Listener)
before using load balancing service, you must add a listener load balancing instance, specify the rules and listen forwarding, and configure the health check.
For different needs, you can configure separate four (TCP / UDP) or seven (HTTP / HTTPS) listens.
Backend server (the Backend Server)
the ECS example of a set of receiver front-end request. You can add a separate instance of the ECS server pool can also add bulk and manage virtual server group or primary and secondary servers group.
The default backend server is maintained on the instance dimensions, namely load balancing at all listeners instance only be able to forward the request to the same port on the same ECS instance. Virtual Server Group feature enables forwarding listening dimension. You can create different virtual servers for different groups of listeners, ie load balancing instance different listeners can forward the request to a different port on the back-end server.
In addition, seven load balancing service support domain name, URL forwarding policy may be from a different domain name or URL requests forwarded to different back-end server for processing.
Load Balancing (SLB) Using Best Practices:
https://yq.aliyun.com/articles/80055?spm=5176.100240.searchblog.26.3bIToO
load balancing (Ali cloud help and documentation):
HTTPS: //help.aliyun. com / product / 27537.html? spm = 5176.doc27544.3.1.BZgTjy

Infrastructure:
https://help.aliyun.com/document_detail/27544.html?spm=5176.7739444.6.540.BHXBo1

Technical principle:
https://help.aliyun.com/knowledge_detail/39444.html?spm=5176.100239.blogcont80055.19.2Yh1bP
health check principle:
https://help.aliyun.com/knowledge_detail/39455.html?spm=5176.100239 .blogcont80055.20.2Yh1bP

Network traffic Description:
https://help.aliyun.com/knowledge_detail/39440.html?spm=5176.100239.blogcont80055.21.2Yh1bP

Availability Summary Description:
https://help.aliyun.com/knowledge_detail/39449.html?spm=5176.100239.blogcont80055.22.2Yh1bP

key point:

Infrastructure and network traffic patterns, the data packet to

Forwarding policy

Supports TCP / UDP (4 layers), and HTTP / HTTPS (7 layers) the four protocols
Here Insert Picture Description

Infrastructure

Load balancing using cluster deployment, enabling synchronization session to eliminate a single point of server, to enhance redundancy to ensure service stability. Ali cloud currently offers Layer 4 (TCP and UDP) and Layer 7 (HTTP and HTTPS protocol) load balancing service.

4 layers using open source software LVS (Linux Virtual Server) + keep alived way to achieve load balancing, and cloud computing needs was carried out in accordance with custom.

7 Tengine layer using load balancing. Tengine is sponsored by the Taobao Web server project, it's on the basis of Nginx, the demand for large traffic to your site, add a lot of advanced features and characteristics.

As shown below, each of the four local load balancing is actually deployed by LVS machine into a plurality of clusters to run LVS using cluster deployment mode great load balancing to ensure the availability of services under abnormal conditions, stability scalability.

Here Insert Picture Description

Network traffic path
for network traffic load balancing policy based forwarding is arranged on the console user API, or request access from the front end of the forward and treatment. Data stream as shown below.

Here Insert Picture Description

The cloud server (Elastic Compute Service, abbreviated ECS) is a simple and efficient processing capability of computing services elastically stretchable

Client IP address the access load balancing instance, examples related requests by the corresponding load balancing LVS clustering.

Each node in a server cluster LVS sharing request from the front end.

If the corresponding instance of the service load balancing using the four-port protocol (TCP or the UDP), then each node within the cluster load balancing policy LVS load balancing according to an example, which is carried by the service request directly to the backend policy distribution ECS server, while maintaining the session keeping and other characteristics.

If the respective load balancing service instance port seven HTTP protocol is used, then the first node of each cluster LVS its bearer service request to the average cluster Tengine; then, each node within the cluster and then according to a load balancing Tengine strategy, service request as final distribution policy to the back-end server ECS, while maintaining the characteristics of the session and remain so on.

If the corresponding is seven HTTPS protocol, and the HTTP processing process is similar, the difference is in accordance with the policy before the final distribution service requests to back-end server load balancing instance ECS service port to use, it will first call the Key Server certificate validation and data pre-packet decryption operations.

Examples of service port load balancing: multiple ports, different ports using different protocols? Distribution agreement by package type?
The network traffic path
between the load balancer and the rear end of the ECS communicate using the network, so that, under normal circumstances, the rear end load balancing ECS need to configure the external network bandwidth. If you have a business while providing the backend ECS external services, or back-end access network ECS external demand, then, in the back-end bandwidth of the public network ECS purchased after the back-end network flow path ECS is different.

Technical principles

Load balancing the entire system consists of three parts: four load balancing, load balancing, and seven control system.

Four load balancing

Using open source software LVS (Linux Virtual Server) to build, and cloud computing needs based on its customization and optimization.

Seven load balancing

Tengine constructed using open source software.

Control System

Load balancing is used to configure and monitor the system.
Here Insert Picture Description

Four seven load balancing load balancing VS: https://yq.aliyun.com/articles/24248

Select Forward Strategy

It represents a relative weight proportion of traffic carried by a respective server, rather than absolute values. Currently supports three SLB forwarding policy, the use of scenarios and points are as follows:

Forwarding instructions algorithm Points

Here Insert Picture Description
Example: Suppose there are 100 new connection, in different scheduling algorithms allocate different server connections schematically as follows:

Here Insert Picture Description
Myth: SLB's VIP configuration can ping it shows a normal
user to determine the effectiveness of services by SLB SLB VIP address of ping.

In fact, this test is not very reliable. Because SLB ping response is done directly to the server, regardless of the rear end of the ECS. Therefore, under normal circumstances:

As long as the configuration of any listener, even if the appropriate monitor is in an abnormal state, SLB VIP ping is normal.
On the contrary, if the SLB is not configured any listening its VIP ping is not true.
Recommendation: For 4-layer service; for Layer 7 services, usability testing actual business access.

Technical limitations: https://yq.aliyun.com/articles/80055?spm=5176.100240.searchblog.26.3bIToO

SLB also gradually increase and improve the technical level, as of this writing, there are technical limitations as follows:

Layer 4 (TCP protocol) service, does not support adding into the back-end cloud server pool ECS both as Real Server, send a request to the SLB instances where another as the client. Because the return packets only within the cloud server forwards, not through load balancing, configure to access its VIP is unreasonable in the ECS SLB backend.
Only supports TCP / UDP (4 layers), and HTTP / HTTPS (7 layers) the four protocols.
ECS supports only the back-end server does not support third-party cloud server.
Only support polling (RR), weighted round-robin (WRR) and the minimum weighted (the WLC) which is connected in 3 scheduling algorithm.
It does not support SSL Session timeout adjustment layer 7. The current global unified 300s.
Adjusting the timeout does not support layer 7 HTTP Keep-alive. Currently configured as 15s.
Note: If a client access using HTTP listener SLB long connection, then this connection the longest idle time is 15 seconds, i.e., if more than 15 seconds did not send any HTTP request, this connection will be disconnected SLB active. If your business may appear more than 15 seconds of idle necessary to detect disconnected from the operational level and re-initiate the connection.
Does not support forwarding timeout adjustments:
the current configuration: TCP 900s, UDP 300s, HTTP 60s, HTTPS 60s
above configuration refers to the SLB server receives data from the backend and timeout forward, not health check timeout interval. If the timeout, often returned to the client 504 error code.
SLB financial cloud-based security reasons, only allow certain ports open: 80,443,2800-3300,6000-10000,13000-14000

Health Check: https://help.aliyun.com/knowledge_detail/39455.html?spm=5176.100239.blogcont80055.20.2Yh1bP

ECS to determine the back-end load balancing service availability through health checks. When you turn on the health check function, when the rear end of a table ECS health check abnormal, load balancing automatically distributes new requests to other health checks on normal ECS; and when the ECS resume normal operation, load balancing, it will automatic return to service of the external or internal.

Load balancing health check mechanism to improve the overall usability of the front-end business, to avoid the impact on overall back-end services ECS exception.

If you have a business health check-load detection with high sensitivity and a high frequency of access might affect the normal course of business. You can combine business case, by reducing the frequency of health checks, increase the health check interval, seven check revised to four checks, etc., to reduce the impact on the business. But in order to guarantee continuous availability of business, not the proposed closure of health checks.

Published 80 original articles · won praise 140 · views 640 000 +

Guess you like

Origin blog.csdn.net/linjpg/article/details/98481182