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

What are the Redis performance monitoring metrics?

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the Redis performance monitoring indicators are, which the editor thinks is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Monitoring index

Performance metrics: Performance memory metrics: Memory basic activity metrics: Basic activity persistence indicators: Persistence error metrics: Error

Performance indicator: Performance

Time for NameDescriptionlatencyRedis to respond to a request instantaneous_ops_per_sec average total number of requests per second hi rate (calculated) cache hit ratio (calculated)

Memory Metric: Memory

NameDescriptionused_memory used memory mem_fragmentation_ratio memory fragmentation rate evicted_keys number of key removed due to maximum memory limit blocked_clients clients blocked due to BLPOP,BRPOP,or BRPOPLPUSH

Basic activity indicator: Basic activity

Number of NameDescriptionconnected_clients client connections number of conected_lavesslave total number of key values in the keyspace database after the last master-slave interaction in master_last_io_seconds_ago

Persistence indicator: Persistence

The last time NameDescriptionrdb_last_save_time persisted the timestamp of the saved disk rdb_changes_sice_last_save the number of changes to the database since the last persistence

Error indicator: Error

Number of connections rejected by NameDescriptionrejected_connections due to maxclient limit keyspace_ miseskey value lookup failed (no hit) number of times master_link_down_since_seconds master-slave disconnection duration (in seconds)

Monitoring mode

Redis-benchmarkredis-statredis-fainaredisliveredis-climonitorshowlog

① get: get slow query logs

② len: get the number of slow query log entries

③ reset: resets slow query logs

Related configuration:

Slowlog-log-slower-than 1000 # sets the offline time for slow query (in microseconds) slowlog-max-len 1000 # sets the log display length corresponding to the slow query command (in number of commands)

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

Server: server running environment parameters clients: client related information memory: server running memory statistics persistence: persistence information stats: general statistics Replication: master-slave replication related information CPU:CPU usage cluster: cluster information Keypass: key-value pair statistical quantity information

Terminal info command usin

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

Interactive info commands use the

#. / redis-cli > info server

Performance monitoring:

Redis-cli info | grep ops # Operations per second

Memory monitoring

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

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

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

The number of key removed due to the maximum memory limit

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

Memory fragmentation rate

[[email protected] src] #. / redis-cli info | grepmem_fragmentation_ratiomem_fragmentation_ratio:2.74

Memory used

[[email protected] src] #. / redis-cli info | grep used_memory:used_memory:3133624

Basic activity indicators:

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_clientsconnected_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

Persistence indicators:

[root@CombCloud-2020110836 src] #. / redis-cli info | grep rdb_last_save_timerdb_last_save_time:1591876204 # timestamp of the last persistent storage disk [root@CombCloud-2020110836 src] # / redis-cli info | grep rdb_changes_since_last_saverdb_changes_since_last_save:0 # the number of changes to the database 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.

[[email protected] src] #. / redis-cli info | grep connected_clientsconnected_clients:1

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

[[email protected] src] #. / redis-cli info | grep keyspacekeyspace_misses:0

Duration of master-slave disconnection (in seconds)

[[email protected] src] #. / redis-cli info | grep rdb_changes_since_last_saverdb_changes_since_last_save:0

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

[[email protected] src] #. / redis-cli info | grep backlog_sizerepl_backlog_size:1048576

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

[[email protected] src] #. / redis-cli info | grep sync_partial_errsync_partial_err:1

Redis performance Test Command

. / redis-benchmark-c 100-n 5000

Description: performance corresponding to 5000 connections and 5000 requests.

So much for sharing what Redis performance monitoring indicators are. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

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