Hi!
On 06/07/2020 13:46, Sebastian Kaczmarek wrote:
Hi there,
I've got a problem with my ApacheDS AM25 server.
I have a groupOfNames entry with 127K members. When I try to do an LDIF
import using `ldapmodify` command it takes about 4 seconds to insert a
single member.
When I try to insert a member into 3 separate groupOfNames (with over 120K
members each) one after another, it takes longer and longer each time. I do
it using PHP's `ldap_mod_add()` function in a loop.
My case is that after a user registers on my website, I need to add him to
multiple groups. Each of those groups has already over 120K members and
when I loop over group names and add the user to each of the groups, it
takes forever to load.
I hope it makes sense and it's clear for you.
Pretty clear.
The thing is that LDAP attributes are multi-valued, and your 120k
elements are stored in a single attribute. That means this element gets
pretty big, and updating it requires that we first check if the added
value is not already present, and if not, we need to add teh new
elemengt at the right place, and replace all the previous values with
the new ones.
This is quite CPU intensive.
Now, there is a way to speed that up: indexing the attribute. When it
get indexed, and if it is bigger than a given threshold (here, it
defaults to 16 values), then a sub-btree is created to hold the values,
making it easy and fast to insert, delete or search values from this
attribute. The drawback is that it takes an extra step to store values
in such an attribute, but you probably don't care.
Bottom line : index the attribute, restart the server, and reload the
values, that should do the trick.
Best regards,
Sebastian Kaczmarek
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]