You would indeed need to recompile. However, that is not the limit of the cache size, it’s just a direct lookup by id if the particular cache entry has been used somewhat recently. The entries are all stored in avltrees (so O(log(n)) lookup). The arrays sized by this constant just have the most recent entry for a particular “hash” value (where the hash is just id mod id_cache_size).

 

Enlarging the cache will not necessarily mean all the entries will be cached, though if they are all assigned mostly sequentially, the trial mod hash will result in a unique hash for each entry.

 

Given the use of the cache, I’m not even sure the value needs to be a prime… Use of a prime number would really only help if the ids are randomly spread over a much larger id space than the number of ids, otherwise any cache size should work just fine.

 

Frank

 

From: David Hansen [mailto:davidh@weka.io]
Sent: Monday, June 8, 2020 1:15 PM
To: support@lists.nfs-ganesha.org
Cc: Michael Echavarría <mechavarria@penguincomputing.com>
Subject: [NFS-Ganesha-Support] Help with id_cache_size

 

Hello Ganesha support. I have a customer running into some nasty intermittent connection issues an internal directory service (VAS) which ganesha is using to query group ownership of directories thanks to Manage_Gids = True;

As such, we've been asked to inspect the caching mechanism of ganesha U/GID mapping and determined that the ID map cache size is 1009 entries, as set here:

https://github.com/nfs-ganesha/nfs-ganesha/blob/d51394b49b644b69bec1c219c650e8ed69b50c07/src/idmapper/idmapper_cache.c#L76
src/idmapper/idmapper_cache.c:76
#define id_cache_size 1009

Since the customer has 6000+ groups, they have expressed interest in increasing this value to 20011 (must be prime) to account for nested groups and such.

Can you please confirm whether we would have to define this value ourselves and recompile ganesha, or whether it is configurable with a config file somehow?

 

Thanks!

--

David Hansen 

Support Engineer

WekaIO, Inc.  |  Radically Simple Storage™

Support Line: +1 (855) 969-4030

M: +1-408-332-4550