current location:Home > Technical Articles > Database > Redis
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- Redis cluster instance analysis
- 1. WhyK8s1. Resource isolation. The current RedisCluster is deployed on a physical machine cluster. In order to improve resource utilization and save costs, Redis clusters of multiple business lines are mixed. Because there is no CPU resource isolation, it often happens that the CPU usage of a Redis node is too high, causing other Redis cluster nodes to compete for CPU resources, causing delay jitter. Because different clusters are mixed, such problems are difficult to locate quickly and affect operation and maintenance efficiency. K8s containerized deployment can specify CPUrequest and CPUlimit, which improves resource utilization and avoids resource contention. 2. Automated deployment The current deployment process of RedisCluster on physical machines is very cumbersome.
- Redis 1966 2023-06-04 08:21:01
-
- How to configure sequence and deserialization of RedisTemplate in Redis
- RedisTemplate configuration sequence and deserialization For redis operations, springboot has a good encapsulation, that is springdataredis. A highly encapsulated RedisTemplate class is provided to perform a series of redis operations, and the connection pool is automatically managed; at the same time, the transaction encapsulation operation is handed over to the container for processing. For the "serialization and deserialization" of data, multiple strategies (RedisSerializer) are provided. The default is to use JdkSerializationRedisSerializer, as well as StringRedisSerializer and JacksonJsonR.
- Redis 1828 2023-06-03 21:25:08
-
- What are the methods of using Redis integer collection?
- 1. Overview of Sets For sets, I believe everyone is familiar with STL's set. Its underlying implementation is a red-black tree. Regardless of insertion, deletion, or search, the time complexity is O(logn). Of course, if a hash table is used to implement a collection, insertion, deletion, and search can all reach O(1). So why does the collection use red-black trees and not hash tables? I think the biggest possibility is based on the characteristics of the set itself. The set has its own unique operations: intersection, union, and difference. These three operations are all O(n) for hash tables. Based on this, it is more appropriate to use an ordered red-black tree than an unordered hash table. 2. Redis integer set (intset) The integer set we are going to talk about today, also called intset, is Redis
- Redis 1189 2023-06-03 21:18:54
-
- What is the command to check the redis version in Linux?
- Two commands to check the redis version on Linux 1, redis-server–version and redis-server-v2, redis-cli–version and redis-cli-v
- Redis 3546 2023-06-03 20:58:01
-
- How does redis realize real-time page updates and automatic online updates?
- Requirement description: Some pages need to be configured with advertisements or event promotion images. Advertisements or activities need to be able to go online and offline at any time, automatically go offline after expiration, and automatically go online when the time comes. For example: the current time is 2019-2-2216:16:13. You need to configure the reward collection activity on the payment completion page. The activity must be online on time at 2019-3-1000:00:00 and end at 2019-3-3023:59:59. Activity. So the desired effect is that after configuring the activity at any time before the activity goes online, the page will automatically go online when the time comes. There may also be multiple other activities or advertisements. The number of advertisements on each page is variable, and the online and offline times may be different for different pages. Other pages also need to implement such functions, and the activities between pages are not necessarily the same. demand points
- Redis 1505 2023-06-03 20:56:17
-
- Redis cache example code analysis
- 1. Introduction 1. Scenario Since the data dictionary does not change very frequently, and the system accesses the data dictionary more frequently, it is necessary for us to store the data in the data dictionary in the cache to reduce database pressure and improve access speed. Here, we use Redis as the distributed cache middleware of the system. 2. RedisTemplate In the SpringBoot project, SpringDataRedis is integrated by default. SpringDataRedis provides a very convenient operation template for Redis, RedisTemplate, and can automatically manage the connection pool. 2. Introduce Redis1 and integrate the Redisservice-base module into the project.
- Redis 1661 2023-06-03 20:37:56
-
- How to solve Redis buffer overflow
- Buffer is a part of memory space. In other words, a certain amount of storage space is reserved in the memory space. These storage spaces are used to buffer input or output data. This reserved space is called a buffer. 1. Impact of Redis buffer overflow In Redis, there are three main scenarios where the concept of buffer is used. When communicating between the client and the server, it is used to temporarily store the command data sent by the client, or the data results returned by the server to the client. When synchronizing data between the master and slave nodes, Redis uses the buffer to temporarily store When the write commands and data received by the master node are persisted in AOF by Redis, Redis also uses the concept of buffer to avoid frequent disk writes.
- Redis 1340 2023-06-03 20:13:41
-
- How to correctly set the configuration parameters of mongodb and redis development environment and production environment
- When we write code, we usually develop it on our own computer first, and then deploy the code to the server. If a piece of code involves reading and writing a database, or accessing some other online service interfaces, then during development, in order not to affect the online environment, we usually separate the database in the test environment and the database in the online environment. For example, our program needs to access MongoDB and Redis, so in the code, we may write like this: importpymongoimportredishandler=pymongo.MongoClient('mongodb://username:password@127.0.0.
- Redis 1674 2023-06-03 20:04:15
-
- How to analyze Redis knowledge points
- It is a data structure rather than a type. Many articles will say that redis supports 5 commonly used data types. This is actually a big ambiguity. All binary data stored in redis is actually a byte array (byte[]). These byte data have no data type. They can only be turned into a string, integer or object after decoding them in a reasonable format. , only then does it have a data type. This must be remembered. So anything that can be converted into a byte array (byte[]) can be stored in redis. No matter if it is a string, number, object, picture, sound, video, or file, just change it into a byte array. Therefore, String in redis does not refer to a string, it actually means
- Redis 1281 2023-06-03 20:02:11
-
- What is the installation method of Redis6 under Centos7?
- Installation environment: centos7.9, redis6.0.8 nanny-level installation tutorial 1. Download the Redis compressed package from the Internet wgethttp://download.redis.io/releases/redis-6.0.8.tar.gz2. Unzip tar-xfredis-6.0 .8.tar.gz3. Enter the decompressed folder cdredis-6.0.84 and compile redismake#compile redis. If you find that the final compilation fails, check the gcc version and execute the following commands in order to upgrade the gcc version yum-yinstallcentos-release-
- Redis 2306 2023-06-03 19:19:25
-
- Springboot integrated redis instance analysis
- Import the redispom file org.springframework.bootspring-boot-starter-data-redis and write the redis configuration spring:redis:password:port:6379host:localhostdatabase:0jedis:pool:##The maximum number of connections in the connection pool (use a negative value to indicate no limit) #spring.redis.pool.max-active=8max-active:8##The maximum blocking waiting time of the connection pool (use a negative value to indicate no limit) #spring.redis.pool.
- Redis 1063 2023-06-03 19:07:02
-
- How Redis distributed lock prevents cache breakdown
- The difference between cache penetration and cache penetration is that cache penetration refers to hot data that is not in the cache but exists in the database. For example: hot news on the homepage, hot data with a very large number of concurrent visits, if the cache expires and becomes invalid, the server will query the DB. At this time, if a large number of concurrent queries are made to the DB, the DB may be overwhelmed instantly. I drew a simple diagram, as shown below: Solution: DB query plus distributed lock. Before solving the problem without locking, let's take a look at the code and operation status of the unprocessed code. The product details query code based on the product ID clears the Redis cache, and opens 5 threads for concurrent access testing. The test code is as follows: We expect that the DB will only be queried once, and the next 4 queries will be fetched from the Redis cache, but the result is:
- Redis 1797 2023-06-03 19:04:37
-
- How to use redis+python as a message queue
- 1. Use the List type of redis combined with lpush and brpop to implement the introduction. First, the List of redis is equivalent to a queue, which can implement the first-in-first-out rule. brpop is used because when there is nothing in the queue, it will block until there is something in the queue that can be popped. Element or wait timeout simulation problem: too many accesses, the server processing speed is too slow, if the server feedback every time the user waits, the time is too long, the http connection times out, and a server error occurs. Simulation implementation process: There is a client that continuously puts things (data) into the queue, using multi-threading to simulate a large number of user access situations. There is a server that continuously takes out prints from the queue, and sets the redis sleep time of 2 seconds for each print time. Lis
- Redis 2080 2023-06-03 18:24:01
-
- How to implement redis distributed lock in python
- 1importtime2importredis3fromredis.exceptionsimportWatchError456classRedisUtil():7def__init__(self):8self.redis=redis.Redis(host="redis account url",9port=6379,10password="your redis password",11decode_responses=True)12self.online_set_name="pa
- Redis 1697 2023-06-03 18:22:36
-
- How SpringBoot uses AOP+Redis to prevent repeated submission of forms
- Configure Redis1. Add Redis dependency org.springframework.bootspring-boot-starter-data-redis2. Add redis configuration information redis:host:127.0.0.1port:6379database:0password: #Connection timeout timeout:10s Configure AOP1. Custom annotations /***Annotations to prevent repeated submission of forms*/@Target(ElementType.METHOD)//The annotation targets the method @Retention(RetentionPolicy.RUNTI
- Redis 1277 2023-06-03 18:10:04