[python-ldap] ldap.OPT_DESC, async ops and paged search controls

Michael Ströder michael at stroeder.com
Tue Jan 27 16:39:33 CET 2015


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?

On my system timeout=0.00001 is only 10% worse either with ~1200 LDAP results
always returned in one chunk and calling result() ~800 times.

I also tried to use select.epoll(). But I'm not sure about the exact flags.
But it this seems worse and is not available on all platforms.

Overall both solutions are not ideal but do not perform so much worse than
synchronous methods.

> So this is definitely one for the openldap-technical mailing list.

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4252 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20150127/344e2428/attachment.bin>


More information about the python-ldap mailing list