Redis(8)Monitor and Data Type Design

本文详细介绍了Redis中常用的数据类型设计与管理方法,并通过使用redis-stat工具进行实时监控,帮助开发者更高效地理解与操作Redis数据。通过具体实例展示了如何使用Redis SET、ZADD等命令进行数据存储与检索,以及如何利用redis-stat工具获取关键性能指标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Redis(8)Monitor and Data Type Design

1. Redis-stat
Try this tool https://github.com/junegunn/redis-stat
> sudo gem install redis-stat

Command to start it can be as follow pattern.
redis-stat localhost:6379 localhost:6380 —server=8080 5 —daemon

I am running single node on my local machine, so I will use this command
> redis-stat localhost:6379 --server=8082 5 --daemon

Stop the daemon
Verify it is running
> ps -ef | grep redis-stat

Kill that
> sudo killall -9 redis-stat-daemon

2. Connect to the Server and Range the Set
> redis-cli -h 127.0.0.1 -p 6379

> MSET 78729_sillycat_engineer_22 "I am value, I know how this job desc 22"
> KEYS *_sillycat_*

This one makes more sences
>zadd 2015-6-11-13-78729-sillycat-engineer 22 "I am a engineer job with 22 cent cpc"
>zadd 2015-6-11-13-78729-sillycat-engineer 33 "I am a engineer job with 33 cent cpc"
>zadd 2015-6-11-13-78729-sillycat-sales 23 "I am a sales job with 23 cent cpc"

Get the highest value by Key
>ZREVRANGE 2015-6-11-13-78729-sillycat-engineer 0 0
1) "I am a engineer job with 33 cent cpc"

List all keys based on zipcode or etc
>KEYS 2015-6-11-13-78729*
1) "2015-6-11-13-78729-sillycat-engineer"
2) "2015-6-11-13-78729-sillycat-sales"

References:
Basic Data Type
http://sillycat.iteye.com/blog/1553507
http://sillycat.iteye.com/blog/1553508
http://sillycat.iteye.com/blog/1553509

Monitor
https://github.com/LittlePeng/redis-monitor
http://redis.io/commands/MONITOR
https://github.com/junegunn/redis-stat

key pattern
http://redis.io/commands/KEYS
http://redis.io/commands/scan
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值