Chapter 20 Detailed Explanation of Alibaba Sentinel-Introduction and Download and Installation

Table of contents

First, the basic concepts that need to be understood before learning sentinel

2. Introduction to setinel

Three, setinel features

4. Sentinel's ecosystem

Five, the main features of Sentinel 

6. The difference between Sentinel and Hystrix

Seven, the use of Sentinel can be divided into two parts

1. Download the latest version of the console jar package from the release page

2. Install

3. Run the command

4. Sentinel interface management


First, the basic concepts that need to be understood before learning sentinel

  • Response time (RT)

Response time is the time it takes for the system to respond to a request. Intuitively, this indicator is very consistent with people's subjective feelings about software performance, because it completely records the time for the entire computer system to process requests. Since a system usually provides many functions, and the processing logic of different functions is also very different, the response time of different functions is also different, and even the response time of the same function is different under the condition of different input data. Therefore, when discussing the response time of a system, people usually mean the average time of all functions of the system or the maximum response time of all functions. Of course, it is often necessary to discuss the average response time and maximum response time for each or each group of functions.
  For stand-alone application systems with no concurrent operations, it is generally believed that response time is a reasonable and accurate performance indicator. It should be pointed out that the absolute value of the response time does not directly reflect the performance of the software, and the performance of the software actually depends on the user's acceptance of the response time. For a game software, a response time of less than 100 milliseconds should be good, a response time of about 1 second may be barely acceptable, and a response time of 3 seconds is completely unacceptable. For the compilation system, it may take tens of minutes or even longer to fully compile the source code of a large-scale software, but these response times are acceptable to users.

  • Throughput

Throughput refers to the number of requests processed by the system per unit time. For application systems without concurrency, the throughput is strictly inversely proportional to the response time. In fact, the throughput at this time is the reciprocal of the response time. As mentioned earlier, for a single-user system, response time (or system response time and application delay time) can be a good measure of system performance, but for concurrent systems, throughput is usually used as a performance indicator.
  For a multi-user system, if there is only one user, the average response time of the system is t. When there are n users, the response time seen by each user is usually not n×t, but often faster than n×t t is much smaller (of course, it may be larger than n×t in some special cases, even much larger). This is because processing each request requires a lot of resources, and because there are many steps in the processing of each request that are difficult to execute concurrently, this leads to the fact that at a specific point in time, the resources occupied are often not many. That is to say, when processing a single request, many resources may be idle at each point in time. When processing multiple requests, if the resource allocation is reasonable, the average response time seen by each user does not increase with the number of users. increases linearly. In fact, the average response time of different systems increases at different speeds as the number of users increases, which is also the main reason why throughput is used to measure the performance of concurrent systems. Generally speaking, throughput is a relatively common indicator. If two systems with different numbers of users and user usage patterns have basically the same maximum throughput, it can be judged that the processing capabilities of the two systems are basically the same.

  • concurrent users

The number of concurrent users refers to the number of users who can normally use system functions that the system can carry at the same time. Compared with throughput, the number of concurrent users is a more intuitive but also more general performance indicator. In fact, the number of concurrent users is a very inaccurate indicator, because different usage patterns of users will cause different users to issue different numbers of requests per unit time. Take a website system as an example, assuming that users can only use it after registration, but registered users do not use the website all the time, so only some registered users are online at the same time, and online users will spend a lot of time browsing the website. Time to read the information on the website, so at a specific moment only some online users send requests to the system at the same time. In this way, for the website system, we will have three statistics about the number of users: the number of registered users, the number of online users, and the number of simultaneous requesting users. Since registered users may not log in to the website for a long time, using the number of registered users as a performance indicator will cause a large error. Both the number of online users and the number of colleagues sending requests can be used as performance indicators. In comparison, it is more intuitive to use online users as a performance indicator, and it is more accurate to use the number of simultaneous requesting users as a performance indicator.

  • QPS query rate per second (Query Per Second)

The query rate per second (QPS) is a measure of how much traffic a specific query server handles within a specified time. On the Internet, the performance of a machine as a Domain Name System server is often measured by the query rate per second. Corresponding to fetches/sec, that is, the number of response requests per second, that is, the maximum throughput. (It seems to be similar to TPS, but only the throughput applied to specific scenarios)

2. Introduction to setinel

       Sentinel is an open source project of Ali, which provides multiple dimensions such as flow control, circuit breaker degradation, and system load protection to ensure the stability of services. Official  website: https://github.com/alibaba/Sentinel/wiki

       In 2012, Sentinel was born in Alibaba, and its main goal is traffic control. From 2013 to 2017, Sentinel developed rapidly and became a basic part of all microservices in Alibaba. It has been used in more than 6000 applications, covering almost all core e-commerce scenarios. In 2018, Sentinel evolved into an open source project. In 2020, Sentinel Golang will be released.

Three, setinel features

  • Rich application scenarios: Sentinel has undertaken the core scenarios of Alibaba’s Double Eleven traffic promotion in the past 10 years, such as seckill (that is, burst traffic is controlled within the range that the system capacity can bear), message peak shaving and valley filling, and cluster traffic control , Real-time fusing of downstream unavailable applications, etc.
  • Complete real-time monitoring: Sentinel also provides real-time monitoring functions. In the console, you can see the second-level data of a single machine connected to the application, or even the aggregated running status of a cluster with a scale of less than 500.
  • Extensive open source ecosystem: Sentinel provides out-of-the-box integration modules with other open source frameworks/libraries, such as integration with Spring Cloud, Dubbo, and gRPC. You only need to introduce the corresponding dependencies and perform simple configurations to quickly access Sentinel.
  • Perfect SPI extension point: Sentinel provides easy-to-use and complete SPI extension interface. You can quickly customize the logic by implementing the extension interface. For example, custom rule management, adaptation of dynamic data sources, etc.

4. Sentinel's ecosystem

Five, the main features of Sentinel 

img

6. The difference between Sentinel and Hystrix

       Learn the basic usage of Sentinel, which has many similar functions to Hystrix in many features. For more details see

https://developer.aliyun.com/article/633786

Seven, the use of Sentinel can be divided into two parts

  • Console (Dashboard): The console is mainly responsible for managing push rules, monitoring, cluster current limit allocation management, machine discovery, etc.

  • Core library (Java client): does not depend on any framework/library, can run in the runtime environment of Java 7 and above, and also has good support for frameworks such as Dubbo / Spring Cloud.

8. Download and installation of the management console in Sentinel

 1. Download the latest version of the console jar package from  the release page

       According to the version relationship of Spring Cloud Alibaba components, select the corresponding version sentinel to download .

2. Install

        Where it is placed is equal to where it is installed.

3. Run the command

        The prerequisite environment is that jdk1.8 and port 8080 cannot be occupied. Execute in the cmd window in the current path of the jar

Port 8080 is used by default

java -jar sentinel-dashboard-1.8.3.jar   

or specify the port yourself

java -Dserver.port=8090 -Dcsp.sentinel.dashboard.server=localhost:8090 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard-1.8.3.jar 

4. Sentinel interface management

Chapter 19: Detailed Explanation of Nacos Unified Configuration Center

Chapter 21: Detailed Explanation of Alibaba Sentinel - Application Introductory Case

Guess you like

Origin blog.csdn.net/qq_41946216/article/details/127632897