redis 性能指标监控命令
admin
2023-05-30 07:22:20
0


redis 性能指标监控命令


大家在学习的过程中,一定要学会经常使用help来了解命令的具体用法。


1.info  (监控一般使用这个命令读取数据)

127.0.0.1:6379> help info 


  INFO [section]

  summary: Get information and statistics about the server

  since: 1.0.0

  group: server


127.0.0.1:6379> info 

# Server

redis_version:3.0.7

redis_git_sha1:00000000

redis_git_dirty:0

redis_build_id:8d64350b19f2f7d2

redis_mode:standalone

os:Linux 2.6.32-504.el6.x86_64 x86_64

arch_bits:64

multiplexing_api:epoll

gcc_version:4.4.7

process_id:1096

run_id:2fc6a6e9638de4b9bccce3def6b40bb7b69e5240

tcp_port:6379

uptime_in_seconds:1668

uptime_in_days:0

hz:10

lru_clock:3766532

config_file:/etc/redis/6379.conf


# Clients

connected_clients:3

client_longest_output_list:0

client_biggest_input_buf:0

blocked_clients:0


# Memory

used_memory:856928

used_memory_human:836.84K

used_memory_rss:3223552

used_memory_peak:856968

used_memory_peak_human:836.88K

used_memory_lua:36864

mem_fragmentation_ratio:3.76

mem_allocator:jemalloc-3.6.0


# Persistence

loading:0

rdb_changes_since_last_save:0

rdb_bgsave_in_progress:0

rdb_last_save_time:1480159872

rdb_last_bgsave_status:ok

rdb_last_bgsave_time_sec:-1

rdb_current_bgsave_time_sec:-1

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_last_write_status:ok


# Stats

total_connections_received:2

total_commands_processed:189

instantaneous_ops_per_sec:0

total_net_input_bytes:3340

total_net_output_bytes:66405

instantaneous_input_kbps:0.00

instantaneous_output_kbps:0.04

rejected_connections:0

sync_full:0

sync_partial_ok:0

sync_partial_err:0

expired_keys:0

evicted_keys:0

keyspace_hits:0

keyspace_misses:0

pubsub_channels:0

pubsub_patterns:0

latest_fork_usec:0

migrate_cached_sockets:0


# Replication

role:slave

master_host:192.168.1.93

master_port:6380

master_link_status:up

master_last_io_seconds_ago:9

master_sync_in_progress:0

slave_repl_offset:2283

slave_priority:100

slave_read_only:1

connected_slaves:0

master_repl_offset:0

repl_backlog_active:0

repl_backlog_size:1048576

repl_backlog_first_byte_offset:0

repl_backlog_histlen:0


# CPU

used_cpu_sys:0.97

used_cpu_user:0.42

used_cpu_sys_children:0.00

used_cpu_user_children:0.00


# Cluster

cluster_enabled:0


# Keyspace

db0:keys=1,expires=0,avg_ttl=0



2.monitor (影响性能,谨慎使用)

127.0.0.1:6379> help monitor


  MONITOR -

  summary: Listen for all requests received by the server in real time

  since: 1.0.0

  group: server

127.0.0.1:6379> monitor

OK

1480161369.716981 [0 192.168.1.93:6380] "PING"

1480161379.816223 [0 192.168.1.93:6380] "PING"

1480161389.930811 [0 192.168.1.93:6380] "PING"

1480161400.047882 [0 192.168.1.93:6380] "PING"

1480161409.461477 [0 127.0.0.1:42333] "info"

1480161410.143357 [0 192.168.1.93:6380] "PING"

1480161420.267618 [0 192.168.1.93:6380] "PING"

1480161421.141619 [0 127.0.0.1:42333] "info" "all"

1480161430.367934 [0 192.168.1.93:6380] "PING"

1480161440.496221 [0 192.168.1.93:6380] "PING"



3.slowlog 

127.0.0.1:6379> help slowlog


  SLOWLOG subcommand [argument]

  summary: Manages the Redis slow queries log

  since: 2.2.12

  group: server


  127.0.0.1:6379> slowlog get 

1) 1) (integer) 17

   2) (integer) 1480161791

   3) (integer) 12

   4) 1) "config"

      2) "set"

      3) "slowlog-log-slower-than"

      4) "10"

127.0.0.1:6379> slowlog len

(integer) 2


相关内容

热门资讯

韩足协被曝15年前为外籍裁判安... 【环球网报道 实习记者 程子尚】据韩联社、韩国《首尔经济日报》等媒体6日报道,韩国足协被曝于15年前...
美媒:特朗普私下支持万斯参加下... 据《华盛顿邮报》8月6日报道,美国总统特朗普最近私下向捐款人表示,他希望看到万斯赢得2028年总统大...
人民日报:把“甜蜜的事业”做成... 人民日报客户端 朱浙萍把“甜蜜的事业”做成“收割的生意”,部分婚介机构吃相未免太难看。日前,民政部等...
“错换37年人生”当事人发声:... 近日,“出生时被抱错,广东两女子错换37年人生”一事引发关注。广东清远市的李慧(化名)和黄晓琳(化名...
我国首座抗17级台风高技术难度... 本文转自【新华网】; 新华社北京8月6日电(记者王悦阳、梁姊)中国海油8月6日宣布,我国自主设计建造...
山西省灵丘县科技馆里“热度”飙... 央广网大同8月6日消息(记者张洁 通讯员马明清)8月5日,山西省大同市灵丘县科技馆展厅内人头攒动、氛...
校地协同 聚力科研攻关 8月3日,在市沙漠综合治理中心主任张雁平的陪同下,青岛农业大学教授刘建龙、内蒙古自治区林科院研究员杨...
唐波、崔洪芝获颁2025年度山... 8月6日下午,全省科技大会在济南召开。会上,宣读《中共山东省委山东省人民政府关于2025年度山东省科...
台风“白海豚”逐渐逼近华东沿海... 据中央气象台消息,今年第13号台风“白海豚”的中心8月6日14时位于距离浙江省温州市偏东方向约120...
阿联酋、土耳其、沙特等8国外长... 【环球网报道 记者 索炎琦】据《以色列时报》等媒体报道,阿联酋、卡塔尔、约旦、印度尼西亚、巴基斯坦、...