Article Tags
How to use the HyperLogLog data type in Redis

How to use the HyperLogLog data type in Redis

1. Principle of HyperLogLog RedisHyperLogLog estimates the cardinality based on a probabilistic algorithm called the HyperLogLog algorithm. HyperLogLog uses a bit array of length m and some hash function to estimate the number of unique elements in the collection. In the HyperLogLog algorithm, each element is hashed, and after the hash value is converted into binary, each element is scored according to the number of 1's in the binary string prefix. For example, if the hash value of an element is 01110100011, then the number of 1's in the prefix is ​​3, so in the HyperLogLog algorithm, the score of this element is 3. When the scores of all elements are counted,

May 29, 2023 am 09:29 AM
redis hyperloglog
How to use RedisLive to monitor Redis server

How to use RedisLive to monitor Redis server

RedisLive is an open source graphical monitoring tool written in python. It is very lightweight. The core service part only includes a web service and a monitoring service based on the info command and monitor command that come with redis. The interface only has a BootStrap-based The web interface is very simple and clear. In addition, it also supports multi-instance monitoring, easy switching, and very easy to configure. Monitoring information supports redis storage and persistent storage (sqlite). Install RedisLive using Python and use Tornado as its own web server. No additional compilation is required to run RedisLive

May 29, 2023 am 09:20 AM
redis redislive
How to connect golang redis client

How to connect golang redis client

Implemented the redis client, including a connection pool and redispiplelineconn.gofunc(c*conn)Do(cmdstring,args...interface{})(interface{},error){ifcmd!=""{iferr:=c. writeCommand(cmd,args);err!=nil{returnnil,c.fatal(err)}}iferr:=c.bw.Flush();err!=nil{returnnil,c.fatal(err)}fori:= 0;

May 29, 2023 am 09:14 AM
Golang redis
How to solve the memory leak error caused by using lettuce to start redis

How to solve the memory leak error caused by using lettuce to start redis

Redis uses lettuce and LEAK:hashedwheelTimer.release()wasnotcalledbeforeit'sgarbage-collected.Enableadvancedleak memory leaks. In fact, it is caused by insufficient memory. Find window->preferences->Java->InstalledJRE in eclispe, click the Edit button on the right, and fill in the following values ​​in the "DefaultVMArguments" option in the editing interface. -Xms64m-Xmx

May 29, 2023 am 09:01 AM
redis lettuce
How to install and configure Redis in CentOS7

How to install and configure Redis in CentOS7

Install, decompress and enter the directories tarxzfredis-4.0.12.tar.gz, cdredis-4.0.12/; compile to the specified directory makeprefix=/usr/local/redisinstall to create the /usr/local/redis/ect directory, and change redis.conf Copy the /usr/local/redis directory structure as follows. Add redis to the system service and execute vim/usr/lib/systemd/system/redis-server.service. The content is as follows [unit]description=theredis-s

May 29, 2023 am 08:53 AM
redis centos7
How SpringBoot AOP Redis implements delayed double deletion function

How SpringBoot AOP Redis implements delayed double deletion function

1. Business scenario In the case of multi-thread concurrency, assume that there are two database modification requests. In order to ensure the data consistency between the database and redis, the implementation of the modification request requires modifying the database and then cascadingly modifying the data in Redis. Request 1: A modifies database data B modifies Redis data Request 2: C modifies database data D modifies Redis data In a concurrent situation, there will be a situation of A—>C—>D—>B (must understand that threads execute multiple groups of atoms concurrently There may be overlap in the order of operation execution) 1. The problem at this time is that A modified the database data and finally saved it in Redis.

May 29, 2023 am 08:53 AM
redis SpringBoot aop
How SpringBoot integrates Redis to serialize and store Java objects

How SpringBoot integrates Redis to serialize and store Java objects

1. Background 1. Thinking Through our previous study, we can already store strings in Redis, so what should we do if we want to store Java objects in Redis? 2. Solution: We can convert Java objects into JSON objects, then convert them into JSON strings, and store them in Redis. Then when we take out the data from Redis, we can only take out the strings and convert them into Java objects. This Does a series of operations seem a bit troublesome? 2. Source code analysis The above is the source code fragment in the RedisAutoConfiguration class. It can be seen that when SpringBoot automatically configures Redis, it injects redisTe into the container.

May 29, 2023 am 08:43 AM
Java redis SpringBoot
How to build fastdfs service and stand-alone redis service

How to build fastdfs service and stand-alone redis service

To build the fastdfs service, you must first install the gcc compiler: yum-yinstallgcc-c++ to install the lib dependency package tar-zxvfV1.0.43.tar.gzcdlibfastcommon-1.0.43./make.sh./make.shinstallln-s/usr/lib64/libfastcommon .so/usr/local/lib/libfastcommon.soln-s/usr/lib64/libfastcommon.so/usr/lib/libfastcommon.soln-

May 29, 2023 am 08:40 AM
redis fastdfs
How to install Redis and Tomcat under Centos

How to install Redis and Tomcat under Centos

Install Redis and Tomcat on the server. Prepare to install Redis by executing the following command on the server to download the Redis compressed package. You can ignore the first two steps. Just choose a suitable directory: mkdir/root/redis (create a new directory as the installation directory of Redis). cd/root/redis (enter this directory) wgethttps://download.redis.io/releases/redis-6.0.13.tar.gz (download the Redis compressed package to the currently opened directory) or select the appropriate one here version and place it on the server. After the decompression and download are complete, execute the following command: ta

May 29, 2023 am 08:25 AM
redis CentOS tomcat
How to install Redis on Centos7

How to install Redis on Centos7

Introduction Redis is an open source (BSD licensed), in-memory data structure store used as a database, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperlogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripts, LRU evictions, transactions and different levels of disk durability, and provides high availability through RedisSentinel and automatic partitioning using RedisCluster. What is redis? Memory-based key-value database supports automatic/manual persistence. Performance: The following is the official benchmark-mark data: the test completed 50 and

May 29, 2023 am 08:14 AM
redis centos7
How to use Redis+Lua script to implement the anti-swipe function of the counter interface

How to use Redis+Lua script to implement the anti-swipe function of the counter interface

[Implementation process] 1. Problem analysis If the set command is set, but when setting the expiration time, the setting is not successful due to network jitter and other reasons, then a dead counter (similar to a deadlock) will appear; 2. Solution Redis+Lua It is a good solution. Use a script to make the set command and the expire command work together so that Redis is executed without being interfered with. This guarantees atomic operations to a large extent. Why is it said that it guarantees atomic operations to a large extent rather than completely? ensure? Because problems may occur when Redis is executed internally, but the probability is very small; even for small-probability events, there are corresponding solutions, such as solving deadlocks. An idea worth referring to: To prevent deadlocks, the value of the lock will be stored in

May 28, 2023 pm 11:32 PM
redis lua
How to implement the bottom layer of Redis linked list

How to implement the bottom layer of Redis linked list

The underlying implementation of Redis's list data structure is based on a doubly linked list. A doubly linked list is a common data structure that consists of a series of nodes. Each node is represented by a listNode structure, which contains a pointer prev pointing to the previous node, a pointer next pointing to the next node and a storage A pointer to value value. In Redis, each node represents an element, and the nodes are connected through pointers to form a doubly linked list. The advantage of a doubly linked list is that insertion and deletion operations can be performed quickly at the head and tail. In Redis, when a new element is inserted into the head or tail of the List, you only need to modify the prev and ne of the new node.

May 28, 2023 pm 10:46 PM
redis
What are the problems encountered in redis replication?

What are the problems encountered in redis replication?

After using the salveof command, I cannot see data synchronization for a long time, thinking that the replication function has failed or the configuration is wrong. Don't worry, there are two ways to determine whether replication is being established. When creating redis replication, you may find that the slave does not start to synchronize data for a long time. The amount of data may be too large, causing the master to dump data slowly. At this time, you can execute top-p${pgrep-d,redis on the master. -sever} command, you can see the dump process. [root@img1_u~]#top-p$(pgrep-d,redis-server)top-14:06:24up54days,6

May 28, 2023 pm 10:43 PM
redis
What is the principle of Redis data structure?

What is the principle of Redis data structure?

RedisDbRedis server has 16 databases by default, and one database corresponds to one RedisDB data structure. typedefstructredisDb{dict*dict;dict*expires;dict*blocking_keys;dict*ready_keys;dict*watched_keys;......}dict: key space hash table, used to store all key-value pairs expires: expiration time hash table, Store the expiration time of keys blocking_keys: keys in blocked state and corresponding clientready_keys: keys in unblocked state and corresponding

May 28, 2023 pm 10:26 PM
redis

Hot tools Tags

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Hot Topics

Java Tutorial
1677
14
PHP Tutorial
1279
29
C# Tutorial
1257
24