tiny-rdm
tiny-rdm copied to clipboard
[FEATURE]memory stats
redis 4.0 之前,只能通过info memory查看 redis 实例的内存大体使用状况,而无法了解内存的具体使用细节,比如expire的消耗,client output buffer, query buffer等是很难直观显示的。该指令能够展现redis内部内存使用细节;
执行结果示例及对应参数解析:
- "peak.allocated" # redis从启动来,allocator分配的内存峰值
- (integer) 2290242368
- "total.allocated" # allocator分配当前内存字节数
- (integer) 2290241776
- "startup.allocated" # redis启动完成使用的内存字节数
- (integer) 6315320
- "clients.normal" # 所有一般客户端消耗内存节字数,即所有flag为N的客户端内存使用
- (integer) 150754
- "aof.buffer" # aof buffer使用内存字节数,一般较小,在aof rewrite时会变得较大
- (integer) 0
- "lua.caches" # 所有lua脚本占用的内存节字数
- (integer) 0
- "db.0"
-
- "overhead.hashtable.main" # 对应db的所有key的hash表总的内存节字数
- (integer) 680720488
- "overhead.hashtable.expires" # 对应db的过期key的hash表总的内存节字数
- (integer) 416
- "overhead.total" # redis总的分配的内存的字节数
- (integer) 687186978
- "keys.count" # 整个实例key的个数,相同于dbsize返回值
- (integer) 13662569
- "keys.bytes-per-key" # 每个key平均占用字节数;把overhead也均摊到每个key上
- (integer) 167
- "dataset.bytes" # 表示redis数据集占用的内存容量,即分配的内存总量减去 overhead.total
- (integer) 1603054798
- "dataset.percentage" # 表示redis数据占用内存占总内存分配的百分比
- "70.188545227050781"
- "peak.percentage" # 当前内存使用量在峰值时的占比
- "99.999977111816406"
- "allocator.allocated" # 该参数不同与 total.allocated, 它计算所有分配的内存大小(不仅仅是使用zmalloc分配的)
- (integer) 2291632296
- "allocator.active" # 与常驻内存allocator.resident不同,这不包括jemalloc申请的还未使用的内存
- (integer) 2293006336
- "allocator.resident" # 与RSS不同,这不包括来自共享库和其他非堆映射的RSS
- (integer) 2340564992
- "allocator-fragmentation.ratio" # 等于 allocator.active / allocator.allocated
- "1.0005995035171509"
- "allocator-fragmentation.bytes" # 等于 allocator.active - allocator.allocated
- (integer) 1374040
- "allocator-rss.ratio" # 等于 allocator.resident / allocator.active
- "1.0207407474517822"
- "allocator-rss.bytes" # 等于 allocator.resident - allocator.active
- (integer) 47558656
- "rss-overhead.ratio" # 等于 RSS / allocator.resident
- "0.99930697679519653"
- "rss-overhead.bytes" # 等于 RSS - allocator.resident
- (integer) -1622016
- "fragmentation" # 等于 RSS / total.allocated
- "1.0212923288345337"
- "fragmentation.bytes" # 等于 RSS - total.allocated
- (integer) 48763208