redis的监控

server/2025/1/11 11:05:14/

1)查看key
>keys *        #查看所有的key,数据量大的时候容易阻塞
>scan 0        #每次获取11个key,直到获取所有的key,编号从0开始,下一次获取时,按照提示的编号输入scan后的值
            当编号再次为0时,获取完成所有数据
[redis@t4-dtpoc-dameng-db-damengdb01-ma01 bin]$ ./redis-cli -a passw0rd

127.0.0.1:6379> keys *
 1) "name1"
 2) "name"
 3) "colour"
 4) "list"
 5) "id"
 6) "mobile"
 7) "money"
 8) "jsj"
 9) "sjaf"
10) "read"
11) "jj"
12) "sss"
127.0.0.1:6379> scan 0
1) "7"
2)  1) "name1"
    2) "name"
    3) "jsj"
    4) "sss"
    5) "colour"
    6) "list"
    7) "sjaf"
    8) "read"
    9) "jj"
   10) "money"
127.0.0.1:6379> scan 7
1) "0"
2) 1) "id"
   2) "mobile"


 
2)redis-cli -a redispwd --stat    #监控redis的状态
[redis@t4-dtpoc-dameng-db-damengdb01-ma01 bin]$ ./redis-cli -a passw0rd --stat
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
------- data ------ --------------------- load -------------------- - child -
keys       mem      clients blocked requests            connections
12         1.01M    1       0       15 (+0)             3
12         1.02M    1       0       16 (+1)             3
12         1.02M    1       0       17 (+1)             3
12         1.03M    1       0       18 (+1)             3
12         1.03M    1       0       19 (+1)             3
12         1.03M    1       0       20 (+1)             3
12         1.02M    1       0       21 (+1)             3
12         1.02M    1       0       22 (+1)             3
12         1.03M    1       0       23 (+1)             3
12         1.03M    1       0       24 (+1)             3
12         1.03M    1       0       25 (+1)             3
12         1.02M    1       0       26 (+1)             3
12         1.02M    1       0       27 (+1)             3
12         1.03M    1       0       28 (+1)             3
12         1.03M    1       0       29 (+1)             3
12         1.03M    1       0       30 (+1)             3
12         1.02M    1       0       31 (+1)             3
12         1.02M    1       0       32 (+1)             3
12         1.03M    1       0       33 (+1)             3
12         1.03M    1       0       34 (+1)             3
      
 
显示多少个key,内存占多少,客户端有多少,请求数是多少,连接数是多少
 
通过增加客户端及key的操作可以发现变化
 
 
3)redis-cli -a redispwd monitor        #监控数据操作
操作的命令,增加,删除等都会监控到

窗口1:
[redis@t4-dtpoc-dameng-db-damengdb01-ma01 bin]$ ./redis-cli -a passw0rd
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> get name
"helloss"
127.0.0.1:6379> set name hellojss
OK
127.0.0.1:6379> set sss ssss
OK
127.0.0.1:6379>

监控窗口:
[redis@t4-dtpoc-dameng-db-damengdb01-ma01 bin]$ ./redis-cli -a passw0rd monitor
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
OK
1736494136.833332 [0 127.0.0.1:18754] "AUTH" "(redacted)"
1736494136.834483 [0 127.0.0.1:18754] "COMMAND" "DOCS"
1736494142.019882 [0 127.0.0.1:18754] "get" "name"
1736494169.016763 [0 127.0.0.1:18754] "set" "name" "hellojss"
1736494177.607515 [0 127.0.0.1:18754] "set" "sss" "ssss"


4)redis-cli -a redispwd info        #查看redis的相关信息
包含Server、Clients、Memory、CPU、Cluster等相关信息

OK
127.0.0.1:6379> info
# Server
redis_version:7.2.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:c488b705d6055300
redis_mode:standalone
os:Linux 4.19.90-23.8.v2101.ky10.aarch64 aarch64
arch_bits:64
monotonic_clock:POSIX clock_gettime
multiplexing_api:epoll
atomicvar_api:c11-builtin
gcc_version:7.3.0
process_id:3028363
process_supervised:no
run_id:ad7a9e88a00580a6cc3cd89f5846c51293c56ade
tcp_port:6379
server_time_usec:1736494259320435
uptime_in_seconds:654
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:8441011
executable:/home/redis/redis/bin/redis-server
config_file:/home/redis/redis/conf/redis.conf
io_threads_active:0
listener0:name=tcp,bind=*,bind=-::*,port=6379

# Clients
connected_clients:2
cluster_connections:0
maxclients:10000
client_recent_max_input_buffer:8
client_recent_max_output_buffer:0
blocked_clients:0
tracking_clients:0
clients_in_timeout_table:0
total_blocking_keys:0
total_blocking_keys_on_nokey:0

# Memory
used_memory:1124880
used_memory_human:1.07M
used_memory_rss:10158080
used_memory_rss_human:9.69M
used_memory_peak:1318840
used_memory_peak_human:1.26M
used_memory_peak_perc:85.29%
used_memory_overhead:903448
used_memory_startup:898768
used_memory_dataset:221432
used_memory_dataset_perc:97.93%
allocator_allocated:1749496
allocator_active:9175040
allocator_resident:10747904
total_system_memory:7137525760
total_system_memory_human:6.65G
used_memory_lua:31744
used_memory_vm_eval:31744
used_memory_lua_human:31.00K
used_memory_scripts_eval:0
number_of_cached_scripts:0
number_of_functions:0
number_of_libraries:0
used_memory_vm_functions:32768
used_memory_vm_total:64512
used_memory_vm_total_human:63.00K
used_memory_functions:184
used_memory_scripts:184
used_memory_scripts_human:184B
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:5.24
allocator_frag_bytes:7425544
allocator_rss_ratio:1.17
allocator_rss_bytes:1572864
rss_overhead_ratio:0.95
rss_overhead_bytes:-589824
mem_fragmentation_ratio:9.21
mem_fragmentation_bytes:9055496
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_total_replication_buffers:0
mem_clients_slaves:0
mem_clients_normal:3856
mem_cluster_links:0
mem_aof_buffer:0
mem_allocator:jemalloc-5.3.0
active_defrag_running:0
lazyfree_pending_objects:0
lazyfreed_objects:0

# Persistence
loading:0
async_loading:0
current_cow_peak:0
current_cow_size:0
current_cow_size_age:0
current_fork_perc:0.00
current_save_keys_processed:0
current_save_keys_total:0
rdb_changes_since_last_save:6
rdb_bgsave_in_progress:0
rdb_last_save_time:1736493605
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
rdb_saves:0
rdb_last_cow_size:0
rdb_last_load_keys_expired:0
rdb_last_load_keys_loaded:8
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_rewrites:0
aof_rewrites_consecutive_failures:0
aof_last_write_status:ok
aof_last_cow_size:0
module_fork_in_progress:0
module_fork_last_cow_size:0

# Stats
total_connections_received:5
total_commands_processed:99
instantaneous_ops_per_sec:0
total_net_input_bytes:1814
total_net_output_bytes:827304
total_net_repl_input_bytes:0
total_net_repl_output_bytes:0
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
instantaneous_input_repl_kbps:0.00
instantaneous_output_repl_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
expire_cycle_cpu_milliseconds:6
evicted_keys:0
evicted_clients:0
total_eviction_exceeded_time:0
current_eviction_exceeded_time:0
keyspace_hits:1
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
pubsubshard_channels:0
latest_fork_usec:0
total_forks:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
total_active_defrag_time:0
current_active_defrag_time:0
tracking_total_keys:0
tracking_total_items:0
tracking_total_prefixes:0
unexpected_error_replies:0
total_error_replies:2
dump_payload_sanitizations:0
total_reads_processed:105
total_writes_processed:110
io_threaded_reads_processed:0
io_threaded_writes_processed:0
reply_buffer_shrinks:19
reply_buffer_expands:46
eventloop_cycles:6635
eventloop_duration_sum:557939
eventloop_duration_cmd_sum:8753
instantaneous_eventloop_cycles_per_sec:9
instantaneous_eventloop_duration_usec:81
acl_access_denied_auth:0
acl_access_denied_cmd:0
acl_access_denied_key:0
acl_access_denied_channel:0

# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:ed47b69a667922c10ebe75d0b6320884e1da8d30
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:0.165750
used_cpu_user:0.444332
used_cpu_sys_children:0.000000
used_cpu_user_children:0.000000
used_cpu_sys_main_thread:0.162647
used_cpu_user_main_thread:0.447095

# Modules

# Errorstats
errorstat_ERR:count=2

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=12,expires=0,avg_ttl=0
 


http://www.ppmy.cn/server/157443.html

相关文章

moviepy 将mp4视频文件提取音频mp3 - python 实现

DataBall 助力快速掌握数据集的信息和使用方式,会员享有 百种数据集,持续增加中。 需要更多数据资源和技术解决方案,知识星球: “DataBall - X 数据球(free)” -------------------------------------------------------------…

校园网络综合布线系统设计与实践

校园网络综合布线系统设计与实践 摘要:随着信息时代的发展,网络综合布线显得更加重要。综合布线技术也日益引起人的重视。综合布线管理系统是一个实用性十分强的系统工程,同样又是现代社区信息化建设的基础与必要产品,是对多用途…

JavaScript Chrome 中的运行

我们在 Chrome 浏览器中可以通过按下 F12 按钮或者右击页面,选择"检查"来开启开发者工具。 也可以在右上角菜单栏选择 "更多工具"》"开发者工具" 来开启: 1、Console 窗口调试 JavaScript 代码 清空 Console 窗口到内容可…

《Windows基础与网络安全:用户账户管理与安全策略》

windows基础 1、windows&linux 微软windows操作系统,俗称windows 文件系统 linux: fhs目录结构,块设备挂载到目录(一切都是文件) win: 以驱动器盘符起始,或通过目录挂载分区 路径格式…

el-table大数据量树形表格虚拟渲染,结合复选框的功能实现,利用vxe-table组件可实现该功能,不是手写!!!

公司最近有个需求优化,el-table的树形表格,结合复选框,在数据量大的情况下,会导致整个页面卡顿,且勾选全选功能时,间隔几秒才能响应。忍无可忍,于是疯狂找百度,寻找好的组件使用。终…

如何解决HTML和CSS相关的问题,什么情况下会导致元素被遮挡?

在开发过程中,HTML 和 CSS 中的元素遮挡问题通常是由于布局、定位、层级等因素导致的。在使用 Vue.js 时,这些问题依然常见,尤其是涉及到动态渲染、条件渲染和组件嵌套的场景。以下是一些常见的导致元素被遮挡的原因,并通过 Vue.j…

【C++多线程编程:六种锁】

目录 普通互斥锁: 轻量级锁 独占锁: std::lock_guard: std::unique_lock: 共享锁: 超时的互斥锁 递归锁 普通互斥锁: std::mutex确保任意时刻只有一个线程可以访问共享资源,在多线程中常用于保…

常见的图形库对比 Echarts Highcharts AntV

图形库 图形库特点图表类型适用场景依赖项官网/文档ECharts功能丰富,支持大规模数据,交互性强折线图、柱状图、饼图、地图、雷达图、散点图、热力图等复杂数据可视化无https://echarts.apache.org/Chart.js简单易用,轻量级,支持响…