pmemkv icon indicating copy to clipboard operation
pmemkv copied to clipboard

Any way to get the kv usage of total db capactiy?

Open JerryYangSH opened this issue 4 years ago • 1 comments

I would need an interface to query the current used or remaining capacity. I know we can scan to get this but it's not good way to scan each time for query.

JerryYangSH avatar Apr 30 '20 12:04 JerryYangSH

Right now there is no such API but in future we might expose pmemobj statistics (number of allocated bytes, number of active/allocated runs): https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3. However, even with such API, finding out what is the remaining capacity is not an easy task. The number of entries which you can add to the pmemkv, might be a lot less than the "remaining capacity". One reason is fragmentation (both internal and external).

igchor avatar May 04 '20 07:05 igchor