[python-ldap] ldap.OPT_DESC, async ops and paged search controls
Mark R Bannister
mark at proseconsulting.co.uk
Tue Jan 27 21:24:29 CET 2015
On 27/01/2015 15:39, Michael Ströder wrote:
> Mark R Bannister wrote:
>> I had time to play with this some more,
> Me too.
>
>> and it emerged that if I did this:
>>
>> result = ldap.result(timeout=0.0001)
>>
>> (i.e. instead out timeout=0), it behaves much more the way I expected. The
>> number of select() calls drops from over 80,000 to about 3,000 and testing
>> different values this seemed to be the most optimal setting (on the hardware I
>> was testing on anyway).
> How many results?
80,000.
> Yes, please post there. Note that it would be probably a solution to
> have one global blocking result() collecting thread which dispatches
> the results to the outstanding request queues. It would be nice to
> have this encapsulated in a variant of the LDAPObject class. Ciao,
> Michael.
The original design limits the number of threads in an attempt to be
more scalable. There is a fixed number of workers that can each be
responsible for a larger number of LDAP connections. This is by
design. If I launched a new blocking thread for each LDAP connection,
it would be easy to overload the system with too many threads by sending
in many different requests simultaneously.
Best regards,
Mark.
More information about the python-ldap
mailing list