[sr-dev] [kamailio/kamailio] hash table size issue (#2311)

Daniel-Constantin Mierla notifications at github.com
Fri May 1 17:18:56 CEST 2020


Duplicate key names (or arrays) are actually stored in hash table with distinctive keys, the key for hash table being the string built like `key[index]`.

The size attribute is for the number of buckets (slots) for the hash table, not the number of items that can be stored in the hash table. The number of items is limited by the shared memory, when it is no more enough free shared memory, then you get memory errors and new items no longer stored in hash table. The number of slots has relevance in searching for items, making it faster if there are no very many items on a bucket (slot).

At 3000 items, even size=12 (2^12 = 4096 slots) results in more slots than items, but of course there can be hashid collisions and many items stored in the same slot. Each slot keeps a linked list of values. Items are not deleted on hashid collision, they are just added to the same slot in the linked list.

For 3. maybe you can give explicit examples to be able to comment more.

For 4 you have to change the values of ctl module parameters related to buffers. Or try `kamctl rpc htable.dump a`, you need to use jsonrpcs module.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2311#issuecomment-622429994
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200501/c9673cbe/attachment.html>


More information about the sr-dev mailing list