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

B

Ben Sloan

Hi,

I'm using a custom class to connect and manipulate an active directory
server using the System.DirectoryServices.Protocols 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top