如何确定Redis中单个键的大小 [英] How to determine the size of a single key in Redis

查看:174
本文介绍了如何确定Redis中单个键的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么知道?
我知道info memory命令,但是它提供了Redis实例的组合大小,而不是单个键.

How can I know the size (in KB) of a particular key in redis?
I'm aware of info memory command, but it gives combined size of Redis instance, not for a single key.

推荐答案

我知道这是一个老问题,但是就记录而言,Redis从版本 4.0.0起实施了memory usage <key>命令 >.

I know this is an old question, but, just for the record, Redis implemented a memory usage <key> command since version 4.0.0.

输出是将密钥存储在RAM中所需的字节数量.

The output is the amount of bytes required to store the key in RAM.

参考: https://redis.io/commands/memory-usage

这篇关于如何确定Redis中单个键的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆