redis常用命令小结

转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/107.html?1455867352

1、redis-benchmark
redis基准信息,redis服务器性能检测

redis-benchmark -h localhost -p 6379 -c 100 -n 100000
100个并发连接,100000个请求,检测host为localhost 端口为6379的redis服务器性能

[[email protected] redis-1.2.6]# redis-benchmark -h localhost -p 6379 -c 100 -n 100000====== PING ====== 10001 requests completed in 0.41 seconds 50 parallel clients 3 bytes payload keep alive: 10.01% <= 0 milliseconds23.09% <= 1 milliseconds85.82% <= 2 milliseconds95.60% <= 3 milliseconds97.20% <= 4 milliseconds97.96% <= 5 milliseconds98.83% <= 6 milliseconds99.41% <= 7 milliseconds99.70% <= 8 milliseconds99.99% <= 9 milliseconds100.00% <= 12 milliseconds24274.27 requests per second

2、redis-cli

redis-cli -h localhost -p 6380 monitor
Dump all the received requests in real time;
监控host为localhost,端口为6380,redis的连接及读写操作

[[email protected] redis-1.2.6]# redis-cli -h localhost -p 6380 monitor+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 -h localhost -p 6380 info
Provide information and statistics about the server ;
提供host为localhost,端口为6380,redis服务的统计信息

[[email protected] redis-1.2.6]# redis-cli -h localhost -p 6380 inforedis_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-stat host localhost port 6380 overview
Print general information about a Redis instance;
实时打印出host为localhost,端口为6380,redis实例的总体信息

[[email protected] redis-1.2.6]# redis-stat port 6380 overview ------- data ------ ------------ load ----------------------------- - childs - keys   used-mem clients  requests      connections 1319   5.37M   103    44108021 (+44108021) 810         1319   5.38M   103    44108124 (+103)   810         1319   5.38M   103    44108225 (+101)   810         1319   5.39M   103    44108326 (+101)   810         1319   5.40M   103    44108427 (+101)   810         1319   5.41M   103    44108528 (+101)   810        #p#分页标题#e#

redis-stat host localhost port 6380 overview
Measure Redis server latency;
输出host为localhost,端口为6380,redis服务中每个请求的响应时长

[[email protected] redis-1.2.6]# redis-stat port 6380 latency1: 0.16 ms2: 0.11 ms3: 0.15 ms4: 0.11 ms5: 0.18 ms6: 0.14 ms    
时间: 2024-10-22 14:39:17

redis常用命令小结的相关文章

Oracle 常用命令小结

1.当前数据库中查看建表语句 select dbms_metadata.get_ddl('TABLE','表名') from dual; 2. Oracle 常用命令小结,布布扣,bubuko.com

Linux常用命令小结(续)

20. mysql mysql --host=127.0.0.1 --port=3306 --database=test --user=test --password=test --default-character-set=utf8 21. 脚本求两个文件的相同集合 test1   test2 1           2 2           3 3           4 cat test1 test2 | sort | uniq -d (result: 2 3) cat test1 te

MySQL 数据库常用命令小结

1.MySQL常用命令 create database name; 创建数据库 use databasename; 选择数据库 drop database name 直接删除数据库,不提醒 show tables; 显示表 describe tablename; 表的详细描述 select 中加上distinct去除重复字段 mysqladmin drop databasename 删除数据库前,有提示. 显示当前mysql版本和当前日期 select version(),current_dat

自学总结redis第二部分(redis常用命令、高级命令特性以及与java代码的结合)

六.redis多数据类型介绍(常用命令) 6.1前提操作 #如果前面的redis环境没搭好,那么可以先暂时在 "http://try.redis.io/"中实践redis命令部分.   #为了测试方便,把redis登录密码暂时撤销   #redis一共分为五种基本数据类型:String,Hash,List,Set,ZSet #所有命令都可以到"http://www.redis.cn/commands.html"  去搜索到. #首先由于redis是一个基于key-v

redis常用命令及高级特性

11.redis常用命令 keys * 返回所有的键 keys my* 模糊匹配 exists key 确认key是否存在 del key expire key time对现有的键设置过期时间[秒为单位] ttl key 查看过期时间,-1代表已过期 move 将当期数据库中的key移到其它数据库当中 select database_name 选择数据库 move key database_name persist key 取消过期时间,此时ttl key返回-1并不代表过期 randomkey

[转]MySQL数据库备份和还原的常用命令小结

MySQL数据库备份和还原的常用命令小结,学习mysql的朋友可以参考下: 备份MySQL数据库的命令 mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql 备份MySQL数据库为带删除表的格式备份MySQL数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库. mysqldump ---add-drop-table -uusername -ppassword databasena

MySQL数据库备份和还原的常用命令小结

MySQL数据库备份和还原的常用命令小结,学习mysql的朋友可以参考下: 备份MySQL数据库的命令 mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql 备份MySQL数据库为带删除表的格式备份MySQL数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库. mysqldump ---add-drop-table -uusername -ppassword databasena

No-sql之redis常用命令

转自:http://blog.csdn.net/nicewuranran/article/details/51793760 No-SQL之Redis 介绍 Redis是一种基于内存存储的key-value高性能存储系统,类似memcached,但是redis支持丰富的数据结构类型,并且其还支持数据持久化到磁盘. Redis is a data structure server. It is open-source, networked, in-memory, and stores keys wi

Redis常用命令与高级应用

附: 127.0.0.1:6379> set xiaofei 小飞 OK 127.0.0.1:6379> get xiaofei "\xe5\xb0\x8f\xe9\xa3\x9e" 127.0.0.1:6379> quit [[email protected] redis-2.8.6]# redisc --raw 127.0.0.1:6379> get xiaofei 小飞 127.0.0.1:6379> 5. sorted sets类型和操作 sort