CN106411547B - A kind of redis calls monitoring method and device - Google Patents

A kind of redis calls monitoring method and device Download PDF

Info

Publication number
CN106411547B
CN106411547B CN201510456395.0A CN201510456395A CN106411547B CN 106411547 B CN106411547 B CN 106411547B CN 201510456395 A CN201510456395 A CN 201510456395A CN 106411547 B CN106411547 B CN 106411547B
Authority
CN
China
Prior art keywords
information
monitoring
redis
time
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510456395.0A
Other languages
Chinese (zh)
Other versions
CN106411547A (en
Inventor
张�林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201510456395.0A priority Critical patent/CN106411547B/en
Publication of CN106411547A publication Critical patent/CN106411547A/en
Application granted granted Critical
Publication of CN106411547B publication Critical patent/CN106411547B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/508Network service management, e.g. ensuring proper service fulfilment according to agreements based on type of value added network service under agreement
    • H04L41/5096Network service management, e.g. ensuring proper service fulfilment according to agreements based on type of value added network service under agreement wherein the managed service relates to distributed or central networked applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to a kind of redis to call monitoring method and device.The described method includes: by prefix and suffix, key required for splicing redis is operated;It executes burying for recalls information a little to acquire with data, for the acquired information called each time, the prefix according to key is merged, to obtain the monitoring information of tape label;And the monitoring information for the tape label for calling acquisition each time is counted, and by the information reporting of statistics to monitoring center.

Description

A kind of redis calls monitoring method and device
Technical field
The present invention relates to the maintenance and management fields of the distributed caching cluster based on redis, particularly a kind of Redis calls monitoring method and device.
Background technique
With the development of technology with the change of people's living habit, internet is in our life in occupation of increasingly heavier The status wanted;On the one hand huge development opportunity is brought to the relevant industry in internet, but the user group of explosion type increases, Also the exploitation to internet and maintenance bring huge challenge, and how to cope with the increasing of large-scale explosive amount of access It is long, also become the constant proposition of internet industry exploitation.And in the solution that reply largely concurrently accesses, it is based on The server-side solution of distributed caching technology is substantially essential, and high-performance, High Availabitity, is easy to dynamic expansion The characteristics such as exploitation can bring several times even performance boost of tens hundreds of times for an internet product.
Redis be one open source write using ANSI C language, support network, it is memory-based also can persistence day Will type, key-value database, and the API of multilingual is provided.
Redis is a high performance key-value database.The appearance of Redis, largely compensates for Memcached this generic key/value storage deficiency, in part, occasion can play good supplementary function to relational database. It provides Java, C/C++, C#, PHP, JavaScript, Perl, Object-C, Python, Ruby, the clients such as Erlang End, it is very convenient to use.
Although the distributed caching cluster currently based on redis is widely used in internet product, due to itself Some simple monitoring interfaces are only provided, so the monitoring currently for the distributed caching cluster based on redis all uses greatly Cause identical mode: center type monitoring.I.e. entire monitoring system is central node, it can poll monitoring in need Then redis example, the monitoring interface for calling redis oneself to realize are stored in monitoring system with obtaining redis status information Finally form monitoring report by merging the operation such as statistics again (deployment diagram is detailed in Fig. 1).Strategy and reply based on disaster tolerance are complicated Production deployment environment, in such monitoring system, monitoring center may system different location dispose multiple, group At a monitoring center cluster, influence of the monitoring data that checks one against another to avoid deployment architecture, network environment to monitoring center.
The design structure of existing monitoring scheme itself determines it always and has a huge defect: monitoring center and The network environment of redis example and the network environment of application redis may be distinguished very greatly, when the network of application redis example is sent out When raw failure, monitoring center can not be perceived.
Simultaneously as caching the characteristic of the high concurrent of itself, in the case where qps is up to ten thousand, accomplish to be similar to such as mysql Or the careful monitoring accurate like that of the standard database of mssql, the cost of required consumption be it is very huge, so at present It is mainly all based on the monitoring interface of redis itself in the industry, such as qps of redis example can only be directed to, memory usage amount, deposited The sum etc. of the key (key) of storage is monitored.There is presently no the monitoring of a recalls information specific for redis, often all It is that memory is in excess of the quota directly to empty, or is understood in specific redis on earth by the data saved in analysis redis afterwards Any data stored.And counted for information such as redis malloc failure mallocs, and in the application rather than in monitoring, When redis itself survives but normally cannot provide service, monitoring center can not be found in time.In the prior art, only The condition monitoring of redis calling only may be implemented.The purpose of the invention is to make up to call about redis in the prior art to supervise The missing in prosecutor face.
Summary of the invention
In view of the above problem present in this field, the invention proposes the method and apparatus that a kind of redis calls monitoring. In technical scheme, according to key prefix merge monitoring statisticss and by agent acquisition monitoring information be realize this The key point of monitoring scheme.By this programme, the content limitation of traditional redis monitoring is breached, redis can not only be monitored The status information of example itself, additionally it is possible to call content to carry out certain monitoring to true;It is complicated more that reply is also increased simultaneously The ability of the production environment of change.All monitoring datas are the data called from true redis, without monitored center and The influence of the network environment of redis example.These characteristics all have the stabilization and stalwartness that guarantee distributed caching cluster non- Often big help, operation and maintenance for distributed caching cluster have huge facilitation.
According to an aspect of the invention, there is provided a kind of redis calls monitoring method.The described method includes: before passing through Sew and suffix, splicing redis operate required key;It executes burying for recalls information a little to acquire with data, for calling each time Acquired information, merged according to the prefix of key, to obtain the monitoring information of tape label;And it is called each time to being directed to The monitoring information of the tape label of acquisition is counted, and by the information reporting of statistics to monitoring center.
According to one embodiment of present invention, wherein for the acquired information called each time for for calling each time Time-consuming, the information of flow.
It according to one embodiment of present invention, further include that the information of statistics is asynchronously reported to monitoring center.
According to another aspect of the present invention, a kind of redis calling monitoring device is provided.Described device includes: key pipe Module is managed, for splicing key required for redis is operated by prefix and suffix;Redis calls proxy module, for executing Burying for recalls information is a little acquired with data, and for the acquired information called each time, the prefix according to key is merged, to obtain Obtain the monitoring information of tape label;And this statistical module, for believing the monitoring for the tape label for calling acquisition each time Breath is counted, and by the information reporting of statistics to monitoring center.
According to one embodiment of present invention, wherein for the acquired information called each time for for calling each time Time-consuming, the information of flow.
According to one embodiment of present invention, wherein it is described local statistical module can also by the information of statistics asynchronously on Offer monitoring center.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute improper limitations of the present invention.Wherein:
Fig. 1 is the redis monitoring deployment structural schematic block diagram of the prior art;
Fig. 2 is the schematic flow diagram that redis according to an embodiment of the present invention calls monitoring method;
Fig. 3 is the schematic block diagram that redis according to an embodiment of the present invention calls monitoring device 10;And
Fig. 4 is the schematic diagram for the calling timing that redis according to an embodiment of the present invention calls each module in monitoring.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 2 is the schematic flow diagram that a kind of redis according to an embodiment of the present invention calls monitoring method.As shown in Fig. 2, It includes: step S01 that redis, which calls monitoring method, by prefix and suffix, splices key required for redis is operated;Step S02, Burying for recalls information is executed a little to acquire with data, for the acquired information called each time, the prefix according to key is merged, To obtain the monitoring information of tape label;And step S03, the monitoring information for the tape label for calling acquisition each time is carried out Statistics, and by the information reporting of statistics to monitoring center.
According to one embodiment of present invention, it is called in monitoring method in redis, wherein being adopted for what is called each time Collecting information is for the time-consuming called each time, the information of flow.
According to one embodiment of present invention, it further includes asynchronously reporting the information of statistics that redis, which calls monitoring method, To monitoring center.
Fig. 3 is the schematic block diagram that a kind of redis according to an embodiment of the present invention calls monitoring device 10.As shown in figure 3, It includes: key management module 110 that redis, which calls monitoring device 10, for splicing required for redis operation by prefix and suffix Key;Redis calls proxy module 120, a little acquires with data for executing burying for recalls information, for the institute called each time Information is acquired, the prefix according to key merges, to obtain the monitoring information of tape label;And this statistical module 130, it is used for Monitoring information for the tape label for calling acquisition each time is counted, and by the information reporting of statistics to monitoring center.
Devices in accordance with embodiments of the present invention 10, wherein being for each time for the acquired information called each time The time-consuming of calling, the information of flow, and wherein the information of statistics can also be asynchronously reported to by the local statistical module Monitoring center.
Technical solution of the present invention is improved in existing technical solution.Fig. 4 is redis according to an embodiment of the present invention Call the schematic diagram of the calling timing of each module in monitoring.As shown in figure 4, the process that new technical solution is called in redis In acted on behalf of, the information such as the calling situation of redis, call result are acquired in agency, the information of acquisition exists After merging, counting, it is reported to monitoring center.Entire scheme is made of three parts: key management module, redis call generation Manage module, this statistical module composition.
Key management module: although the qps of single redis example is few then thousands of how then tens of thousands of, all calling are still Still there is mark governed, i.e., the key of in general all redis is essentially all by prefix parameter (usually according to service class Type determine) and suffix (unique identification informations such as usually id or uid) be spliced.The major function of key management module is then Splice key required for true redis is operated by prefix and suffix.
Call proxy module: calling proxy module is an encapsulation to redis client, executes recalls information wherein Bury a little and data acquisition, while the prefix information of key is tagged to during current redis calls, i.e., will be for calling each time The information of acquisition, the prefix according to key merges, to obtain the monitoring information of tape label.By tape label after calling Monitoring information transfers to this statistical module.Wherein by bury a little with data acquire it is available for example for the consumption called each time When, the information of flow etc., that is, the information acquired can be the time-consuming of calling, the information of flow etc..In actual production environment by In the high concurrent of redis, monitoring and recording calling each time is the very big movement of consumption, and required progress according to the present invention Statistics and the data volume of transmission are then very small and acceptables.
This statistical module: on the one hand this statistical module needs the information that redis is called to proxy module acquisition to carry out Statistics, while also needing asynchronously by the information reporting of statistics to monitoring center.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (6)

1. a kind of redis calls monitoring method, comprising:
By prefix and suffix, splice key required for redis is operated;
It executes burying for recalls information a little to acquire with data, the prefix for the acquired information called each time, according to the key It merges, to obtain the monitoring information of tape label;And
Monitoring information for the tape label for calling acquisition each time is counted, and by the information reporting of statistics in monitoring The heart.
2. according to the method described in claim 1, wherein for the acquired information called each time for for calling each time Time-consuming, the information of flow.
3. according to the method described in claim 1, further including that the information of the statistics is asynchronously reported to monitoring center.
4. a kind of redis calls monitoring device, comprising:
Key management module, for by prefix and suffix, splicing redis to operate required key;
Redis calls proxy module, a little acquires with data for executing burying for recalls information, is acquired for what is called each time Information, the prefix according to the key merge, to obtain the monitoring information of tape label;And
This statistical module, for being counted to the monitoring information for the tape label for calling acquisition each time, and will statistics Information reporting to monitoring center.
5. device according to claim 4, wherein for the acquired information called each time for for calling each time Time-consuming, the information of flow.
6. device according to claim 4, wherein the local statistical module can also be asynchronous by the information of the statistics Ground is reported to monitoring center.
CN201510456395.0A 2015-07-28 2015-07-28 A kind of redis calls monitoring method and device Active CN106411547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510456395.0A CN106411547B (en) 2015-07-28 2015-07-28 A kind of redis calls monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510456395.0A CN106411547B (en) 2015-07-28 2015-07-28 A kind of redis calls monitoring method and device

Publications (2)

Publication Number Publication Date
CN106411547A CN106411547A (en) 2017-02-15
CN106411547B true CN106411547B (en) 2019-11-05

Family

ID=58009333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510456395.0A Active CN106411547B (en) 2015-07-28 2015-07-28 A kind of redis calls monitoring method and device

Country Status (1)

Country Link
CN (1) CN106411547B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109039817B (en) * 2018-08-03 2020-09-01 京东数字科技控股有限公司 Information processing method, device, equipment and medium for flow monitoring

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092556A (en) * 2013-12-13 2014-10-08 腾讯数码(天津)有限公司 Monitoring method, device and system based on distributed system
CN104348650A (en) * 2013-08-05 2015-02-11 腾讯科技(深圳)有限公司 Website monitoring method, business device and website monitoring system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348650A (en) * 2013-08-05 2015-02-11 腾讯科技(深圳)有限公司 Website monitoring method, business device and website monitoring system
CN104092556A (en) * 2013-12-13 2014-10-08 腾讯数码(天津)有限公司 Monitoring method, device and system based on distributed system

Also Published As

Publication number Publication date
CN106411547A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
CN106980669B (en) Data storage and acquisition method and device
CN111737127B (en) Method and apparatus for testing map services
CN108228814B (en) Data synchronization method and device
CN106599104B (en) Massive data association method based on redis cluster
CN104750469B (en) Source code statistical analysis technique and system
US10922216B1 (en) Intelligent automation test workflow
CN109683826A (en) Expansion method and device for distributed memory system
CN112527899A (en) Data synchronization method, device, equipment and storage medium
AU2018200693A1 (en) Method and design for automated testing system
US10216774B2 (en) Multiple versions of triggers in a database system
CN103678446B (en) Improved mode map based on Data View and database table
CN105637488A (en) Tracing source code for end user monitoring
CN103176892A (en) Page monitoring method and system
CN110334086A (en) Data duplicate removal method, device, computer equipment and storage medium
CN111698326B (en) Method and device for determining cost attribution of cloud service resources
CN113886485A (en) Data processing method, device, electronic equipment, system and storage medium
CN105740042B (en) The management method and management system of virutal machine memory
US10931504B2 (en) Abstraction layer for streaming data sources
CN114386853A (en) Data auditing processing method, device and equipment based on universal auditing model
US11157267B1 (en) Evaluation of dynamic relationships between application components
CN106411547B (en) A kind of redis calls monitoring method and device
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
CN110536283A (en) Terminal identifier acquisition method, device, electronic equipment and medium
CN109144489B (en) State data processing method based on Yang language model
US10769129B2 (en) Efficient thread-safe tracking of function usage in distributed-processing systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant