[Owncloud] Heavy LDAP user search

Arthur Schiwon blizzz at owncloud.com
Fri Sep 21 09:41:14 UTC 2012

On Friday, September 21, 2012 11:24:13 AM Dirk Kastens wrote:
> Hi,
> I still wonder why owncloud scans the whole directory.

It scans according to the User Base DN and User list filter, but given.

In ownCloud the username is also the user ID. So we need to create an  
owncloud username for each LDAP user, that does not collide with any other 
user and respects the username limitations forowncloud. If the name changes, 
the data will be unaccessible for this user. Also, when a Share operation is 
about to happen, we need to now which user is available, so a full scan cannot 
be avoided anyway. Plus,. PHP 5.3 does not support a paged retrieval [1]
 which could come handy sometimes.

[1] https://bugs.php.net/bug.php?id=42060

> I'm always
> running into the search time limit of our ldap server. Now, when I try
> to share something with another ldap user, the owncloud server hangs. I
> assume, it's because the autocomplete function tries to read in all 50k
> users of our directory. 

Try to increase the Cache TTL to make it run more smoothly. However, every now 
and then it needs to be updated. 

However, when it is really getting this faster, it should run better for you 
as well.


> And after the timeout it says "No users found".
> I hope this will be changed with OC 5.
> Am 20.09.2012 00:32, schrieb Manuel Delgado:
> > Patch A (prepared statement)
> > real    3m3.474s
> > user    0m12.065s
> > sys    0m12.689s
> > 
> > Patch B ($arr[$dn])
> > real    3m36.445s
> > user    0m16.833s
> > sys    0m12.661s
> > 
> > The idea of the prepared statement and the unidimensional array worked
> > perfectly. I will be doing more test and reports if found something, but
> > it's working great with 110k ldap users.
> Regards,
> Dirk

More information about the Owncloud mailing list