Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Redis performance indicator monitoring

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to understand Redis performance indicator monitoring". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand Redis performance indicator monitoring".

Monitoring index

Performance indicator: Performance

Memory Metric: Memory

Basic activity indicator: Basic activity

Persistence indicator: Persistence

Error indicator: Error

Monitoring mode

Redis-benchmark

Redis-stat

Redis-faina

Redislive

Redis-cli

Monitor

Showlog

Get: get slow query log

Len: get the number of slow query log entries

Reset: reset the configuration related to slow query logs:

Slowlog-log-slower-than 1000 # set slow query time offline (in microseconds) slowlog-max-len 1000 # set log display length corresponding to slow query command, unit: number of commands copy code

Info (you can get all the information at once or by block)

Server: the environment parameter in which the server is running

Clients: client related information

Memory: server running memory statistics

Persistence: persistent information

Stats: general statistics

Replication: master-slave replication related information

CPU:CPU usage

Cluster: cluster information

Keypass: statistical quantity information of key-value pairs

Terminal info command usin

. / redis-cli info gets information by block | parameters to be filtered by grep. / redis-cli info stats | grep ops copy code

Interactive info commands use the

. / redis-cli > info server copy code

Performance monitoring

Redis-cli info | grep ops # copy code by operations per second

Memory monitoring

[root@CombCloud-2020110836 src] #. / redis-cli info | grep used | grep human used_memory_human:2.99M # Total memory allocated by the memory allocator from the operating system used_memory_rss_human:8.04M # memory footprint seen by the operating system Peak memory used_memory_peak_human:7.77M # redis memory consumption seen by the top command used_memory_lua_human:37.00K # amount of memory consumed by the lua script engine copy code

Clients that are blocked due to BLPOP,BRPOP,or BRPOPLPUSH

[root@CombCloud-2020110836 src] #. / redis-cli info | grep blocked_clients blocked_clients:0 copy code

The number of key removed due to the maximum memory limit

[root@CombCloud-2020110836 src] #. / redis-cli info | grep evicted_keys evicted_keys:0 # copy code

Memory fragmentation rate

[root@CombCloud-2020110836 src] #. / redis-cli info | grep mem_fragmentation_ratio mem_fragmentation_ratio:2.74 copy code

Memory used

[root@CombCloud-2020110836 src] #. / redis-cli info | grep used_memory: used_memory:3133624 copy code

Basic activity index

How many clients are connected by redis you can confirm whether there are unexpected connections by observing their number. If you find something wrong with the quantity, you can use the lcient list directive to list all the client link addresses to determine the source.

[root@CombCloud-2020110836 src] #. / redis-cli info | grep connected_clients connected_clients:1 [root@CombCloud-2020110836 src] #. / redis-cli info | grep connected connected_clients:1 # number of client connections connected_slaves:1 # number of slave connections copy code

Persistence index

[root@CombCloud-2020110836 src] #. / redis-cli info | grep rdb_last_save_time rdb_last_save_time:1591876204 # timestamp of the last persistent storage disk [root@CombCloud-2020110836 src] # / redis-cli info | grep rdb_changes_since_last_save rdb_changes_since_last_save:0 # copy code for database changes since the last persistence

Error index

The number of client connections rejected due to exceeding the maximum Dalian connection limit. If this number is large, it means that the maximum number of connections for the server is set too low and the maxclients needs to be adjusted.

[root@CombCloud-2020110836 src] #. / redis-cli info | grep connected_clients connected_clients:1 copy code

Key value lookup failed (not hit) number of times, may be caused by hei ke gong ji

[root@CombCloud-2020110836 src] #. / redis-cli info | grep keyspace keyspace_misses:0 copy code

Duration of master-slave disconnection (in seconds)

[root@CombCloud-2020110836 src] #. / redis-cli info | grep rdb_changes_since_last_save rdb_changes_since_last_save:0 copy code

If the copy backlog buffer is set too small, it will cause the instructions inside to be overwritten and the offset cannot be found, thus triggering full synchronization

[root@CombCloud-2020110836 src] #. / redis-cli info | grep backlog_size repl_backlog_size:1048576 copy code

Determine whether the backlog buffer needs to be enlarged by looking at the number of times the sync_partial_err variable, which represents the number of master-slave semi-synchronous replication failures

[root@CombCloud-2020110836 src] #. / redis-cli info | grep sync_partial_err sync_partial_err:1 copy code

Code redis performance test command

/ redis-benchmark-c 100-n 5000 copy code

Description: performance corresponding to 5000 connections and 5000 requests.

Thank you for your reading. the above is the content of "how to understand Redis performance indicator Monitoring". After the study of this article, I believe you have a deeper understanding of how to understand Redis performance indicator monitoring, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report