估算單個(gè)key-vlue的字節(jié)數(shù)
1、如以下
http://kernelmaker.github.io/Redis-StringMem
https://blog.csdn.net/u011983531/article/details/79598671
2焰枢、用命令info memory
2.1 info memory,計(jì)算此時(shí)內(nèi)存字節(jié)數(shù) n0
2.2 add key戈抄,如set/hset
2.3 info memory再次查看內(nèi)存n1歌懒,n1-no相減具壮。
注意茶袒,2.3要稍等n1穩(wěn)定之后再取值馆类,add操作可能產(chǎn)生發(fā)生類似GC的過程,將臨時(shí)變量回收
單個(gè)hash最多可存儲(chǔ)field-value對(duì)
Every hash can store up to 232?- 1 field-value pairs (more than 4 billion).