Redis data expiration processing method and apparatus

A data and processor technology, applied in the Internet field, can solve the problems of redis performance impact, performance degradation, redis performance degradation, etc., and achieve the effect of improving concurrent performance, reducing performance impact, redis performance and optimization

Inactive Publication Date: 2018-06-01
台州市吉吉知识产权运营有限公司
View PDF1 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, there are still deficiencies. For example, the above scheme still implements the expired cleaning function based on the ttl parameter of the redis key, and the way redis itself handles ttl has a great impact on redis performance, and when a redis key is configured with a ttl time, then redis will generate a The timer is bound to the key object. If there are a large number of keys configured with ttl, a large number of timers will be generated, resulting in a decrease in redis performance. In addition, when performing timeout processing, some extreme scenarios may be encountered. At a certain moment If a large number of key ttls expire, the deletion operation will be triggered at the same time, which will cause an instantaneous drop in performance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Redis data expiration processing method and apparatus
  • Redis data expiration processing method and apparatus
  • Redis data expiration processing method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] Based on the existing ttl mechanism, the present invention proposes an alternative solution, reduces the dependence of redis on the original ttl mechanism, and optimizes redis performance and memory usage.

[0041] ttl (Time To Live, time to live), which is set by the sending host, this field specifies the maximum number of network segments allowed to pass before the IP packet is discarded by the router, so as to prevent the data packet from continuously looping endlessly on the IP Internet. When the time set by the ttl of a certain key is up, the key will be invalidated, that is, deleted.

[0042] Redis is an open-source log-type, Key-Value database written in ANSI C language, supporting network, memory-based and persistent, and provides APIs in multiple languages. It uses the redis- trib.rb can complete the operation of creating a cluster. redis-trib.rb is a Redis cluster management program developed using ruby. It can create clusters, check the online status of clust...

Embodiment 2

[0056] This embodiment is similar to Embodiment 1, except that in this embodiment, in step S3, the deletion operation is performed according to the priority of each deletion operation request based on the priority scheduling algorithm.

[0057] The priority scheduling algorithm refers to:

[0058] 1. When the algorithm is used for job scheduling, the system selects several jobs with the highest priority from the background job queue, and the jobs that the system can meet the resource requirements are loaded into the memory to run;

[0059] 2. When the algorithm is used for process scheduling, the processor will be assigned to the process with the highest priority in the ready queue.

[0060] The prior art method is used in the priority scheduling algorithm, which will not be described in detail here.

[0061] Specifically, the priority arrangement of each deletion operation request includes:

[0062] Each delete operation request is prioritized according to the data of diffe...

Embodiment 3

[0066] A device for redis data expiration processing based on the redis data expiration processing method of embodiment one or embodiment two, including a processor 1, and the processor 1 includes a listening module 11 and a deletion operation request module 12 connected to each other in sequence , query module 13 and deletion module 14, wherein,

[0067] Monitoring module 11, used for performing monitoring service to etcd;

[0068] A delete operation request module 12, configured to initiate a delete operation request to redis when the monitoring module detects that at least one key triggers an expiration event;

[0069] Query module 13, for querying the redis node where the key triggering the expiration event is located;

[0070] The delete module 14 is configured to perform a delete operation on the key that triggers the expiration event.

[0071] Further, the processor 1 also includes a registration module 15, and the registration module 15 is configured to register the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The present invention belongs to the technical field of Internets, and in particular relates to a redis data expiration processing method and apparatus. The method comprises the following steps that:S1: the etcd provides a mapped directory, and registers the redis key in the directory; S2: a monitoring service is initiated to the etcd, and a delete operation request is initiated to the redis whenit is detected that there is at least one key trigger expiration event; and S3: a redis node where the key that triggered the expiration event is located is queried, and a delete operation for deleting the key is performed on the node. The technical scheme of the present invention has the advantages that the performance of optimizing the redis can be improved, the user experience can be enhancedand the like.

Description

technical field [0001] The invention belongs to the technical field of the Internet, and in particular relates to a method and a device for redis data expiration processing. Background technique [0002] With the rapid development of information technology, the amount of information in modern society is growing explosively. In the era of big data, the volume of application data is increasing rapidly. The traditional data architecture can no longer meet the high concurrency, high availability, and high-quality response time of large-scale Internet applications. . As a result, a series of solutions such as NoSQL have emerged, among which Redis, as one of the high-quality choices, has gradually been adopted by major enterprises as a supplement to their data architecture. [0003] At present, the company's online business handles redis expired keys mainly through the ttl parameter. Although such an operation is simple, when a large number of keys expire at the same time, batch ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/215
Inventor 庄哲伟
Owner 台州市吉吉知识产权运营有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products