Why is LdapConnection.Bind() slow on a server?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben Sloan

    #1

    Why is LdapConnection.Bind() slow on a server?

    Hi,

    I'm using a custom class to connect and manipulate an active directory
    server using the System.Director yServices.Proto cols namespace. My
    application is an ASP.NET v2.0 application.

    When running on my local development machine (Windows XP Pro, logged
    in to our corporate domain) the ldapconnection. bind() is very quick -
    it takes only a fraction of a second to bind to the server.

    However when deployed to a server (also attached to the corporate
    domain), it takes around 13 seconds to bind to the server. Adding some
    tracing in reveals that it always takes around 13.1 or 13.2 seconds,
    as opposed to the 0.1 or 0.2 it takes from my local machine.

    A colleague suggested I tried adding impersonation to the application.
    I had a go at this, and made the application impersonate a domain
    user. With this in place, the binding times from the server dropped to
    the same as my development machine - 0.1 or 0.2 seconds.

    My question is- what's going on here? Why is it taking 13 seconds
    longer to bind to the ldap server from a server than my development
    machine? And why is it fixed by impersonation?

    We have a few applications that use this custom class- adding
    impersonation is not really my preferred way of solving this problem.
    Has anyone got any ideas?

    Much appreciated.
Working...