栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在Redis中找到最大对象的最简单方法是什么?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在Redis中找到最大对象的最简单方法是什么?

一个选项已添加到redis-cli:

redis-cli --bigkeys

基于https://gist.github.com/michael-
grunder/9257326的
示例输出

$ ./redis-cli --bigkeys# Press ctrl+c when you have had enough of it... :)# You can use -i 0.1 to sleep 0.1 sec every 100 sampled keys# in order to reduce server load (usually not needed).Biggest string so far: day:uv:483:1201737600, size: 2Biggest string so far: day:pv:2013:1315267200, size: 3Biggest string so far: day:pv:3:1290297600, size: 5Biggest zset so far: day:topref:2734:1289433600, size: 3Biggest zset so far: day:topkw:2236:1318723200, size: 7Biggest zset so far: day:topref:651:1320364800, size: 20Biggest string so far: uid:3467:auth, size: 32Biggest set so far: uid:3029:allowed, size: 1Biggest list so far: last:175, size: 51-------- summary -------Sampled 329 keys in the keyspace!Total key length in bytes is 15172 (avg len 46.12)Biggest   list found 'day:uv:483:1201737600' has 5235597 itemsBiggest    set found 'day:uvx:555:1201737600' has 47 membersBiggest   hash found 'day:uvy:131:1201737600' has 2888 fieldsBiggest   zset found 'day:uvz:777:1201737600' has 1000 members0 strings with 0 bytes (00.00% of keys, avg size 0.00)19 lists with 5236744 items (05.78% of keys, avg size 275618.11)50 sets with 112 members (15.20% of keys, avg size 2.24)250 hashs with 6915 fields (75.99% of keys, avg size 27.66)10 zsets with 1294 members (03.04% of keys, avg size 129.40)


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/392324.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号