Redis cluster operation quality automatic evaluation method, system and device
By automatically evaluating the operation quality of the Redis cluster and monitoring abnormal requests and access behaviors, the problem of insufficient monitoring of high-level access behavior of the Redis cluster in the existing technology is solved, and the reliability and user experience of the Redis cluster are improved.
Patent Information
- Application Number
- CN202311459526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2043-11-03
AI Technical Summary
Existing Redis monitoring tools cannot effectively monitor the high-level access behavior of Redis clusters, resulting in the inability to improve the high reliability of Redis, which is prone to business abnormalities or performance degradation due to large number of requests being passed to the database, affecting the user experience.
It provides an automatic evaluation method for the operation quality of Redis cluster. By analyzing Redis configuration, determining service types and visits, combining access traffic information of the business system, monitoring abnormal requests, and improving the reliability of the Redis cluster. The method includes parsing data packets, recording timestamps and source information, summarizing access traffic information, filtering hotkeys, determining abnormal access behavior, and demonstrating operation quality through topology diagrams.
It realizes multi-faceted operation quality monitoring of the Redis cluster, improves the reliability of the Redis cluster, can promptly discover and solve potential problems, avoid business failures, and improve user experience.
Smart Images

Figure CN117453508B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system and device for automatically evaluating the operation quality of a Redis cluster. Background Art
[0002] Redis is widely used in database front-end cache services due to its high performance based on memory operations. To ensure its reliability, the industry has successively generated more requirements for Redis, including but not limited to multi-active instances and data, data loss prevention, and high performance assurance. When these requirements cannot be met, it is easy for a large number of requests to be passed to the database, resulting in business anomalies or reduced business performance, further leading to an increase in user operation failure rate, reduced user experience, or business failure. The Redis monitoring tools in related technologies mainly perform regular sampling and analysis on the operating indicators of a single Redis instance, and cannot monitor higher-level access behaviors, and thus cannot improve the high reliability of Redis. Summary of the invention
[0003] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0004] To this end, the purpose of the present invention is to provide a highly reliable Redis cluster operation quality automatic evaluation method, system and device.
[0005] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0006] On the one hand, an embodiment of the present invention provides a method for automatically evaluating the operation quality of a Redis cluster, comprising the following steps:
[0007] The automatic evaluation method of the Redis cluster operation quality of the embodiment of the present invention comprises: parsing the configuration of Redis, determining the service type of Redis, and determining the access volume and performance of the Redis cluster; determining the portrait of the Redis cluster operation quality according to the service type, access volume and performance; reading the data packet of the business system accessing Redis, and determining the access flow information of the business system in combination with the portrait; monitoring the operation quality of the Redis cluster according to the access flow information, determining the abnormal business access behavior with abnormal requests, and evaluating and displaying the monitoring results and the abnormal business access behavior. The embodiment of the present application can monitor the operation quality of the Redis cluster in many aspects and improve the reliability of the Redis cluster by determining the portraits of various Redis clusters and monitoring the cluster operation quality and abnormal access behavior through the portraits and access data packets.
[0008] In addition, the automatic evaluation method for Redis cluster operation quality according to the above embodiment of the present invention may also have the following additional technical features:
[0009] Furthermore, the automatic evaluation method for the operation quality of a Redis cluster according to an embodiment of the present invention, wherein the data packet of the business system accessing Redis is read, and the access flow information of the business system is determined in combination with the portrait, comprises:
[0010] Record the timestamp, source information and destination information of each data packet, parse the data packet, and determine the key value and business instance of the operation;
[0011] The timestamp, the source end information, the destination end information, the key value and the business instance are aggregated into a message queue to determine access traffic information.
[0012] Furthermore, in one embodiment of the present invention, monitoring the operation quality of the Redis cluster according to the access traffic information includes:
[0013] Based on the first access volume accumulated for each key value in memory, the key values are sorted from large to small or from small to large according to the first access volume, and hot keys are screened out according to the sorting result; and the corresponding Redis cluster and abnormal business access behavior are determined according to the hot keys;
[0014] Alternatively, based on the source information and the destination information, determine the usage of the Redis cluster by the business system; if different business systems share the same Redis cluster, confirm whether the same key value exists in the different business systems, and record the occupancy of the cache by each business system;
[0015] Alternatively, if the same key value exists in different Redis clusters, determine whether the key value belongs to the same project according to the source information, and record the changes of the key value in different Redis clusters;
[0016] Alternatively, obtain a second access volume difference between a first instance and a second instance of a first Redis cluster; obtain an average of single-instance access volumes in the first Redis cluster; determine a first proportion based on a quotient of the second access volume difference and the average of single-instance access volumes; if the first proportion is greater than a first threshold, filter and record relevant key values and instances.
[0017] Further, in one embodiment of the present invention, determining the profile of the Redis cluster operation quality according to the service type, access volume and performance includes the following steps:
[0018] Access Redis multiple times through read-only operations and read-write operations, determine the access volume, performance and storage consumption based on the responses, and determine a portrait of the operating quality of the Redis cluster;
[0019] If a response error is detected, the corresponding Redis cluster, access volume, and memory usage are recorded;
[0020] Determine the support capacity of each Redis service; the support capacity includes the access volume and data size that can be processed;
[0021] Comparative monitoring of the Redis cluster is performed based on the supported amount, the performance, and the storage consumption to determine abnormal deployment configurations;
[0022] If the data corresponding to the abnormal deployment and configuration is inconsistent with the data of the current deployment and configuration, the portrait is updated.
[0023] Furthermore, in one embodiment of the present invention, the method further comprises:
[0024] Determine visitor information or instance information of the Redis cluster in combination with the portrait; data flows between the instance information and the Redis cluster;
[0025] The visitor information and the instance information are taken as the first type of nodes, and Redis is taken as the second type of node, a topology map is established, and the topology map is displayed.
[0026] Furthermore, in one embodiment of the present invention, the method further comprises:
[0027] Determine the access request of the business system according to the data packet, and cache the access request to obtain cache data;
[0028] If the Redis instance is not running normally, the Redis service is downgraded according to the cached data;
[0029] Filter and block abnormal requests according to the access request or source information;
[0030] According to the access traffic information, penetration and avalanche processing are performed on the cache.
[0031] Furthermore, in one embodiment of the present invention, the method further comprises:
[0032] If the access request is a cache read request, read the first data from the cache according to the key value, and send a first response by simulating a failed Redis instance through a network device of the server;
[0033] Alternatively, if the access request is a write cache operation, wait for the Redis instance to recover;
[0034] Alternatively, if the access request is a write cache operation, the write cache operation is forwarded to the current Redis instance for processing.
[0035] On the other hand, an embodiment of the present invention proposes a Redis cluster operation quality automatic evaluation system, including:
[0036] The first module is used to parse the Redis configuration, determine the Redis service type, and determine the access volume and performance of the Redis cluster;
[0037] The second module is used to determine the profile of the Redis cluster operation quality according to the service type, access volume and performance;
[0038] The third module is used to read the data packets of the business system accessing Redis, and determine the access flow information of the business system in combination with the portrait;
[0039] The fourth module is used to monitor the operation quality of the Redis cluster according to the access traffic information, determine abnormal business access behaviors with abnormal requests, and evaluate and display the monitoring results and the abnormal business access behaviors.
[0040] On the other hand, an embodiment of the present invention provides a device for automatically evaluating the operation quality of a Redis cluster, comprising:
[0041] at least one processor;
[0042] at least one memory for storing at least one program;
[0043] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned Redis cluster operation quality automatic evaluation method.
[0044] On the other hand, an embodiment of the present invention provides a storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned method for automatically evaluating the operation quality of a Redis cluster.
[0045] The embodiment of the present invention provides a method for automatically evaluating the operation quality of a Redis cluster, the method comprising: parsing the configuration of Redis to determine the service type of Redis; determining the access volume and performance of the Redis cluster; determining a portrait of the operation quality of the Redis cluster based on the service type, access volume and performance; reading a data packet of a business system accessing Redis, and determining the access flow information of the business system in combination with the portrait; monitoring the operation quality of the Redis cluster based on the access flow information, determining abnormal business access behaviors with abnormal requests, and evaluating and displaying the monitoring results and the abnormal business access behaviors. The embodiment of the present application can monitor the operation quality of the Redis cluster in many aspects and improve the reliability of the Redis cluster by determining the portraits of various types of Redis clusters and monitoring the operation quality and abnormal access behaviors of the clusters through the portraits and access data packets. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the embodiments of the present invention or the drawings of related technical solutions in the prior art are introduced below. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 A flow chart of an embodiment of a method for automatically evaluating the operation quality of a Redis cluster provided by the present invention;
[0048] Figure 2 A schematic diagram of an interface of an embodiment of the automatic evaluation result of the Redis cluster operation quality provided by the present invention;
[0049] Figure 3 A schematic diagram of an interface of another embodiment of the automatic evaluation result of the Redis cluster operation quality provided by the present invention;
[0050] Figure 4 A flow chart of another embodiment of the method for automatically evaluating the operation quality of a Redis cluster provided by the present invention;
[0051] Figure 5 A flowchart of an embodiment of the process of realizing automatic portrait provided by the present invention;
[0052] Figure 6 A schematic diagram of an interface of an embodiment of a topology diagram provided by the present invention;
[0053] Figure 7 A schematic diagram of a flow chart of an embodiment of a service degradation process provided by the present invention;
[0054] Figure 8 A schematic diagram of an implementation environment of an embodiment of the automatic evaluation method for Redis cluster operation quality provided by the present invention;
[0055] Fig. 9 A schematic diagram of the structure of an embodiment of the automatic evaluation system for Redis cluster operation quality provided by the present invention;
[0056] Fig.10 A schematic diagram of the structure of an embodiment of the automatic evaluation device for Redis cluster operation quality provided by the present invention;
[0057] Fig.11 A structural schematic diagram of another embodiment of the automatic evaluation device for Redis cluster operation quality provided by the present invention. DETAILED DESCRIPTION
[0058] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0059] Redis is widely used in database front-end cache services due to its high performance based on memory operations. To ensure its reliability, the industry has generated more requirements for Redis, including but not limited to multi-active instances and data, data loss prevention, high performance assurance, etc. If these requirements cannot be met, it is easy for a large number of requests to be passed to the database, resulting in business anomalies or reduced business performance, further leading to an increase in user operation failure rate, reduced user experience or business failure.
[0060] The current Redis monitoring tool, redis_exporter based on prometheus, provides the most abundant indicators, but technically it mainly focuses on the timed sampling and analysis of the operating indicators of a single Redis instance, and cannot detect the improper operating status of Redis at a higher level, such as the Redis cluster and the access of the business system to Redis. As the business continues to microservice, the calls between businesses and the use of related cache data are becoming more and more complex, and the impact of problems caused by the operation quality of Redis is also increasing. How to discover and promptly and effectively solve the reliability, performance and operation problems of Redis services in advance from the aspects of business and Redis cluster has become one of the key factors to ensure the normal operation and development of Internet business.
[0061] In the related technology, the health of Redis is calculated according to the set weights based on the obtained monitoring indicator values, and then the monitoring status of the Redis service at different levels is determined based on the calculation results and different levels of alarms are implemented. This type of solution cannot monitor improper data and improper access stored in Redis, and can only passively provide limited reference information for troubleshooting after Redis service problems occur, and cannot alleviate or reduce the impact of Redis service failures. Therefore, related issues need to be solved urgently.
[0062] The following describes in detail the method, system and device for automatically evaluating the operation quality of a Redis cluster proposed in an embodiment of the present invention with reference to the accompanying drawings. First, the method for automatically evaluating the operation quality of a Redis cluster proposed in an embodiment of the present invention will be described with reference to the accompanying drawings.
[0063] Reference Figure 1 In an embodiment of the present invention, a method for automatically evaluating the operation quality of a Redis cluster is provided. The method for automatically evaluating the operation quality of a Redis cluster in an embodiment of the present invention can be applied to a terminal or a server, or can be software running in a terminal or a server. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The method for automatically evaluating the operation quality of a Redis cluster in an embodiment of the present invention mainly includes the following steps:
[0064] S100: parsing the configuration of Redis, determining the service type of Redis, and determining the access volume and performance of the Redis cluster;
[0065] S200: Determine the profile of the Redis cluster operation quality based on the service type, access volume, and performance;
[0066] S300: Read the data packets of the business system accessing Redis, and determine the access flow information of the business system based on the profile;
[0067] S400: Monitor the operation quality of the Redis cluster according to the access traffic information, determine abnormal business access behaviors with abnormal requests, and evaluate and display the monitoring results and abnormal business access behaviors.
[0068] In some possible implementations, the embodiment of the present application determines the portrait of the running quality of the Redis cluster by automatically discovering the Redis service and its type and automatically evaluating the access volume and performance, and then monitors the running quality of the Redis cluster according to the portrait information and the access information of the business system. Specifically, the embodiment of the present application identifies the RESP protocol of Redis, determines the server and port where the Redis service is located, and then queries the process on the port from the corresponding server to obtain the Redis process information, the configuration file used and its address, and obtain the configuration of Redis. That is, the embodiment of the present application obtains the current network Redis service information and its storage, concurrency, and access performance portraits through the automatic discovery and capacity evaluation of Redis services; the embodiment of the present application realizes automatic monitoring of the running quality of Redis services and access behavior analysis: all requests, responses and corresponding performance, success rate, and data expiration time are obtained through the access traffic of Redis, and further performance indicators other than the Redis monitoring of prometheus are obtained, including hot keys, large keys and related client sources, slow performance access volume, memory growth rate, etc.; further comprehensive analysis finds improper or abnormal access to all Redis instances and displays and alarms them.
[0069] It can be understood that the embodiments of the present application can also improve the reliability of Redis services by supporting Redis traffic operations, including filtering illegal requests, banning Redis clients from specified sources, synchronizing data between different Redis services, and replying to clients with pre-stored data based on traffic interception in the event of a failure, thereby assisting in achieving Redis service degradation during failures and avoiding complete failures.
[0070] Reference Figure 2 An embodiment shown in FIG. 1 is evaluated by the automatic evaluation method for the operation quality of a Redis cluster proposed in the embodiment of the present application, and a display interface is obtained; refer to FIG. Figure 3An embodiment shown is another display interface obtained by evaluating the Redis cluster operation quality automatic evaluation method proposed in the embodiment of the present application. Through the graphical interface, an automatic portrait of the operation quality can be obtained, and then the access capacity of the Redis cluster, the read and write access volume supported by each unit resource configuration, and the performance corresponding to various operations can be automatically calculated to evaluate the operation quality of the Redis cluster. It can be seen that the embodiments of the present application can realize automatic discovery of various types of Redis cluster topologies, automatic profiling of operation quality and centralized management analysis, and discover clusters or instances with abnormal performance; Redis cluster operation quality and business access behavior monitoring, alarms and topology-based comprehensive display and analysis solutions based on Redis access traffic analysis and profiling results can globally discover hot data, abnormal data, abnormal behavior and related sources from the level of cluster or business access behavior to the cache, and can provide early insights into problems that cannot be discovered by monitoring a single Redis instance and issue timely alarm notifications; Redis service degradation based on traffic operations and its integration with Redis can filter and block abnormal requests without perception, provide a certain fault tolerance during Redis service failures, detect and prevent cache penetration and avalanche, and help technical personnel to promptly discover the root cause of the problem and improve it, thereby ensuring the service capabilities and reliability of Redis.
[0071] Therefore, the automatic evaluation method of the operation quality of the Redis cluster of the embodiment of the present invention includes: parsing the configuration of Redis to determine the service type of Redis; determining the access volume and performance of the Redis cluster; determining the portrait of the operation quality of the Redis cluster based on the service type, access volume and performance; reading the data packet of the business system accessing Redis, and determining the access flow information of the business system in combination with the portrait; monitoring the operation quality of the Redis cluster based on the access flow information, determining the abnormal business access behavior with abnormal requests, and evaluating and displaying the monitoring results and abnormal business access behavior. The embodiment of the present application can monitor the operation quality of the Redis cluster in many aspects and improve the reliability of the Redis cluster by determining the portraits of various types of Redis clusters and monitoring the cluster operation quality and abnormal access behavior through the portraits and access data packets.
[0072] Optionally, in one embodiment of the present invention, the data packet of the business system accessing Redis is read, and the access flow information of the business system is determined in combination with the portrait, including:
[0073] Record the timestamp, source information, and destination information of each data packet, parse the data packet, and determine the key value and business instance of the operation;
[0074] Aggregate timestamp, source information, destination information, key value, and business instance into a message queue to determine access traffic information.
[0075] Optionally, in one embodiment of the present invention, the operation quality of the Redis cluster is monitored according to the access traffic information, including:
[0076] Based on the first access count accumulated for each key value in memory, the key values are sorted from large to small or from small to large according to the first access count, and hot keys are screened out according to the sorting results; the corresponding Redis cluster and abnormal business access behavior are determined according to the hot keys;
[0077] Alternatively, determine the usage of the Redis cluster by the business system based on the source and destination information; if different business systems share the same Redis cluster, confirm whether the same key value exists in different business systems, and record the cache usage of each business system;
[0078] Alternatively, if the same key value exists in different Redis clusters, determine whether the key value belongs to the same project based on the source information, and record the changes of the key value in different Redis clusters;
[0079] Alternatively, a second access volume difference between a first instance and a second instance of the first Redis cluster is obtained; an average access volume of a single instance in the first Redis cluster is obtained; a first proportion is determined according to a quotient of the second access volume difference and the average access volume of a single instance; if the first proportion is greater than a first threshold, relevant key values and instances are filtered and recorded.
[0080] In some possible implementations, the embodiments of the present application monitor the operating quality and access behavior of Redis by analyzing the access traffic (i.e., access traffic information) of Redis. It is understandable that the current monitoring technology used for Redis mainly focuses on instantaneously obtaining the values of a series of specific monitoring indicators for a "single" Redis instance and performing simple analysis. When each business system caches a large amount of data to the Redis cluster, it is difficult to judge the overall operating quality of the cache service from such monitoring results and to discover potential problems in a timely manner. It is impossible to check and confirm problems in advance from a higher granularity from dimensions such as the time dimension or the access behavior of different Redis instances, resulting in only passive and slow responses when alarms or failures occur. In this regard, refer to Figure 4 As shown, the specific monitoring process or business access behavior determination process provided by this application is as follows:
[0081] Step S11: Read the data packets of the business system accessing Redis and record the timestamp, source and destination IP of each packet obtained in real time, parse each request and its response, operation command, operation key and key value, and related business system instance according to the communication protocol of Redis, and then calculate the size of the key and its value and calculate the request performance according to the difference of the timestamp. This information can be aggregated to other servers through the message queue for further analysis.
[0082] Step S12: Find the abnormal request and its source and destination, including the following: a key that is different from others in data structure; a key or its value length exceeds a certain threshold; access performance exceeds a certain threshold; an access error determined after parsing the response according to the Redis protocol; a service instance whose access volume deviates from the average value of each instance in the same Redis cluster; a command that is prohibited from execution; a value containing illegal content. Find the keys and their values, the request and its source IP (i.e., the source end information and destination end information in the embodiment of the present application) and its business project, the destination IP of the request and its Redis cluster, and check whether the project information for accessing Redis obtained above contains this IP, summarize and save the relevant results, and explain the event type.
[0083] Step S13: Check and analyze all data contents with relatively long values to check whether there are repeated sub-items in the content. If found, find out all repeated sub-items and their lengths; then check the format of the data content. If it is in XML, JSON or other similar formats, summarize and save these two aspects of information and combine them with the project, the Redis cluster and the instance address. Save to prompt the user to compress the cache occupancy in these two cases and reduce the cache occupancy ratio.
[0084] Step S14: Based on the accumulated accesses of each key in memory, find the keys with the largest accesses. For example, all the keys with the top 100 accesses can be set as hot keys; or keys with accesses exceeding a certain threshold are hot keys. The cache records the accesses of each hot key, the Redis cluster it is in, the source business project and its IP.
[0085] Step S15: Combined with Redis operation commands, comprehensively check the expiration time of each key data and its access frequency, record the keys, commands, sources and destination IPs with access frequency lower than a certain threshold, zero access for a long time after saving but no data expiration time is set or the expiration time exceeds a certain threshold, and the keys, commands, sources and destination IPs with the same expiration time or duration are set; further analyze the expiration time, access volume and the sum of access volume of all hot keys with similar expiration times, and save as potential risk events and all related information when any access volume here exceeds a certain threshold. Summarize and save relevant results, business projects and event types.
[0086] Step S16: Determine the usage of the Redis cluster by the business system based on the source information and the destination information; if different business systems share the same Redis cluster, confirm whether the same key value exists in different business systems, and record the cache usage of each business system. Specifically, check the situation where different projects share the same Redis cluster based on the request source and destination IP. If it is found, further check whether the same key appears in different projects. If found, record the relevant information; calculate and record the cumulative storage share and storage growth rate of each project in each shared Redis cluster, the overall storage growth rate of each Redis cluster, and the estimated time to reach the storage alarm threshold, and record the relevant result information.
[0087] Step S17: If the same key value exists in different Redis clusters, determine whether the key value belongs to the same project based on the source information, and record the changes in the key value on different Redis clusters. Specifically, check whether the same key is saved to different Redis instances or clusters. If so, determine whether it belongs to the same project based on the source IP, and further check whether the changes in the values of these keys on different Redis are consistent. After this part has results, all related business projects and Redis cluster information are summarized and saved, and the user is alerted to the situation of different projects; for the same project, the project information is updated, the situation of synchronizing data with different Redis is explained and the details are recorded, and the delay before and after data synchronization, whether there is missing data and the synchronization success rate are checked and confirmed, and the amount of data, related business projects, Redis cluster information and the last discovery time are recorded.
[0088] Step S18: Calculate the absolute value of the difference in access volume between different instances of the same Redis cluster and the ratio of the average access volume of a single instance, and then check whether the result exceeds a certain threshold. After finding it, further find out the top keys with the largest and smallest access volumes involved in these instances and their access volumes, and summarize and save the information of each related Redis instance, its cluster, and business project, as well as the last discovery time.
[0089] Step S19: Check the number of visits to Redis and the memory usage of Redis respectively. According to the operation quality portrait results of each Redis cluster, when any one of them reaches a certain ratio, continue to check whether the corresponding indicator value maintains growth within a certain period of time (including the situation where it decreases in the middle but continues to grow afterwards). If so, further calculate the average and maximum growth rates. According to the historical data of these two values, NeuralProphet is used to predict how long it will take to reach the relevant alarm threshold, and the relevant information is summarized and saved.
[0090] If any of the above problems exist, the above inspection results will be stored persistently and the user will be alerted at a regular interval. The detailed information and change trends of various events can be displayed through the relevant UI interface and automatically updated. If no problems are found, the inspection time and results will be recorded and prompted on the UI.
[0091] Optionally, in one embodiment of the present invention, determining a profile of the Redis cluster operation quality according to the service type, access volume, and performance includes the following steps:
[0092] Access Redis multiple times through read-only operations and read-write operations, determine the access volume, performance, and storage consumption based on the responses, and determine the quality of the Redis cluster operation;
[0093] If a response error is detected, the corresponding Redis cluster, access volume, and memory usage are recorded;
[0094] Determine the capacity of each Redis service; the capacity includes the number of visits and data size that can be processed;
[0095] Compare and monitor Redis clusters based on support volume, performance, and storage consumption to identify abnormal deployment configurations;
[0096] If the data corresponding to the abnormal deployment and configuration are inconsistent with the data of the current deployment and configuration, update the portrait and record the history of portrait results in different situations.
[0097] In some possible implementations, reference Figure 5 As shown, the embodiment of the present application can automatically profile the operation quality of the Redis service. It is understandable that in addition to configurations such as memory and CPU, dynamic factors such as the amount of cached data, the size of cached data, and the read and write types of cache operations will directly affect the access performance and stability of the Redis service, so the performance upper limit data of different Redis services may vary greatly. In this regard, the automatic profiling process provided by the embodiment of the present application includes the following steps:
[0098] Step S21: Determine which projects in the network will access Redis when running, and then parse the Redis configuration to obtain the type of Redis service, whether it is a stand-alone (considered as a cluster with only one instance), sentinel, Redis Cluster or Codis, read the version number, IP, port, server memory and CPU configuration of each instance in the cluster state, and if it is a Redis service based on k8s containerization, read the service encapsulation method and k8s-based configuration. For projects accessing Redis, it is necessary to distinguish between the same projects deployed separately with different domain names or reverse proxy addresses. Summarize and save all Redis with only one instance and their project information, and prompt the user.
[0099] Step S22: Determine the capacity and performance of each Redis cluster through two modes: use different Redis commands in sequence and access Redis by combining different read and write commands concurrently. Use the same Redis command range as the actual business, support setting the ratio of different command combinations, the ratio of different key and data size groups, and the size of the key and its value can also be set according to the specified function.
[0100] Step S23: According to the requirements for the operation quality of Redis, all responses are used to calculate the concurrent access volume of Redis, the performance (including evaluation, maximum, TP99, TP80) and the error rate corresponding to different levels of different concurrent access volumes, key and value sizes, and different memory consumption intervals.
[0101] Step S24: When a response error is detected, the Redis cluster and its specific error information, access volume, data size, memory usage are recorded and the user is notified.
[0102] Step S25: Calculate the average access volume and data size that can be processed per core CPU and per 1GB memory for each Redis service, and recalculate after the cluster is expanded or reduced. The support amount in the embodiment of the present application is used to characterize the resource configuration amount of each Redis service.
[0103] Step S26: Compare the access volume, performance and error rate results of all Redis clusters. If it is found that the result value of a cluster is too far from the average value or exceeds the required threshold, compare the Redis and server configurations to find out the main differences, and alert the user to the differences in results and configurations.
[0104] Save the scale, configuration, actual operation quality results and related business projects of each cluster, and obtain the information about each Redis cluster and its expansion and contraction, and when the concurrent access volume, data size and memory usage reach a certain range, an error alarm or serious problem will occur. At the same time, according to the alarms and failure results in daily monitoring work, the relevant indicator values here are updated when the data here is inconsistent. The embodiment of the present application facilitates the subsequent monitoring and analysis of the operation quality of the Redis cluster through automatic profiling, thereby improving the reliability of Redis.
[0105] Optionally, in one embodiment of the present invention, the Redis cluster operation quality automatic evaluation method further includes:
[0106] Combined with the portrait, determine the visitor information or instance information of the Redis cluster; there is data flow between the instance information and the Redis cluster;
[0107] Take visitor information and instance information as the first type of nodes, take Redis as the second type of node, establish a topology map, and display the topology map.
[0108] In some embodiments, the embodiments of the present application can also realize centralized monitoring and analysis of the operating quality of the Redis cluster with the topology map as the center. Due to the rich variety of Redis cluster services and their client tool library types, business systems using Redis and their technical platforms, coupled with the common reuse of Redis clusters caused by factors such as resource reuse, and the reuse and storage of the same cached data between different business systems, considering that the current monitoring scheme based on a single Redis instance cannot timely discover and help users prevent related problems. In the daily operation and maintenance monitoring scenario of Internet business, it is necessary to use a topology map to centrally and intuitively display all relevant software instances with access and data flow relationships with the cluster, including all business systems and their middleware, with a Redis cluster as the center. All software instances with a certain call level (for example, 3 to 5 layers) can be displayed on a map, so that users can easily grasp the specific composition and operating quality of each part globally through the topology map, and update the topology map once every certain period of time (for example, 1 minute) through the re-acquired information from various aspects. Reference Figure 6 An embodiment of the topology diagram shown, in which a circle is used to represent a business project accessing a Redis cluster, and the topology diagram uses different geometric shapes to represent different types of Redis clusters, showing automatically discovered Redis cluster information, portraits, and main automatic evaluation results of operation quality, including cluster name and cluster type, number of databases and database names, as well as discovered persistence, backup, and discovered abnormal access. Arrows represent the direction of data flow (request). For example, arrows of different colors can be used to represent the severity level of the problem. The main problem can be prompted through the topology diagram as needed, and then combined with other UI elements to provide comprehensive analysis operations. The topology diagram service provided in the embodiment of the present application includes the following steps:
[0109] Step S31: Determine the technical platform of the business system that accesses each Redis cluster and the name of the Redis access tool, and use this part as the first type of node in the topology map. Different types of nodes are displayed using different legends. Different instances of the same business cluster are framed together.
[0110] Step S32: Take Redis as the second type of node, determine the type of each instance node through Redis INFO, cluster nodes and other instructions, and display the type of Redis cluster synchronously. For Sentinel, mark the server IPs of sentinel, master and slave respectively. For Codis, mark the master and slaves respectively. Redis instances with different roles are displayed in different legends. For Redis Cluster, mark the IPs of each master and slave node. Frame each instance of the same Redis cluster together.
[0111] Step S33: between each business system instance and each Redis instance, as long as there is an access relationship, a connection line is established, and its direction is from the business instance to the Redis instance. The total number of visits and maximum performance in the last time period can be displayed on the line. If there is an error, the number of errors is displayed. A connection line is also established between each instance of the same Redis cluster as long as there is data flow, and the direction of the line is the data flow direction.
[0112] Step S34: Display the access quality of the Redis cluster on the topology map in combination with UI elements such as tables: display the access volume, maximum access performance, number of errors, and data item distribution of each node for the Codis cluster; display the maximum access performance, survival status, number of blocked clients and last discovery time for the Redis Cluster; display the access volume, maximum performance, number of errors and last discovery time of each node for the Redis sentinel service.
[0113] Step S35: Based on the topological display analysis, the backup and persistence status of each Redis cluster detected includes the latest data backup time, whether it is successful, and the backup location. At the same time, the abnormal node information is displayed to warn the cluster that has not been backed up for a certain period of time. At the same time, the topological map shows whether each Redis instance has enabled the snapshot solution (Redis DataBase, AOF) or the log solution (Append Only File, RDB) and which of the two is enabled.
[0114] Step S36: If the Redis cluster is accessed by different business systems, the storage share, access share and occupancy growth rate of each business system are displayed on the topology map through the first mark. Specifically, if a Redis cluster is accessed by multiple different business systems, a certain form of first mark is specially used on the topology map, such as using different background colors or icons, and the storage share, access share and occupancy growth rate of each business system are displayed at the same time. When the existence share of one of the systems grows rapidly and may exceed the storage limit, the user is promptly prompted and the estimated time to trigger the alarm is given in combination with NeutralProphet.
[0115] Step S37: If the same key value is stored in different Redis clusters, the relevant business system is displayed on the topology map through the second identifier. Specifically, if it is found that the same key or the same key and its value are stored in different Redis clusters by different business systems, a special second identifier is used in the topology to display the relevant Redis clusters and business systems, and the number of the same keys and the number of keys that are not updated synchronously are displayed on the UI. If it is found that the cache data is updated asynchronously, the relevant business system personnel are notified. Here, the call relationship between the projects can also be determined by analyzing and verifying the access traffic of the relevant projects and displayed on the topology map.
[0116] Step S38: For each product or business cluster, the connection type to the Redis cluster is displayed on the topology map in units of projects, including whether it is connected to a master or slave node and its IP, the type of connected Redis cluster, the Redis client name, and whether it is a publish-subscribe connection. It is determined whether the operation of each project to a Redis cluster is normal. An evaluation value can be calculated based on factors such as the cache occupancy growth rate, the number of large keys, the number of hot keys, the large value of the key, the illegal content of the key value, whether a Redis cluster is shared with other projects, and whether the same cache data is shared with other projects. The user is reminded to check the Redis operations of projects that exceed a certain value and the specific problems that exist, and the corresponding projects are highlighted in some form on the topology map.
[0117] Step S39: Supports adjusting the Redis cluster structure based on the topology map and recording related events, allowing users to perform the following operations on the topology map UI by dragging the mouse, right-clicking, etc.: adding or removing Redis instances to the Redis cluster; switching the master and slave nodes of the cluster, that is, switching the master node to the slave node or vice versa; calling the corresponding Redis cluster command to perform data migration. Dynamically display and update the operation progress on the topology map, update the prompts about the roles of each Redis instance on the topology map after the operation is completed, record the operation log, whether the final result is successful, and the prompts when it fails and remind the user.
[0118] All access errors, a certain number of slowest requests and possible causes, reused Redis clusters, inconsistent cache data and other abnormal business projects, Redis clusters and the last discovery time are displayed synchronously in the form of tables on the UI where the topology map is located. This information can be synchronized with the prompt reflecting the abnormal effect on the corresponding Redis instance, and a corresponding prompt will pop up on the UI when the mouse moves over the corresponding Redis instance.
[0119] Optionally, in one embodiment of the present invention, the Redis cluster operation quality automatic evaluation method further includes:
[0120] According to the data packet, the access request of the business system is determined, and the access request is cached to obtain cached data;
[0121] If the Redis instance is not running properly, the Redis service will be downgraded based on the cached data;
[0122] Filter and block abnormal requests based on access requests or source information;
[0123] According to the access traffic information, the cache is penetrated and avalanched.
[0124] In some possible implementations, when a Redis service fails, only technicians can try to restore the service as soon as possible. In this regard, the present application embodiment provides a technical solution for providing Redis degraded services from the Redis end during a Redis service failure, so that during service deterioration and failure or during cluster processing of a failure instance, most or even all business system operation requests for Redis can still be correctly responded to from the server where the corresponding Redis instance is located. Specifically, refer to Figure 7 The process of ensuring the operation quality of access traffic based on Redis provided in the embodiment of the present application includes the following steps:
[0125] Step S41: Read and parse the access request of the business system to the current Redis instance on the server where each instance of the Redis cluster is located, and record the IP, port, and MAC addresses of both ends of the communication.
[0126] Step S42: When the current Redis instance is running normally, all requests to write data to the instance are cached locally or remotely for a certain period of time (for example, 60 minutes). Before caching, the expiration time of the write operation is checked first, and only data exceeding the predetermined cache time is cached. The data of write operations of all hot keys can also be cached at the same time.
[0127] Step S43: When processing the operation of the previous step, the corresponding Redis instance is checked to see if it is running normally by calculating the chronic performance rate and error rate / error amount of the request. When it is found that the running quality of the Redis instance has dropped to a certain level but is still able to provide services, two types of measures are implemented, including using traffic operations to check and replace the value corresponding to the key of the erroneous request using the result of the previous step and then returning it to the request end, or accumulating all abnormal requests and calculating the number of requests to be forwarded to other instances according to a certain multiplier and implementing them. It is also possible to adjust the access volume of the relevant Redis instance to the Codis cluster through the Proxy node in real time, trigger the addition of a new Redis instance to the cluster and automatically synchronize relevant data to the new instance with reference to the abnormal request; once the instance failure is discovered and confirmed, the service downgrade of the instance is implemented according to the next plan to provide a certain fault-tolerant service, and at the same time notify the technical staff to continue the service using the data of the previous step.
[0128] Step S44: During the current Redis instance failure, if business access requests to Redis are still received, these requests are intercepted, parsed to obtain the requested key, read / write type, and data, and then processed separately:
[0129] a) If it is a cache read operation, first read the corresponding data from the cache in the previous step according to the key obtained by parsing, and then send the correct response message to the business request end through the network device of the current server according to the Redis protocol to simulate the Redis instance in the fault. Here, the MAC addresses, IP addresses and port numbers of the two ends during normal communication must be correctly set, and the ACK and other flags must be correctly set as needed.
[0130] b) If it is a write cache operation, the key and data to be written are recorded, and can be handled separately according to the specific situation: b1 If the faulty instance can be recovered quickly, write after the Redis instance is restored: b2 If the instance is out of the Redis cluster, the write operation is immediately forwarded to the current Redis cluster. The specific forwarding object can be determined according to the cluster type. If the current cluster is Codis, the proxy instance to which the current cached data belongs can be found according to the same rules of Codis data distribution, and then the write cache request is forwarded to the proxy. If it is sentinel, it can be written to the new master. If it is a Redis cluster, it can be written to a normal instance at random; b3 supports forwarding the write request to the specified destination Redis in the original order by modifying the destination address of the write operation data packet.
[0131] Step S45: During the instance failure, check whether the faulty instance has recovered at regular intervals (eg, 0.5 seconds). Once recovered, stop intervening in the communication between the service instance and the Redis instance, and notify the user.
[0132] Step S46: Support interception, filtering (blocking) of abnormal requests from two dimensions: request data and request IP. The interception request can be sent by the server, and it is executed after receiving here. Specific interception rules include but are not limited to: which Redis commands to intercept, which request data that meets which rules to intercept, which IPs to intercept or only which IPs to allow access, which command combinations to intercept, etc., which are implemented by the network traffic operation tool on each Redis instance, and the data packets that find the service interception rules are discarded and no longer sent to the Redis service instance. This can be done in parallel with the content related to Redis service degradation.
[0133] Step S47: Detect and process cache penetration and avalanche by analyzing the access traffic of Redis: read and parse the traffic of reading Redis from the business instance end, check whether the cache hits by parsing the read request and its response, and accumulate the ratio of miss operations to all read operations. Further based on traffic reading, parsing and checking, accumulate the number of requests and their SQL sent by the business system to the back-end database service through the JDBC application layer protocol after the cache misses. When the number of such requests exceeds a certain threshold, record the relevant information as an abnormal event and generate a prompt that the corresponding function of the relevant project may have defects, including the key that caused the cache miss, the number of requests sent to the back-end database and its query SQL, the business project to which it belongs and the Redis cluster. It supports intercepting the corresponding business request from the network layer and interrupting the sending to the database service or forwarding it to other specified destinations. It can also support automatically querying the required data from the database for keys that meet certain rules after detecting a certain number of cache misses and caching them to the Redis cluster required by the business project.
[0134] Summarize the above process, record the log, report to the server and notify the user.
[0135] Optionally, in one embodiment of the present invention, the Redis cluster operation quality automatic evaluation method further includes:
[0136] If the access request is a cache read request, read the first data from the cache according to the key value, and send a first response through a network device of the server to simulate a failed Redis instance;
[0137] Or, if the access request is a write cache operation, wait for the Redis instance to recover;
[0138] Alternatively, if the access request is a write cache operation, the write cache operation is forwarded to the current Redis instance for processing.
[0139] The automatic evaluation method for the operation quality of a Redis cluster provided in this application can be executed by a server, or by a client, or by both a client and a server. Figure 8As shown, the above functions of the embodiment of the present application are jointly provided by the client tool and the server, and the two communicate based on the HTTP / HTTPS protocol. The client is mainly responsible for executing specific Redis cluster performance profiling, cluster monitoring and operation quality assurance, and the server is mainly responsible for centralized storage, analysis and batch control of results. The client can be compiled and deployed to a series of servers in different computer rooms after being split according to functions; batch operations of the client are supported through the server. The system can also be used for operation quality evaluation, monitoring and service quality assurance of other software that supports the Redis protocol.
[0140] The embodiments of the present application can automatically discover and detect the deployment topology of various Redis clusters and their operation quality portraits for read-only or read-write mixed operations. It can easily check and test the performance of various Redis and Codis clusters, find out the impact of different deployment and configuration schemes on performance and stability, and provide a strong basis for subsequent monitoring prediction and accurate alarms. The embodiments of the present application can imperceptibly monitor the cluster operation quality and improper access behavior of the business system from two aspects: Redis cluster and access data. There is no need to modify any code or configuration of the business system or Redis for this purpose. It can also be based on the deployment topology diagram to closely follow the business's comprehensive display of the quality requirements of the Redis cache service, so that the operation status and problems of all aspects are clear at a glance. The embodiments of the present application can automatically detect Redis failures and implement Redis service degradation during failures, so that Redis is perceived to be basically available on the application side, and the write cache data during the failure can also be restored and stored after the failure.
[0141] Secondly, refer to the attached Fig. 9 A Redis cluster operation quality automatic evaluation system proposed according to an embodiment of the present invention is described.
[0142] Fig. 9 This is a schematic diagram of the structure of a Redis cluster operation quality automatic evaluation system according to an embodiment of the present invention. The system specifically includes:
[0143] The first module 810 is used to parse the configuration of Redis, determine the service type of Redis, and determine the access volume and performance of the Redis cluster;
[0144] The second module 820 is used to determine the profile of the Redis cluster operation quality according to the service type, access volume and performance;
[0145] The third module 830 is used to read the data packet of the business system accessing Redis, and determine the access flow information of the business system in combination with the portrait;
[0146] The fourth module 840 is used to monitor the operation quality of the Redis cluster according to the access traffic information, determine the abnormal business access behavior with abnormal requests, and evaluate and display the monitoring results and the abnormal business access behavior.
[0147] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0148] An embodiment of the present invention provides a device for automatically evaluating the operation quality of a Redis cluster, comprising:
[0149] at least one processor;
[0150] at least one memory for storing at least one program;
[0151] When the at least one program is executed by the at least one processor, the at least one processor implements the automatic evaluation method for the operation quality of the Redis cluster.
[0152] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0153] The Redis cluster operation quality automatic evaluation device provided in the embodiment of the present application for executing the above-mentioned Redis cluster operation quality automatic evaluation method can be a terminal, referring to Fig.10 , Fig.10 This is a partial structural block diagram of a terminal provided in an embodiment of the present application. The terminal includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art can understand that Fig.10 The terminal structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0154] The RF circuit can be used to receive and send signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor for processing; in addition, the designed uplink data is sent to the base station.
[0155] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory.
[0156] The input unit can be used to receive input digital or character information and generate key signal input related to the setting and function control of the mobile phone. Specifically, the input unit can include a touch panel 1031 and other input devices 1032.
[0157] The display unit 1040 may be used to display input information or provided information and various menus of the mobile phone. The display unit 1040 may include a display panel 1041 .
[0158] The audio circuit 1060 , the speaker 1061 , and the microphone 1062 may provide an audio interface.
[0159] In this embodiment, the processor included in the terminal can execute the Redis cluster operation quality automatic evaluation method of the previous embodiment.
[0160] The Redis cluster operation quality automatic evaluation device for executing the above-mentioned Redis cluster operation quality automatic evaluation method provided in the embodiment of the present application can also be a server, referring to Fig.11 , Fig.11 Partial structural block diagram of the server provided in the embodiment of the present application, the server 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (abbreviated as CPU, i.e. Central Processing Units), 1122 (for example, one or more processors) and memory 1132, one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1142 or data 1144. Among them, the memory 1132 and the storage medium 1130 can be short-term storage or permanent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server 1100. Furthermore, the central processing unit 1122 can be configured to communicate with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the server 1100.
[0161] The server may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, and / or one or more operating systems 1141, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0162] The processor in the server can be used to execute the above Redis cluster operation quality automatic evaluation method.
[0163] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0164] An embodiment of the present invention further provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to execute the above-mentioned Redis cluster operation quality automatic evaluation method.
[0165] Similarly, the contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0166] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0167] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several programs to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0169] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable programs for implementing the logical functions, and may be embodied in any computer-readable medium for use by a program execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch and execute a program from a program execution system, device or apparatus), or in conjunction with such program execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by a program execution system, device or apparatus, or in conjunction with such program execution systems, devices or apparatuses.
[0170] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0171] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0172] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0173] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0174] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for automatically evaluating the operation quality of a Redis cluster, characterized in that: The following steps are involved: Analyze the Redis configuration, determine the Redis service type, and determine the access volume and performance of the Redis cluster; Determine the Redis cluster operation quality profile based on the service type, traffic, and performance; Read the data packets of the business system accessing Redis, and determine the access flow information of the business system in combination with the portrait; According to the access traffic information, the operation quality of the Redis cluster is monitored, abnormal business access behaviors with abnormal requests are determined, and the monitoring results and the abnormal business access behaviors are evaluated and displayed; The reading of the data packet of the business system accessing Redis and determining the access flow information of the business system in combination with the portrait includes: Record the timestamp, source information and destination information of each data packet, parse the data packet, and determine the key value and business instance of the operation; Aggregate the timestamp, the source end information, the destination end information, the key value and the business instance into a message queue to determine access traffic information; The monitoring of the operation quality of the Redis cluster according to the access traffic information includes: Based on the first access volume accumulated for each key value in memory, the key values are sorted from large to small or from small to large according to the first access volume, and hot keys are screened out according to the sorting result; and the corresponding Redis cluster and abnormal business access behavior are determined according to the hot keys; Alternatively, based on the source information and the destination information, determine the usage of the Redis cluster by the business system; if different business systems share the same Redis cluster, confirm whether the same key value exists in the different business systems, and record the occupancy of the cache by each business system; Alternatively, if the same key value exists in different Redis clusters, determine whether the key value belongs to the same project according to the source information, and record the changes of the key value in different Redis clusters; Alternatively, obtaining a second access volume difference between a first instance and a second instance of a first Redis cluster; obtaining an average access volume of a single instance in the first Redis cluster; determining a first weight according to a quotient of the second access volume difference and the average access volume of the single instance; if the first weight is greater than a first threshold, filtering and recording relevant key values and instances; Determining the profile of the Redis cluster operation quality according to the service type, access volume and performance includes the following steps: Access Redis multiple times through read-only operations and read-write operations, determine the access volume, performance and storage consumption based on the responses, and determine a portrait of the operating quality of the Redis cluster; If a response error is detected, the corresponding Redis cluster, access volume, and memory usage are recorded; Determine the support capacity of each Redis service; the support capacity includes the access volume and data size that can be processed; Comparative monitoring of the Redis cluster is performed based on the supported amount, the performance, and the storage consumption to determine abnormal deployment configurations; If the data corresponding to the abnormal deployment and configuration is inconsistent with the data of the current deployment and configuration, the portrait is updated.
2. The automatic evaluation method for Redis cluster operation quality according to claim 1 is characterized in that: The method further comprises: Determine visitor information or instance information of the Redis cluster in combination with the portrait; data flows between the instance information and the Redis cluster; The visitor information and the instance information are taken as the first type of nodes, and Redis is taken as the second type of node, a topology map is established, and the topology map is displayed.
3. The automatic evaluation method for Redis cluster operation quality according to claim 1 is characterized in that: The method further comprises: Determine the access request of the business system according to the data packet, and cache the access request to obtain cache data; If the Redis instance is not running normally, the Redis service is downgraded according to the cached data; Filter and block abnormal requests according to the access request or source information; According to the access traffic information, penetration and avalanche processing are performed on the cache.
4. The automatic evaluation method for Redis cluster operation quality according to claim 3 is characterized in that: The method further comprises: If the access request is a cache read request, read the first data from the cache according to the key value, and send a first response by simulating a failed Redis instance through a network device of the server; Alternatively, if the access request is a write cache operation, wait for the Redis instance to recover; Alternatively, if the access request is a write cache operation, the write cache operation is forwarded to the current Redis instance for processing.
5. A Redis cluster operation quality automatic evaluation system, characterized in that: include: The first module is used to parse the Redis configuration, determine the Redis service type, and determine the access volume and performance of the Redis cluster; The second module is used to determine the profile of the Redis cluster operation quality according to the service type, access volume and performance; The third module is used to read the data packets of the business system accessing Redis, and determine the access flow information of the business system in combination with the portrait; The fourth module is used to monitor the operation quality of the Redis cluster according to the access traffic information, determine abnormal business access behaviors with abnormal requests, and evaluate and display the monitoring results and the abnormal business access behaviors; The third module is used to record the timestamp, source information and destination information of each data packet, parse the data packet, and determine the key value and business instance of the operation; Aggregate the timestamp, the source end information, the destination end information, the key value and the business instance into a message queue to determine access traffic information; The third module is used to: Based on the first access volume accumulated for each key value in the memory, the key values are sorted from large to small or from small to large according to the first access volume, and hot keys are screened out according to the sorting result; According to the hotkey, determine the corresponding Redis cluster and abnormal business access behavior; Alternatively, based on the source information and the destination information, determine the usage of the Redis cluster by the business system; if different business systems share the same Redis cluster, confirm whether the same key value exists in the different business systems, and record the occupancy of the cache by each business system; Alternatively, if the same key value exists in different Redis clusters, determine whether the key value belongs to the same project according to the source information, and record the changes of the key value in different Redis clusters; Alternatively, obtaining a second access volume difference between the first instance and the second instance of the first Redis cluster; Obtaining the average number of single-instance accesses in the first Redis cluster; Determine a first weight according to the quotient of the second pageview difference and the single instance pageview average; if the first weight is greater than a first threshold, filter and record relevant key values and instances; The second module is used to: Access Redis multiple times through read-only operations and read-write operations, determine the access volume, performance and storage consumption based on the responses, and determine a portrait of the operating quality of the Redis cluster; If a response error is detected, the corresponding Redis cluster, access volume, and memory usage are recorded; Determine the support capacity of each Redis service; The support volume includes the access volume and data size that can be processed; Comparative monitoring of the Redis cluster is performed based on the supported amount, the performance, and the storage consumption to determine abnormal deployment configurations; If the data corresponding to the abnormal deployment and configuration is inconsistent with the data of the current deployment and configuration, the portrait is updated.
6. A Redis cluster operation quality automatic evaluation device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the automatic evaluation method for the operation quality of a Redis cluster as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the automatic evaluation method for the operation quality of a Redis cluster as claimed in any one of claims 1 to 4 when executed by the processor.
