Redis data loss caused by mining program
Publish: 2021-04-22 21:03:21
1. Check if the memory is not enough. If the memory is not enough, redis will recycle the memory, Specific strategies are as follows:
volatile LRU: select the least recently used data from the data set with expiration time set (server. DB [i]. Expires)
volatile TTL: select the data to be expired from the data set with expiration time set (server. DB [I]. Expires)
volatile random: select the data to be expired from the data set with expiration time set (server. DB [i]. Expires) Select any data elimination in
allkeys LRU: select the least recently used data elimination from the data set (server. DB [i]. Dict)
allkeys random: select any data elimination from the data set (server. DB [i]. Dict)
no invitation (expulsion): prohibit the expulsion of data
volatile LRU: select the least recently used data from the data set with expiration time set (server. DB [i]. Expires)
volatile TTL: select the data to be expired from the data set with expiration time set (server. DB [I]. Expires)
volatile random: select the data to be expired from the data set with expiration time set (server. DB [i]. Expires) Select any data elimination in
allkeys LRU: select the least recently used data elimination from the data set (server. DB [i]. Dict)
allkeys random: select any data elimination from the data set (server. DB [i]. Dict)
no invitation (expulsion): prohibit the expulsion of data
2. Find out the redis log, there should be an error message
3. On the one hand, it depends on what
user you use to log in to
and if you are an ordinary user, change the pidfile
directory to the ordinary user's own directory. If it is the root command, the redis. PID will not disappear for no reason.
user you use to log in to
and if you are an ordinary user, change the pidfile
directory to the ordinary user's own directory. If it is the root command, the redis. PID will not disappear for no reason.
4. The data before AOF is turned on will be lost, and the execution of bgrewriteaof is invalid
AOF is a way to record the operation of each command and replace the old record file with a new one. I guess that unless AOF is started, there must be a new key, but the old key has been operated, there will be a record in AOF, which causes this situation.
AOF is a way to record the operation of each command and replace the old record file with a new one. I guess that unless AOF is started, there must be a new key, but the old key has been operated, there will be a record in AOF, which causes this situation.
5. Mongodb is not a type of thing. Compared with memcached, redis has obvious advantages in functions and features. As for performance, the author of redis said that the average performance of a single core is better when a single piece of data is small. The reason for this is that redis runs on a single thread
because it runs on a single thread, the overall performance of memcached is bound to be lower than that of memcached's multithreading
because it runs on a single thread, IO is serialized, network IO and memory io. Therefore, when a single piece of data is too large, the performance will be affected because it needs to wait for all io of a command to complete before subsequent commands
as far as memory usage is concerned, redis currently combines two memory allocators, tcmalloc and jemalloc, which are basically not as good as memcached. If it is a simple and regular key value storage, then it will be surprisingly small in memory usage by using the hash structure of redis, and the advantage is obvious.
because it runs on a single thread, the overall performance of memcached is bound to be lower than that of memcached's multithreading
because it runs on a single thread, IO is serialized, network IO and memory io. Therefore, when a single piece of data is too large, the performance will be affected because it needs to wait for all io of a command to complete before subsequent commands
as far as memory usage is concerned, redis currently combines two memory allocators, tcmalloc and jemalloc, which are basically not as good as memcached. If it is a simple and regular key value storage, then it will be surprisingly small in memory usage by using the hash structure of redis, and the advantage is obvious.
6. (1) The machine performance, IO, CPU, bandwidth, etc. of redis deployment are all OK
(2) the IO, CPU, and load of the server we visit redis are also OK
(3) the mget operation is used to access redis, which can get up to 50 keys at a time to view the slow operation log of redis, The query slow operation caused by mget is very few
(4) is it e to the serious time-consuming problem of accessing redis services and other data resources, because the service also accesses other redis resources, and the time-consuming of other redis is relatively normal, so this problem can be eliminated
(2) the IO, CPU, and load of the server we visit redis are also OK
(3) the mget operation is used to access redis, which can get up to 50 keys at a time to view the slow operation log of redis, The query slow operation caused by mget is very few
(4) is it e to the serious time-consuming problem of accessing redis services and other data resources, because the service also accesses other redis resources, and the time-consuming of other redis is relatively normal, so this problem can be eliminated
7. Use the *. RDB file saved by redis to recover
in addition, redis also has AOF function, which can automatically recover to the previous query when it is started.
in addition, redis also has AOF function, which can automatically recover to the previous query when it is started.
8. On this basis, redis supports various sorting methods. Like memcached, data is cached in memory to ensure efficiency
the difference is that redis will periodically write the updated data to disk or the modification operation to the additional record file, and on this basis, it realizes the master-slave synchronization.
the difference is that redis will periodically write the updated data to disk or the modification operation to the additional record file, and on this basis, it realizes the master-slave synchronization.
9. A mobile phone can only be bound with one number, and a number can only be bound with one mobile phone at the same time. Please send SMS DB #####################################.
Hot content