简体   繁体   English

Tokyo Cab.net - Memory 调整

[英]Tokyo Cabinet - Memory Tuning

I have more than 100 million key-value pairs (one key can have multiple values).我有超过 1 亿个键值对(一个键可以有多个值)。 I am using Tokyo Cab.net's BDB (B+Tree DB) whose key, value is 32 bit byte-array.我正在使用 Tokyo Cab.net 的 BDB (B+Tree DB),其键值是 32 位字节数组。

Is it possible in Tokyo Cab.net to set how much memory (lower and upper limit) it can use?是否可以在 Tokyo Cab.net 中设置可以使用多少 memory(下限和上限)? Actually, I have 8GB memory, but it seems it can't take advantage of large memory.实际上,我有 8GB memory,但它似乎无法利用大 memory。

Another point is that, I want to know that how to set,另一点是,我想知道如何设置,

tokyoCab.net.tune() tokyoCab.net.optimize() tokyoCab.net.setxmsiz() tokyoCab.net.setcache() these parameters thus I can get maximal tuning for my case. tokyoCab.net.tune() tokyoCab.net.optimize() tokyoCab.net.setxmsiz() tokyoCab.net.setcache() 这些参数因此我可以获得针对我的情况的最大调整。 Thanks in advance.提前致谢。 Any idea is also helpful to me.任何想法对我也有帮助。

tokyoCab.net.setcache() - set the cache size, usually is half or more filesize tokyoCab.net.setcache() - 设置缓存大小,通常是文件大小的一半或更多

tokyoCab.net.tune() - set the hash bucket file and BTree index parameters before open tokyoCab.net.tune() - 在打开之前设置 hash 桶文件和 BTree 索引参数

tokyoCab.net.optimize() - the set new parameters of the hash bucket file and BTree index when file already opened, if the numbers of record was increasing more than set in the tune( bnum), You can increase by optimize(), for example. tokyoCab.net.optimize() - 当文件已经打开时设置 hash 桶文件和 BTree 索引的新参数,如果记录数量增加超过 tune(bnum) 中设置的数量,您可以通过 optimize() 增加,例如。

tokyoCab.net.setxmsiz() set the size of the extra mapped memory, as using mmap, usually is filesize tokyoCab.net.setxmsiz()设置额外映射的大小memory,因为使用mmap,通常是filesize

100 million key-value pairs - bnum > 100M * 2 value is 32 bit byte-array -> recsize = 32bit = 8 byte -> apow = 3 ( = 2^3 ) 1 亿个键值对 - bnum > 100M * 2 值为 32 位字节数组 -> recsize = 32bit = 8 字节 -> apow = 3 ( = 2^3 )

If you have 1024 elements of Array: the recsize, set apow = 13如果你有 1024 个数组元素:recsize,设置 apow = 13

lmemb specifies the number of members in each leaf page. lmemb指定每个叶页中的成员数。 If it is not more than 0, the default value is specified.如果不大于 0,则指定默认值。 The default value is 128.默认值为 128。

nmemb specifies the number of members in each non-leaf page. nmemb指定每个非叶页中的成员数。 If it is not more than 0, the default value is specified.如果不大于 0,则指定默认值。 The default value is 256. fpow specifies the maximum number of elements of the free block pool by power of 2.默认值为 256。 fpow 以 2 的幂指定空闲块池的最大元素数。

The official documentation官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM