[python3-ldap] Connection Slowness

Derrick Jackson derrick.jackson73 at gmail.com
Wed Mar 11 18:05:43 CET 2015


Hi Giovanni,

Thanks for the quick follow-up.  I was up until a moment ago using
python3-ldap.  I am using ldap3 now.  However I am still finding that
authentication and search are taking a bit longer to respond.  Here is the
flow I am following.

1.  User hits the login page and sends credentials and enters their email
address and password.
2.  A generic account logs into Active Directory and searches for that
user.  If found, that user's information is returned and the connection is
closed.
3.  We then create another connection and authenticate the user based on
the username returned from step2.  Once authenticated the user is allowed
access to the application.
4.  This process takes ~16-25 seconds to complete.

I decided to test this outside of my web application so i went to the
python interpreter, imported ldap3 and did the following:

AD_URL = 'host:636'
PORT = 636

s = Server(AD_URL, get_info=None, use_ssl=True)
c = Connection(s, auto_bind=True, user='domain\username', password=password)

This process took about 6 seconds to complete.  I am trying to understand
where the choke point is right now.  Just wondering if it is our ldap
server or something else.

On Wed, Mar 11, 2015 at 11:38 AM, Python3-ldap <python3ldap at gmail.com>
wrote:

> Hi Derrick,
> what do you mean with "so much slower"? ldap3 is a pure python library,
> not a wrapper around openldap C libraries, so it is intrinsically slower
> than python-ldap. But in my usage I notice the  difference only with very
> long searches, not with authentication (even during authentication there
> may be a search operation if you read the schema of your ldap server). Slow
> connection can also be generated by wrong dns resolution.  Anyway, are you
> using the latest ldap3 (not python3-ldap) package?
>
> Bye,
> Giovanni
> ------------------------------
> Da: Derrick Jackson <derrick.jackson73 at gmail.com>
> Inviato: ‎11/‎03/‎2015 16:08
> A: python3-ldap at python.org
> Oggetto: [python3-ldap] Connection Slowness
>
> Hi all,
>
> I am trying to understand why connections (authentication and searching)
> are so much slower using python3-ldap with python 3.4 vs python-ldap with
> python 2.7.  Has anyone else noticed a difference?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python3-ldap/attachments/20150311/4c1f8887/attachment.html>


More information about the python3-ldap mailing list