[Owncloud] Heavy LDAP user search

Arthur Schiwon blizzz at owncloud.com
Wed Sep 19 11:57:38 UTC 2012


Hi again,

On 09/19/2012 02:25 AM, Manuel Delgado wrote:
> I think the problem is not in the ldap but in the greedy
> (foreach/recursive) search in ldap2ownCloudNames method.

I have two other approaches which work around the recursive array 
search. One is simple improving the result array from mappedComponents 
so that a simple $arr[$dn] will give the owncloud name, if set.

The other does DB queries using a prepared statement (i.e. i hope MDB2 
does prepared statements) on request.

Both changesets (each against access.php from git master) are attached. 
Could you please test if they speed it up noticeably, and if so which 
does it better?

Cheers
Arthur

>
> Regards,
> Manuel Delgado
>
> -----------------------------------------------------------
> *Usuario Linux* *#520940 <http://counter.li.org/>*
>
> Bach. Computación e Informática
> Universidad de Costa Rica
>
>
>
>
>
> On Tue, Sep 4, 2012 at 9:54 PM, Manuel Delgado <manuel.delgado at ucr.ac.cr>wrote:
>
>> Exactly, I'm trying to access Settings/Users page, but it never load.
>> That's why I'm asking how does the cache work, because all the 109.402 user
>> entries and 25 groups are in the database but a heavy work still there.
>>
>> As far as I know the cache resides in a file (not in DB), where is it or
>> how is it stored? and why not to use DB?
>>
>>
>> Manuel Delgado
>>
>>
>>
>>
>> On Tue, Sep 4, 2012 at 6:27 PM, Michael Gapczynski <mtgap at owncloud.com>wrote:
>>
>>> What do you mean by trying to make a simple list? The problem areas of
>>> sharing
>>> and the Settings -> Users page were rewritten to fix the performance
>>> issues by
>>> loading in batches.
>>>
>>> I think LDAP may still have to load all the users once to populate the
>>> cache.
>>> Arthur will be able to answer your question better, but he is away right
>>> now.
>>>
>>>
>>> Michael
>>>
>>> On Tuesday, September 04, 2012 06:21:52 PM Manuel Delgado wrote:
>>>> Hi!
>>>>
>>>> I'm trying again with the Owncloud 4.5 Beta (Well actually the master
>>>> branch) and I have almost the same issue... the CPU of my server goes to
>>>> 100% when I try to make a simple list or query over the LDAP users.
>>>> Actually it loops until time is up...
>>>>
>>>> How does the cache work?
>>>>
>>>> Another issue, I think there's a mistyped in
>>> apps/user_ldap/lib/access.php
>>>> line 388, it reads:
>>>> $sqlAdjustment = 'FROM `dual`';
>>>> And it should be:
>>>> $sqlAdjustment = 'FROM DUAL';
>>>> Otherwise it throws a syntax error on MySQL
>>>>
>>>> Regards,
>>>> Manuel Delgado
>>>>
>>>> -----------------------------------------------------------
>>>> *Usuario Linux* *#520940 <http://counter.li.org/>*
>>>>
>>>> Bach. Computación e Informática
>>>> Universidad de Costa Rica
>>>>
>>>> On Fri, Aug 10, 2012 at 3:33 AM, Arthur Schiwon <blizzz at owncloud.com>
>>> wrote:
>>>>> On 08/10/2012 09:02 AM, Dirk Kastens wrote:
>>>>>> Hi Manual,
>>>>>>
>>>>>>   When I set the size limit, ldap_serch will only return X entries, so
>>>>>>
>>>>>>> autocompletion will only work on those X entries and I'll be unable
>>> to
>>>>>>> share the file with anyone beyond X.
>>>>>>>
>>>>>>> Is this right? or am I missing something?
>>>>>>
>>>>>> Theoretically you're right. But with autocompletion, the more letters
>>>>>> you type, the less users will match. For example, you will share a
>>> file
>>>>>> with user tomcat: you type "t" and will get a list of 100 users out
>>> of
>>>>>> 2000 that start with a "t". Then you type "o" and now you will see
>>> all
>>>>>> 50 users that start with "to". This is the way autocompletion works
>>> with
>>>>>> SOGo. But if owncloud will only use the initial list of users that is
>>>>>> found after typing the first letter, this will not work. So it
>>> depends
>>>>>> on how owncloud's autocompletion is implemented.
>>>>>
>>>>> Unfortunately it is like this, yet. As Michael said, we're working on
>>> a
>>>>> better implementation with OC 5.
>>>>>
>>>>> Cheers
>>>>> Arthur
>>>>>
>>>>>> Dirk
>>>>>>
>>>>>>
>>>>>>
>>>>>> ______________________________**_________________
>>>>>> Owncloud mailing list
>>>>>> Owncloud at kde.org
>>>>>> https://mail.kde.org/mailman/**listinfo/owncloud<
>>> https://mail.kde.org/mai
>>>>>> lman/listinfo/owncloud>>>
>>>>>>   ______________________________**_________________
>>>>>
>>>>> Owncloud mailing list
>>>>> Owncloud at kde.org
>>>>> https://mail.kde.org/mailman/**listinfo/owncloud<
>>> https://mail.kde.org/mail
>>>>> man/listinfo/owncloud>
>>>
>>
>>
>
>
>
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: l2ocnames-per-db-queries.patch
Type: text/x-diff
Size: 2052 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20120919/15153317/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: l2ocnames-per-db-result.patch
Type: text/x-diff
Size: 1136 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20120919/15153317/attachment-0001.patch>


More information about the Owncloud mailing list