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-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "what are the performance monitoring indicators of Redis". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What are the performance monitoring indicators of Redis"!

monitoring index

Performance indicators: Performance

Memory indicators: Memory

Basic activity indicators: Basic activity

Persistence indicator: Persistence

Error indicator: Error

Performance indicators: Performance

Memory indicators: Memory

Basic activity indicators: 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 slow query log

Related configuration:

slowlog-log-slower-than 1000 #Set the time for slow query to go offline, unit: microsecond slowlog-max-len 100 #Set the log display length corresponding to slow query command, unit: number of commands

info (information can be obtained all at once or in blocks)

server: environment parameters in which the server operates

clients: client-related information

memory: Server running memory statistics

persistence: persistent information

stats: general statistics

Replication: information about master-slave replication

CPU: CPU usage

cluster: cluster information

Keypass: Key-value pair statistics quantity information

terminal info command used

./ redis-cli info Get information by block| grep Parameters to filter./ redis-cli info stats | grep ops

interactive info command using

#./ 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 #Total memory allocator allocates from OS used_memory_rss_human:8.04M #Memory footprint seen by OS, memory seen by top command used_memory_peak_human:7.77M # redis Peak memory consumption used_memory_lua_human:37.00K # Lua script engine memory size

Clients blocked due to BLPOP,BRPOP,or BRPOPLPUSH

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

Number of keys removed due to maximum memory limit

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

memory fragmentation rate

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

used memory

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

Basic activity indicators:

How many clients redis connected to You can confirm if there are unexpected connections by looking at the number. If the quantity is found to be incorrect, you can use the lcient list directive to list all 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 connectedconnected_clients:1 #Number of client connections connected_slaves:1 # slave number of connections

Persistence indicators:

[root@CombCloud-2020110836 src]# ./ redis-cli info |grep rdb_last_save_timerdb_last_save_time:1591876204 #timestamp of last persistent save disk [root@CombCloud-2020110836 src]# ./ redis-cli info | grep rdb_changes_since_last_saverdb_changes_since_last_save:0 #Number of database changes since last persisted

error indicator

The number of client connections rejected because the maximum number of connections was exceeded. If this number is high, it means that the maximum number of connections to the server is set too low and maxclients needs to be adjusted.

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

Key value search failed (no hit) times, multiple times may be hei ke gong ji

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

Duration of master-slave disconnection (in seconds)

[root@CombCloud-2020110836 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 in it to be overwritten and no offset can be found, thus triggering full synchronization.

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

Determine if you need to expand the backlog buffer by looking at the number of times the sync_partial_err variable indicates the number of master-slave replication failures

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

redis performance test command

./ redis-benchmark -c 100 -n 5000

Description: 100 connections, 5000 requests corresponding to performance.

At this point, I believe everyone has a deeper understanding of "what are the performance monitoring indicators of Redis". Let's do some actual operation! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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

Internet Technology

Wechat

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

12
Report