Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Micro-service governance and statistical analysis

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Reprint this article need to indicate the source: Wechat official account EAWorld, violators will be prosecuted.

Introduction:

Under the micro-service architecture, the finer the service is divided, the smaller the granularity of the service is, the better the assemblability is; the invocation relationship between the opposite services will become more complex, in order to ensure the better operation of the service, these services need to be monitored and managed. This article introduces the management of log viewing, API call statistics, current limit, circuit breaker and load balancing for EOS micro-service platform.

Table of contents:

Brief introduction of 1.EOS Micro Service platform

two。 Microservice monitoring statistics

3. Micro-service governance

Brief introduction of 1.EOS Micro Service platform

1. A domain is a general term for a group of systems in a platform, which is usually defined as a domain with business meaning, such as a credit domain. There are multiple systems in a domain, and a system can only belong to one domain. A domain can log center, registry center, configuration center, APM monitoring center has been circuit breaker monitoring center

2. A system is a general term for a group of applications in the platform, which is usually defined as a system with business meaning, such as a credit system. A system has multiple applications, and an application can only belong to one system.

3. Applications (micro-service applications) are the basic deployment units developed by the platform. An application can only belong to one system, and an application has one or more application instance groups.

4. The application instance group is the instance grouping of the application in the platform. Each application can have one or more application instance grouping. Different application instance groups have independent application configuration and management capabilities. Different application instance groups can use flow control strategy to achieve the grayscale publishing ability of the application. There are several application instances under the application instance group.

5. The application instance is the process of actually deploying the application under the platform, and the application instance belongs to a certain application instance group.

two。 Microservice monitoring statistics 1. Application monitoring

Through application monitoring, you can view the call relationship between applications in a system. Average response time, average throughput, and slow endpoint access for a single application.

2. Instance monitoring

You can view the operation of an instance through instance monitoring, including average throughput, average response time, CPU, memory and SQL execution. 3. Request monitoring

Request monitoring allows you to see whether a request is successful or wrong, its response time, and its calling link: what the time spent within each microservice is after several microservices. 4. API call statistics

API call statistics can summarize request information by application, instance group, instance and API, including response status code, number of requests, minimum response time, maximum response time, aPCge response time and sum of response time. Query by application, instance group, instance, API, time period and sorting by number of requests and response time are supported. 5. View the application log

The application log aggregates the logs of multiple application instances for unified viewing. Query filtering by instance and time period is supported when viewing. Request tracking numbers such as traceId and spanId are included in the application log. 3. Micro-service governance 1. By setting the status of the instance, the instance will not be called by other applications. This is implemented on the client side, which uses ribbon for load balancing, and ribbon will filter out service provider instances with a status of OUT_OF_SERVICE. 2. API online and offline sets the status of API so that API will not be called by other applications. This is implemented on the server side, by adding a Filter interceptor on the server side to request access to the offline API and return the status code of 403. 3. Fuse break

The circuit breaker implementation of EOS uses Hystrix, which sets the circuit breaker by configuring the circuit breaker object and trigger conditions on the page. The fuse object corresponds to the CommandKey of Hystrix, and the trigger conditions include:

Manual fuse (force fuse on)

Cancel the fuse (force off the fuse)

Automatic circuit breaker (only when the number of requests exceeds the threshold within a specified period of time and the failure rate reaches the threshold, the circuit breaker will be triggered and an attempt will be made to cancel the circuit breaker within a specified time after the circuit breaker)

This configuration can be dynamically configured by writing it to the configuration center and delegating it to each application in time. 4. The current current limit of current-limiting EOS is calculated independently for each application instance. If you set 10 visits per second and an application has 3 instances, each of the three instances is allowed to access 10 times per second. Current limiting is achieved by using Guava's RateLimiter in the Filter of the server. This configuration can be dynamically configured by writing it to the configuration center and delegating it to each application in time. 5. The load balancer of EOS uses Ribbon implementation, which can set rule types for each target client, such as random, loop, custom, etc., and also supports fault tolerance, which refers to the remedial measures when the call to an instance times out:

Quick failure (Failfast): do nothing but throw an exception

Failed automatic switching (Failover): attempts to access a new instance for a specified number of times

Retry in place (Failback): try to access the same instance for a specified number of times

This configuration can be dynamically configured by writing it to the configuration center and delegating it to each application in time. The above to share with you Puyuan EOS 8 micro-service platform governance and statistical analysis, I hope to help you. Please correct the inadequacies.

Selected questions:

Q1: do you want to restart the application when the configuration takes effect? What is the real-time performance of log statistics?

A: the configuration can be hot updated and there is no need to restart the application. API statistics are not based on log analysis and can be obtained directly from each instance.

Q2: what are the underlying technologies of the EOS micro-service platform? How much does it cost for our company to buy this system?

A: Spring Cloud,Apollo,SkyWalking,ELK is mainly used. You can call 400820-5821 for product consultation and details.

Question 3: what is the nature of micro-service governance? apart from circuit breakers and current restrictions, what else does micro-service governance include, especially in what aspects are the security of micro-services?

Answer: I feel that governance is still to ensure the normal and smooth operation of the business system. It's just that under the micro-service architecture, there are more processes, more interactions, complex management, and abnormal errors can be easily magnified. In addition to circuit breakers and current restrictions, such as instance online and offline, unified configuration, traffic management, application grouping (multi-version), etc. We are now doing authentication on the gateway, and each system has a gateway. The external interface of the system needs to be published on the gateway first, and the interface needs to be authorized to specify which clients can call and issue the authorization code.

Q4: in the security control of data sharing, how to control the security of unstructured data resources, such as image maps, and how to control access permissions and security by geographical area?

A: in the security control of data sharing, it is difficult to control the unstructured data resources such as image maps in terms of content. You can configure the corresponding relationship between geographical area identification and service, and the relationship between geographical area IP and service pair, and control it from the perspective of service access.

About the author: Wang Wenbin, Puyuan senior software engineer, open source technology enthusiast, container technology expert, has participated in Pudong Development Bank BPM project, UnionPay PAASV1 and other projects.

About EAWorld: micro services, DevOps, data governance, mobile architecture original technology sharing.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report