一、连接
src/redis-cli -h 10.20.137.141 -p 6379 >auth 123456789 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789
二、常用性能分析命令
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 monitor src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info clients|grep connected_clients 查看客户端已连接个数 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|egrep ‘(used_memory_human|used_memory_peak_human)‘ src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|grep -e "used_memory_human" -e "used_memory_peak_human" 查看当前使用内存量和历史最高峰值 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep total_commands 查看启动到当前处理命令总数 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep instantaneous_ops_per_sec 每秒操作数 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep expired_keys 已过期的key数量 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep instantaneous_input_kbps 每秒进出流量(70444byte)0.07M src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep rejected_connections拒绝的连接请求量 src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|grep mem_fragmentation_ratio 内存碎片比例(如果超过1,表示存在内存碎片;如果小于1,说明内存被交换到swap里面去了。计算公式为:used_memory_rss/used_memory)
时间: 2024-10-21 12:54:28