|
From: Jamie C. <jca...@we...> - 2007-01-19 08:23:51
|
On 18/Jan/2007 22:46 Murray Trainer wrote .. > Hi Jamie > > We now have over 1000 users we manage with the LDAP Users module. I > have noticed lately that it is becoming very slow bringing up the > initial screen. I can imagine things only getting worse as the > directory gets larger. I haven't checked the queries My guess is that > the module tries to search the LDAP directory for the whole list of > users, then after realising there are too many, it then says there are > too many to display and fails. Even if I set the maximum number of > users or groups to display to 0 or 1 it still takes a fair few seconds > to display the opening screen. > > The recommed method is to process each LDAP user entry one at a time as > they are returned. The module would stop when it reached the limit of > users for that page which could be a configuration value. The module > appears to be using the NET::LDAP library. I had a look at the > documentation below and they recommend processing each entry as it is > returned: > > http://search.cpan.org/~gbarr/perl-ldap-0.33/lib/Net/LDAP/FAQ.pod#USING_THE_CALLBACK_SUBROUTINE_APPROACH > > If we want 100 users to be displayed on the page we print the first 100 > entries then quit. If we want users 100-200 we would ignore the first > hundred entries and print the second hundred, and so on. > > Hope the above idea has merit and its possible for you to implement at > some stage. Actually, that is what the module already does. The main page does an LDAP search for matching users, and then checks the number of results available. If this is higher than the maximum set on the Module Config page, it just displays the search form without fetching the full user list. Of course, for this to be useful I assume that the LDAP server doesn't fetch users from it's database until actually asked to.. - Jamie |