In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to analyze the load balancing function in the principle of Istio traffic governance, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Traffic governance is a very broad topic, such as:
Dynamically modify the load balancing policy for inter-service access, such as session persistence according to a request characteristic
There are two versions of the same service online to cut part of the traffic to a certain version.
Protect services, such as limiting the number of concurrent connections, limiting the number of requests, isolating failed service instances, etc.
Dynamically modify the contents of the service, or simulate a service failure, and so on.
There is no need to modify the code of any application when implementing these service governance functions in Istio. Compared with the SDK mode of micro-service, Istio provides these functions to users in a more lightweight and transparent way. Users can develop in any language and framework they like and focus on their own business without embedding any governance logic. These governance capabilities can be used as long as the application runs on Istio's infrastructure.
In a word, summarize the goal of Istio traffic governance: to provide users with non-intrusive traffic governance capabilities in the way of infrastructure, users only need to pay attention to their own business logic development, without paying attention to service access management.
The summary process of Istio traffic governance is shown in figure 1:
Figure 1. Summary flow of Istio traffic governance
In the control area, it will go through the following process:
(1) administrators create traffic rules through the command line or API
(2) Pilot converts traffic rules to the standard format of Envoy
(3) Pilot issues the rules to Envoy.
On the data side, it will go through the following process:
(1) Envoy intercepts Inbound traffic and Outbound traffic from local containers on Pod
(2) execute the corresponding traffic rules when the traffic passes through the Envoy to govern the traffic.
Load balancing
Let's take a look at the load balancing function provided by Istio in traffic governance.
Strictly speaking, load balancer should not be regarded as a governance capability, because it only does the basic work of mutual access between services. When the service caller initiates access using a service name, it can find an appropriate backend to direct the traffic.
As shown in figure 2, traditional load balancers are generally provided on the server side. For example, when visiting a Web website with a browser or mobile phone, there is usually a load balancer at the entrance of the website to aggregate and forward requests. The virtual IP and back-end instances of the service are generally maintained through static configuration files, and the load balancer ensures that client requests are routed to healthy back-end instances through health checks.
Figure 2 load balancer on the server side
In micro-service scenarios, load balancing is generally used in conjunction with service discovery. Each service has multiple peer service instances, and a mechanism is needed to resolve the requested service name to the service instance address. Service discovery is responsible for parsing a list of service instances from the service name, and the load balancer is responsible for selecting an instance from it.
The workflow of service discovery and load balancing is shown in figure 3. Whether it is the micro-service architecture of SDK or the Service Mesh architecture such as Istio, the workflow of service discovery and load balancing is similar, as follows:
(1) Service registration. Each service registers the corresponding information of the service name and the service instance with the service registry.
(2) Service discovery. When the client initiates service access, the list of instances corresponding to the service is obtained from the service registry synchronously or asynchronously.
(3) load balancing. Select a service instance from the list of instances according to the configured load balancing algorithm.
Figure 3 Workflow of service discovery and load balancing
Load balancing of Istio is one of the specific applications. In Istio, Pilot is responsible for maintaining service discovery data. Figure 4 shows the process of Istio load balancer. Pilot sends the service discovery data to the data side Envoy,Envoy through Envoy's standard interface, and selects an instance to forward the request according to the configured load balancing policy. The main load balancing algorithms currently supported by Istio include polling, random and minimum number of connections algorithms.
Figure 4 flow of Istio load balancing
Kube-proxy, an important component that supports Service on Kubernetes, is actually a network agent and load balancer running on the work node. It implements the Service model and forwards Service access to the backend instance Pod by default, such as polling, as shown in figure 5.
Figure 5 load balancing of Kubernetes
The above content is how to analyze the load balancing function in the principle of Istio traffic governance. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.