redis常用命令小结
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/107.html?1455867352
1、redis-benchmark
redis基准信息,redis服务器性能检测
redis-benchmark-hlocalhost-p6379-c100-n100000
100个并发连接,100000个请求,检测host为localhost端口为6379的redis服务器性能
[[email protected]]#redis-benchmark-hlocalhost-p6379-c100-n100000======PING======10001requestscompletedin0.41seconds50parallelclients3bytespayloadkeepalive:10.01%<=0milliseconds23.09%<=1milliseconds85.82%<=2milliseconds95.60%<=3milliseconds97.20%<=4milliseconds97.96%<=5milliseconds98.83%<=6milliseconds99.41%<=7milliseconds99.70%<=8milliseconds99.99%<=9milliseconds100.00%<=12milliseconds24274.27requestspersecond
2、redis-cli
redis-cli-hlocalhost-p6380monitor
Dumpallthereceivedrequestsinrealtime;
监控host为localhost,端口为6380,redis的连接及读写操作
[[email protected]]#redis-cli-hlocalhost-p6380monitor+OK+1289800615.808225"monitor"+1289800615.839079"GET""name"+1289800615.853694"PING"+1289800615.853783"PING"+1289800615.854646"PING"+1289800615.854974"PING"+1289800615.857693"PING"+1289800615.866862"PING"+1289800615.871944"PING"#p#分页标题#e#
redis-cli-hlocalhost-p6380info
Provideinformationandstatisticsabouttheserver;
提供host为localhost,端口为6380,redis服务的统计信息
[[email protected]]#redis-cli-hlocalhost-p6380inforedis_version:2.0.4redis_git_sha1:00000000redis_git_dirty:0arch_bits:32multiplexing_api:epollprocess_id:21990uptime_in_seconds:490580uptime_in_days:5connected_clients:103connected_slaves:0blocked_clients:0used_memory:4453240used_memory_human:4.25Mchanges_since_last_save:200bgsave_in_progress:0last_save_time:1290394640bgrewriteaof_in_progress:0total_connections_received:809total_commands_processed:44094018expired_keys:0hash_max_zipmap_entries:64hash_max_zipmap_value:512pubsub_channels:0pubsub_patterns:0vm_enabled:0role:slavemaster_host:localhostmaster_port:6379master_link_status:upmaster_last_io_seconds_ago:18db0:keys=1319,expires=0
3、redis-stat
redis-stathostlocalhostport6380overview
PrintgeneralinformationaboutaRedisinstance;
实时打印出host为localhost,端口为6380,redis实例的总体信息
[[email protected]]#redis-statport6380overview-------data------------------load------------------------------childs-keysused-memclientsrequestsconnections13195.37M10344108021(+44108021)81013195.38M10344108124(+103)81013195.38M10344108225(+101)81013195.39M10344108326(+101)81013195.40M10344108427(+101)81013195.41M10344108528(+101)810#p#分页标题#e#
redis-stathostlocalhostport6380overview
MeasureRedisserverlatency;
输出host为localhost,端口为6380,redis服务中每个请求的响应时长
[[email protected]]#redis-statport6380latency1:0.16ms2:0.11ms3:0.15ms4:0.11ms5:0.18ms6:0.14ms