• How Python implements IP proxy pool based on redis


    This article mainly introduces how Python implements the IP proxy pool based on redis. The example code is introduced in detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it The apscheduler library is used to crawl IP regularly, detect IP regularly, delete IP, and […]

  • PHP implementation of redis message publishing and subscription


    Basic introduction Publish / subscribe (means publish, subscribe) is the function of publish and subscribe In event based systems, pub / sub is a widely used communication model. It uses events as the basic communication mechanism to provide the loosely coupled interaction mode required by large-scale systems: the subscriber (such as the client) expresses an […]

  • Installation and use of redis extension under mac


    preface Redis is a high-performance key value database. The emergence of redis, to a large extent, compensates for the lack of key / value storage such as memcached. In some cases, it can play a good complementary role in relational database. Using ANSI C language to write, support network, can be based on memory or […]

  • Analysis of the life cycle of redis command execution


    baiyan introduce First of all, let’s take a look at the redis command execution diagram that we are very familiar withConsider this question. After connecting to the redis server, enter and execute a redis command, such as set key1 value1. How is this command sent to the redis server? How does the redis server parse, […]

  • PHP uses redis to solve the problem of oversold


    preface In the event of the second killing of goods, for example, the inventory of goods is only 100, but in the rush purchase activity, 200 people may rush to buy at the same time, so there is concurrency. If the order of 100 goods is completed and the inventory is 0, it may continue […]

  • Analysis of del of redis command


    baiyan Command syntax Command meaning: delete the value corresponding to a keyCommand format: DEL [key1 key2 …] Command actual combat:> del key1 (integer) 1 Return value: the number of deleted keys Source code analysis First, we open a redis client and use the port of GDB – P redis server. Since the processing function […]

  • Analysis of dump of redis command


    Grape Official documents DUMP keySerialize the given key and return the serialized value. Use the restore command to deserialize the value to the redis key.The values generated by serialization have the following characteristics: It has 64 bit checksums for error detection, and restore checks the checksums before deserializing. The encoding format of the value is […]

  • How to realize the function of robbing red packets through the script Lua of redis


    Redis script introduction Redis starts from version 2.6 and supports Lua environment through embedded benefit Reduce network overhead. Multiple requests can be sent in the form of scripts at one time to reduce network delay Atomic operation. Redis will execute the whole script as a whole, and it will not be inserted by other commands […]

  • Using redis to realize the ranking function of wechat steps


    1. Preface I wrote a blog before, which explained the five data structures of redis and their common commands. At that time, readers commented that they wanted to understand the use scenarios of the five data structures, but they didn’t have time to write. As it happens, when I was interviewing for a job in […]

  • Summary of redis data deletion strategy and eviction algorithm


    Data storage and validity stayredis In workflow, expired data does not need to be deleted immediately. Because these deletions are only a state representation, you canasynchronousTo deal with, when not busy to do these not urgent delete operations, so as to ensureredisHigh efficiency Data storage In redis, data storage not only needs to save the […]

  • [redis5 source code learning] analysis of keys of redis command


    baiyan Command syntax Command meaning: find and return all the keys that match the given pattern patternCommand format: KEYS pattern Command actual combat:> keys * 1) “kkk” 2) “key1” Return value: the set of all keys matched according to pattern Source code analysis The corresponding processing function of keys command is keyscommand(): void keysCommand(client […]

  • [redis5 source code learning] analysis of the expire part of redis command


    Grape Command syntax Command meaning: set the time to live for a given key. When the key expires (the time to live is 0), it will be deleted automatically.Command format: EXPIRE key seconds Command actual combat: redis> EXPIRE cache_ Page 30000 update expiration time (integer) 1 Return value: Setting successfully returned 1.When the key does […]