In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
I. process
Ps-ef | grep redis-serverredis13 2348 1 1 Jul18? 06:57:42 redis-server 192.168.18.85:6388redis02 3472 13 Jan10? 7-02:03:45 / home/redis02/redis/bin/redis-server 192.168.18.85 purge 6384 redis02 4515 14 Jan10? 8-13:19:32 / home/redis02/redis/bin/redis-server 192.168.18 .85 redis02 5360 1 3 Jan10? 6-17:10:42 / home/redis02/redis/bin/redis-server 192.168.18.85 redis02 6285 1 3 Jan10? 6-12:31:38 / home/redis02/redis/bin/redis-server 192.168.18.85
2. Start command
. / redis-cli-h 192.168.18.85-p 6384
III. Basic commands
# View the keyskeys "miao*" of the matching prefix # randomly take a keyrandomkey# to view the type of key, type key# to view the number of key in the database, dbsize# to view server information, info# to see what redis is doing, monitor# to view all keykeys * or keys "*" # clear redisflushdb# to get the key value get key
IV. Important health indicators of Redis
[0] slow log: ①, get the slowlog collection executed by Redis through the command [slowlog get]. Ideally, the slowlog collection should be empty, that is, there are no slow logs.
②, if you find slow commands, you should analyze whether it is normal and need to be optimized one by one.
192.168.17.46 6386 > slowlog get
1) 1) (integer) 22
2) (integer) 1563344158
3) (integer) 10193
4) 1) "SET"
2) "getBatchChapterFiles"
3) "\ x0b\ xfa\ 529:\ t489761532B\ x02-1J\ t48976181... (1293 more bytes)"
[1] Survival: it is the most important health indicator, which is judged by whether the response of the command PING is PONG.
~ / redis/bin >. / redis-cli
127.0.0.1 purl 6379 > ping
PONG
[2] number of connections: ①, number of clients connected, [redis-cli info Clients | grep connected_clients]. This value is closely related to the connection pool configuration using Redis service. If this value is large, you need to troubleshoot the cause of the problem. ② and another number of rejected connections (rejected_connections) also need to be concerned, which is ideally 0. If it is greater than 0, the number of connections created is greater than maxclients, and you need to troubleshoot the reason. Whether the Redis connection pool is unreasonable or whether there are too many services connecting to this Redis.
[3] number of blocking clients: blocked_clients is usually caused by executing BLPOP or BRPOP commands of list data type, which can be obtained by [redis-cli info Clients | grep blocked_clients]. This value should be 0 at best.
[4] use peak memory: ①, monitor the peak memory usage of Redis, and set the maximum allowed memory by using the command [config set maxmemory]. ②, in order to prevent swap from causing a sharp decline in Redis performance, or even system kill due to excessive memory use, it is recommended that there is a safe range between the value of used_memory_peak (peak memory footprint) and the value of maxmemory, such as 1G.
[5] memory fragmentation rate: ①, mem_fragmentation_ratio = used_memory_rss/use_memory. When the value is greater than 1, the allocated memory exceeds the actual memory used. The higher the value, the more serious the fragmentation rate. When this value is less than 1, swap occurs (the Swap partition frees up part of the physical memory for the currently running program when the physical memory of the system is insufficient), which means that the available memory is insufficient.
One of the main features of ② and Redis4.0 is the problem of optimizing memory fragmentation (Memory de-fragmentation). In the redis.conf configuration file, [ACTIVE DEFRAGMENTATION: defragmentation allows Redis to compress memory space, thereby reclaiming memory. This feature is off by default and can be hot-started by the command CONFIG SET activedefrag yes].
③, this value is of little reference value when the memory usage (use_memory) is very small. Therefore, it is recommended that at least 1G of used_memory should be considered to monitor the memory fragmentation rate.
[6] Cache hit rate: ① and keyspace_misses/keyspace_hits are used to count the cache hit rate. Keyspace_misses value misses, and keyspace_hits represents the number of commands. Keyspace_hits/ (keyspace_misses+keyspace_hits) is the cache hit ratio. ②, if the cache hit rate is too low, check to see if there is any problem with the use of the cache.
[7] OPS:instantaneous_pos_per_sec represents cached OPS (operation per second operations per second)
[8] persistence: whether there is a problem with ①, rdb_last_bgsave_status/aof_last_bgrewrite_status, that is, the last or last RDB/AOF persistence, both values should be "OK". ②, because the child process is fork when Redis is persisted, and fork is a completely blocked process, you can monitor fork time-consuming, that is, latest_fork_usec, in subtle units. If this value is compared, it will affect the business, or even timeout.
[9] invalid KEY: if Redis is used as a cache, it is recommended that all key set the expire attribute. Get the number of key in each db and the attribute of the key with the expire attribute set through the command redis-cli info Keyspace, and expires (indicating the number of key with timeout set) needs to be equal to keys.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.