In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you the exploration and practice of ServiceMesh. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Before the maturity of the ServiceMesh scheme, we use: call each middleware client SO library (class JNI) through the extension of Dart Cplink +. This scheme solves the problem of ecological construction of Dart server very well at the initial stage of business. However, there are still the following problems in the scheme:
High coupling between operation and maintenance. The business code and the client SO library code are packaged together and run in the same process. Once the micro-service framework needs to be upgraded, the business code also needs to be maintained and restarted.
Complexity: multiple language environments in the process, cross-language data representation and transmission and other problems will increase the complexity of the system and reduce the performance of the original services.
High access cost
New features lag
ServiceMesh because of some problems in the existing scheme, we turned to ServiceMesh to find a way to solve the problem.
As shown in the figure above: compared with the current common micro-service framework, ServiceMesh separates the core functions of the micro-service client and deploys it as an independent Proxy process on each host, and the business process communicates with the outside world through the Proxy process. This stand-alone Proxy process is the core of ServiceMesh: SideCar.
The two most common communication schemes between business processes and SideCar: 1. Traffic interception and forwarding scheme based on Iptables, 2. The business process connects directly to the SideCar through a lightweight Mesh client. From the point of view of the implementation principle, the Iptables scheme will have some performance loss and delay compared with the directly connected scheme. The ALiMesh scheme we chose uses a lightweight Mesh client scheme.
After Mesh, the business process only contains business code and lightweight Mesh Client, which makes the code logic simpler and the problem location clearer. Business students can focus more on business development rather than on the complex logic of micro-services. The development, maintenance, expansion and upgrade of the core functions of the micro-service framework are carried out by a special Mesh team, which is independently upgraded and maintained, decoupled from the business and unaware of the business.
The ServiceMesh solution solves the existing problems of operation and maintenance cost, access cost and code complexity. And the use of open source Mesh program, but also with the help of open source power, continue to add new functions.
AliMesh
With the introduction of SideCar, the intra-process communication between business and micro-services has been transformed into inter-process communication, and the incoming and outgoing traffic has been increased by a hop, so what is the impact of the introduction of ServiceMesh on business performance? Next, let's take a look at the situation based on ALiMesh (Ali version of Istio open source solution).
ALiMesh provides two access schemes: Http mode and HSF mode. Http mode is divided into Http1.0 mode and Http2.0 mode.
AliMesh http solution (Fast access)
As shown in the figure, in Http mode: on the data side, the Http protocol is used between the business process and SideCar,SideCar and Service Provider, and the data is encoded by Json. The business process integrates Mesh Client,Mesh SideCar based on Http protocol to invoke Java HSF services remotely through generalized invocation.
In the control plane: the ISTIO control plane synchronizes the service provider list data of ConfigServer, and SideCar and ISTIO pilot take the original service synchronization channel.
Due to the versatility of the Http protocol, the scheme is easy to access and quickly verifies the feasibility of the Mesh scheme, but the performance can not meet the online requirements of the service. After testing, the main indicators are as follows:
Note: at present, Xianyu only uses ServiceMesh OutBound function. In order to simulate the real traffic on the online details page, the downstream Java HSF service is called 21 times for each upstream request processing, so when QPS is converted into Mesh traffic in the figure, it needs to be multiplied by 21 times, as is the case in the following tests.
As shown in the figure: compared with the directly connected mode, the CPU consumption on the Consumer side of Mesh mode is doubled, and each time RPC calls RT increases nearly 2ms. And the CPU on the HSF Provider side also increased by nearly 40%, which is basically consistent with the test results of HSF students. After analysis, we initially locate that the main reasons for the increase in CPU consumption are the connection mode of Http1.1 protocol (connection pooling has been used) and data coding.
In order to verify the problem of this scheme, we test the access to the Http2.0 scheme. Compared with Http1.x, Http2.0 has natural advantages in connection multiplexing, data format, head compression and so on. After testing, the performance of ALiMesh has also been greatly improved compared with Http1.x. Partially meet or approach our technical requirements. The detailed metrics are shown in the following figure:
As shown in the figure, after optimization, the CPU and RT consumption on the Consumer side of the business process slightly exceeds the standard (CPU increases by no more than 20%). In order to explore a solution with higher performance and lower latency, we turned to the HSF private protocol scheme.
AliMesh HSF extension Protocol Scheme (High performance)
As shown in the figure, under the HSF scheme, the HSF RPC protocol is implemented as an extension of Mesh SideCar. On the data side, HSF 2.0 private protocol is adopted between business process and SideCar,SideCar and Service Provider, and Hessian 1.0 is used for data coding. The business process integrates the meshized HSFCPP SO library as MeshClient, which is responsible for communicating with Mesh SideCar. On the control side, SideCar is directly connected to Configsvr, synchronizing the list of service providers and configuration information, and using differential synchronization to reduce the CPU consumption of the control panel. The detailed test data are as follows:
After continuous optimization, the growth of Mesh CPU is controlled within 20%, and the increase of RT per hop of RPC calls is controlled within 1ms.
The landing of ServiceMesh at Xianyu
At present, the Dart+ALiMesh solution has been running steadily on Xianyu's server for eight months +, serving Xianyu's details page, guessing what you like, rental home page and other businesses. During this period, Mesh has repeatedly carried out operation and maintenance work such as optimization, upgrade, expansion of functions, etc., without feeling the business process, providing services normally, and business students do not need to participate.
The impact on online business RT after the introduction of ALiMesh is shown in the following figure: the orange curve is the business RT monitoring curve after Mesh, and the blue curve is the business RT monitoring curve in the week before Mesh. After excluding the daily fluctuations in the online environment, the impact of the introduction of ALiMesh on online business RT is quite small.
Said that at the end,
ServiceMesh scheme decouples micro-service logic and business-to-service communication from business applications, slimming business applications and making business students more focused on business development. At the same time, it also enables heterogeneous languages to establish server-side ecology at low cost and access existing systems.
Of course, for the performance loss, I think the overall advantages outweigh the disadvantages. The business team can test and evaluate according to the actual situation of its own business and weigh the pros and cons of whether to connect to ServiceMesh.
Next, we will further expand the application of AliMesh in Xianyu, and cooperate with ALiMesh to promote the landing of AliMesh in Dart Faas and adapt to more middleware.
The above content is the exploration and practice of ServiceMesh. Have you learned any 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.